Testing Paypal Subscribe Buttons

January 8, 2011

This article covers testing a paypal subscribe button using the paypal sandbox. The button is embedded in a Django application.

Settings Up Your Code

Ensure that all paypal domain names use a setting, for example

PAYPAL_URL = "www.sandbox.paypal.com"

This is the sandbox url for testing, we'll change this to the correct one for live use.

Setup Sandbox

Go to the PayPal sandbox at https://developer.paypal.com/ and signup. Do not use your production login details.

Next, create a seller test account and a buyer test account. Make a note of the passwords, you'll need them later.

Select the seller account, and click "Enter Sandbox Test Site".

Problems

Login using the password you made a note of earlier, then create the test subscribe button the same way as you did for the live button. (Merchant Services/Sell subscriptions). Helpfully, this doesn't work for me - it redirects me to https://www.paypal-business.co.uk and only gives me options for setting up real buttons. This problem was known about in October 2010 but still isn't fixed, three months later. Grrr.

The workaround is to change the button to be a non-hosted one, and then just change it to point at the www.sandbox.paypal.com site instead. Use the Remove Code Protection button on the generated button HTML to see the individual fields. Copy this code into your web page as required, making sure to change the url. You must also change the value of the hidden field business to be your test seller's email.

Now, upload your code to the server and give it a try.

Troubleshooting

  • The link you have used to enter the PayPal system is invalid. Please review the link and try again.. This was caused by not changing the value of the business hidden field on the button. This needs to be the sandbox account, not your real account.

References

Tags: paypal django