Basic Testing for Sandbox Accounts

RaseOne
Contributor
Contributor

I have set up two sandbox accounts. One for business  (merchant) and one for test customers (personal). The accounts are active within the developer portal and the email addresses are real, working email addresses. I have given the test buyer account a fictitious balance of $1,000 and enable visa. I've set up standard "buy now" and "add to cart" buttons with my merchant account email address coded as the recipient. When I attempt to make a purchase I am unable to log in via the test buyer account and I can not complete a test purchase. At this point I am not trying to test any API or IPN functions, just a simple sandbox transaction. I've looked over a ton of documentation and I'm not sure how to make this work. Please advise.

 

Sandbox Merchant ID: IDG64G6RSC69TWE

Login to Me Too
1 REPLY 1

RaseOne
Contributor
Contributor

I found a simple work-around though I'm not sure it's the intended function... I did not find this in the developer documentation. I hacked it myself on a hunch and it worked.

 

If  you're using a PayPal Standard Payments html "buy now" or "add to cart" button...

 

Apparently, to create a test transaction the PayPal payment form must be directed to the sandbox testing site. 

 

In the PayPal button code change:
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
to:
<form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">


Adding the "sandbox" subdomain into the form target URL allowed the test purchases to complete. Without doing that I was being asked to log in but paypal was not accepting the credentials for the sandbox buyer account. If anyone knows whether or not this is the intended use please fill me in.

 

Thanks!

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.