0
votes

I have created a SandBox account with -facilitator and -buyer test accounts, and logged in as the -facilitator account to create a test Buy Now button. I originally did this using a live PayPal account and it worked fine, although I never went through to the end and actuall bought anything.

My concern is that having logged into the SandBox account (www.sandbox.paypal.com is in the address) when I create a Buy Now button, the code is shown on a page with www.paypal.com in the address bar and the button code includes form action="https://www.paypal.com/cgi-bin/webscr" method="post"..

In the PayPal documentation, it shows a code snippet with form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"..

Note that the URL with my button is not for the SandBox, whereas the documentation URL is. I am doing this from the UK but it seems wrong to me. I have not tested it but was hoping someone could comment?

Many thanks.

1

1 Answers

0
votes

You are right about your problem.

If the form action points toward "https://www.paypal.com....." this means that the payment is made in the Live environment of PayPal.

In order to have a button pointing to Sandbox, the form action will have to begin with "https://www.sandbox.paypal.com....."

For example, this is a button pointing toward sandbox environment

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" >
	<input type="hidden" name="cmd" value="_xclick">
	<input type="hidden" name="item_name" value="Object name">
	<input type="hidden" name="business"value="[email protected]">
	<input type="hidden" name="quantity" value="1">
	<input type="hidden" name="amount" value="47.47">
	<input type="hidden" name="currency_code" value="GBP">
	<input type="image" src="https://www.paypalobjects.com/webstatic/en_US/btn/btn_buynow_cc_171x47.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
	<img alt="" border="0" src="https://www.paypalobjects.com/fr_FR/i/scr/pixel.gif" width="1" height="1">
<form>

Hoping my answer will help you.