Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create buynow button for sandbox account

I'm new to paypal development and am trying to create a BuyNow button in the sandbox to enable me to test my application in a non production environment. If I create a button from my normal account it directs me to the live paypal site but if I try to create a button in the sandbox, the button creation page is always on the live box and I can't find anyway of creating a button in the sandbox using sandox test accounts, that then allows me to make test payments in the sandbox. Please help.

like image 625
STUART GRAY Avatar asked Mar 28 '13 17:03

STUART GRAY


People also ask

How do I test PayPal payments with sandbox?

During the test phase, use the sandbox endpoints and your sandbox account details in each PayPal API request that you make. Create and manage your set of sandbox accounts from the sandbox Accounts page. Use the Sandbox test site to review the transactions associated with the calls you make using your sandbox accounts.

How do I link my PayPal to sandbox?

Test. Log in to the Developer Dashboard and create a new sandbox test account. Click your Log in with PayPal button. Log in to PayPal using the test buyer account you created.


2 Answers

I can't comment because my reputation isn't high enough, but I thought it was important to add this element to Sadid Khan's correct answer. When trying to change the address to the sandbox you need to add the 'www' in front of the subdomain.

sandbox.paypal.com will redirect to the frontpage/homepage for the sandbox. www.sandbox.paypal.com will properly run the purchase emulation

like image 150
Mark Avatar answered Nov 18 '22 02:11

Mark


The link in the sandbox is broken and redirects you to the live site. When this happens, sometimes you can just add sandbox into the URL to correct the issue. So if you click the button and it takes you to https://www.paypal.com/button/blah_blah, you would just need to change it to https://www.sandbox.paypal.com/button/blah_blah. Another option would be to create a non hosted clear text button from your live paypal account and then just modify the URL to point to the sandbox instead of the live site. So instewad of the following:

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">

You woudl just change it to

<form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">

And then you would update the business variable to reflect the email address of your test sandbox seller account.

The last option for creating a button, would be not to log into your account but use the BMCreateButtom API call. Keep in mind this could be a little bit more work then you may want to do if you are only familar with HTML.

like image 21
PP_MTS_Chad Avatar answered Nov 18 '22 00:11

PP_MTS_Chad