after 5 hours of research and reading outdated paypal documentation I finally give up!
I need to test a simple paypal subscription button with the paypal sandbox.
Button Code:
<form action="https://www.sandbox.paypal.com/us/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="34CXHXVU2J8BY"> <input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online." style="border:none;padding:0;height:auto;width:auto"> <img alt="" border="0" src="https://www.paypalobjects.com/de_DE/i/scr/pixel.gif" width="1" height="1"> </form>
But when I try to send the form, I get this error on the paypal website:
Thanks in Advance, Phillip
To begin your test payment, fill out the form with the Personal test email listed in your PayPal Developer account. After you submit the form, you'll be redirected to PayPal's site. Here, you'll need to log in using the same Personal test email you entered in the form as well as the password you created for it earlier.
Use the sandbox business account information from the Developer Dashboard to log in to https://www.sandbox.paypal.com/billing/subscriptions. This URL takes you to the subscriptions management page in the sandbox business account. Confirm the subscription made by the test buyer appears on the Subscriptions tab.
On your WordPress dashboard, hover over WooCommerce and click Settings. Next, click the Payments tab and click Manage next to PayPal. Under Advanced Options, find “PayPal sandbox” and click “Enable PayPal sandbox”.
The problem is that you've generated a 'hosted' PayPal button in the live PayPal website, but you're sending this data to the Sandbox.
Since the hosted_button_id
isn't recognized in the Sandbox, it returns an error.
You'd need to either:
www.sandbox.paypal.com > Profile > PayPal Buttons.
TL;DR: Sandbox is 100% separated from the Live PayPal website. A hosted button generated in Live, doesn't work in Sandbox.
Just a short add how to make the hosted button in the sandbox:
Hopefully this saved you some time :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With