-
Testing Paypal with sandbox
I’ve been testing out django-paypal with a view to using it on a new site. I was always quite against using Paypal - the ‘image’ doesn’t seem right and there are horror stories about non-existent customer service when they decide to stop accepting payments for you at seemingly arbitrary moments.
However, convenience wins sometimes, and the user experience (especially with Web Payments Pro) is pretty good.
So having decided to try it out, you need to use the sandbox. This isn’t going to be a long tutorial, but a collection of gotcha-resolution points as I come across them.Once you’ve created your sandbox account, you need to setup users within that account to represent merchants and buyers. You have the option to create ‘pre-configured’ accounts, or to create ‘manually’. Trust me: use the former. Your merchant account must have a validated email address to receive payments but, somehow, I couldn’t get that to fly when creating the account manually. Issues like that, and the longer setup time, means that unless you really really need to set up the account ‘just so’, kick off your efforts with a pre-configured account.
Now you’re flying. You have a merchant and buyer account in the sandbox. You can get your buyer to pay with Paypal. But now to test the experience for those who don’t have a Paypal account but want to pay by card. You’ll need a test card number to do this. Googling around you’ll find many pages with lists of numbers that should work. They don’t.
To get a card number to use, take the following steps:
- Login, in the sandbox, to one of your test buyer’s accounts
- Select the ‘Profile’ menu option
- Under ‘Financial Information’ click ‘Credit/Debit Cards’
- Now click the ‘Add card’ button
- You will be presented with a screen that is pre-filled with a generated card number. Copy this number and leave the page without clicking ‘Add card’ otherwise the card will be associated with the paypal account and you will not be able to use it in the context of a non-logged in user
- You can now use this card number for test transactions, using any future date for the expiry date, and any three digits for the CVV
django-paypal seems to be working fine for me so far. To use WPS I shall need to add the ability to do cart upload as well as set some other arguments on the button, but this will not be hard. I’ll add any learnings to this document as I go.