1
votes

I have created the shopping cart button using Paypal Button JS plugin (http://paypal.github.io/JavaScriptButtons/).

The button code is like this

<script 
data-env="sandbox" 
data-callback="http://mysite.com" 
data-tax="10" 
data-shipping="10" 
data-currency="USD" 
data-amount="100" 
data-name="TestProduct" 
data-button="cart" src="[email protected]"

>

I downloaded the java script from the link given above. I have created the merchant and buyer account from paypal sandbox site.

But When I trying to test in my local/test environment it is going to live paypal site(do not accepting my sandbox buyer account). Please help me to test in the sand box environment.

2
Can you provide a link to your checkout on your site?PP_MTS_Chad

2 Answers

2
votes

I had the same problem today and it looks like a bug with the paypal-button-minicart.min.js script. Apparently this was fixed back in April according to GitHub but still seems to be an issue.

I got this working by editing the file and searching for "www.paypal" and replacing the instance with "www.sandbox.paypal"

I also had a problem with my test account email - so I created a second merchant account in the developer tools and put that in the "[email protected]" section and was up and running.

Not a good solution I know, but a solution none the less.

-2
votes

add this data-host="www.sandbox.paypal.com"