Hey sparky,

I hope this helps:

Create your checkout form and if the form is valid populate the following
dict with the form data:

data = {
                'VPSProtocol': settings.VPS_PROTOCOL,
                'TxType': settings.TXTYPE,
                'VendorTxCode':
b32encode(uuid.uuid4().bytes).strip('=').lower(),  # Generate a new
transaction ID
                'Vendor': settings.SAGEPAY_VENDOR,
                'Amount': order.totalAmountAsString(),
                'Currency': 'GBP',
                'Description': 'BC Order ID: %s' % order.orderId,
                'CardHolder': clean_checkout_form['card_name'],
                'CardNumber': clean_checkout_form['card_number'],
                'ExpiryDate':
clean_checkout_form['card_expiry'].strftime('%m%y'),
                'CV2': clean_checkout_form['card_CVV'],
                'CardType': clean_checkout_form['card_type'],
                'CustomerEMail': clean_checkout_form['email'].lower(),
                'BillingSurname': clean_checkout_form['lastname'],  # 20
Chars
                'BillingFirstnames': clean_checkout_form['firstname'], # 20
Chars
                'BillingAddress1': clean_checkout_form['billing_address'],
 # Truncate to 100 Chars
                'BillingCity': clean_checkout_form['billing_city'],  #
Truncate to 40 Chars
                'BillingPostCode': clean_checkout_form['billing_postcode'],
 # Truncate to 10 Chars
                'BillingCountry': clean_checkout_form['billing_country'],
 # 2 letter country code
                'DeliverySurname':  clean_checkout_form['lastname'],  # 20
Chars
                'DeliveryFirstnames': clean_checkout_form['firstname'],  #
20 Chars
                'DeliveryAddress1':
 clean_checkout_form['shipping_address'],  # 100 Chars
                'DeliveryCity': clean_checkout_form['shipping_city'], # 40
Chars
                'DeliveryPostCode':
clean_checkout_form['shipping_postcode'],  # 10 Chars
                'DeliveryCountry': clean_checkout_form['shipping_country'],
 # 2 letter country code
                'CreateToken': 1
            }

Your field names will be different.

Encode it:



On 10 April 2013 02:27, sparky <cfspa...@gmail.com> wrote:

> I want to use 
> django-sagepay<https://github.com/timetric/django-sagepay/tree/master/django_sagepay>.
> However, it doesn't  seem to have any examples or test.py that I can learn
> from. being a newbie I need docs!
>
> Does anyone know of any examples of use? I'm very familiar with sagepay,
> just need to know how to implement this application into my app.
>
> For example, any app I can look at that makes use of this 
> django-sagepay<https://github.com/timetric/django-sagepay/tree/master/django_sagepay>
> ?
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to