Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paypal sandbox negative testing not working

I have set up negative testing for an account then set the error code desired as the Transaction Amount Field for example 106.06 to invoke error code 10606 "Buyer cannot pay” no errors are returned the order is processed.

If I try another error code 10539 “This transaction cannot be processed”. An error is return and the order is not processed.

I am using the The US site error codes: http://www.paypalobjects.com/en_US/ebook/PP_APIReference/Appx-ErrorCodes_and_Messages.html and we are in Australia are these the correct error codes?

Any ideas what is causing this? Is this the correct way to use Negative Testing in the sandbox?

Thanks

like image 386
mark s Avatar asked Aug 14 '13 22:08

mark s


People also ask

How do I test failed transactions in the PayPal sandbox?

Go to the developer.paypal.com home page. Log into the Dashboard if you are not already and click the pull-down menu beneath your name to select Dashboard . Under the Sandbox heading in the left navigation column, click on Accounts . Locate the sandbox account for which you wish to enable negative testing.

How do I test my PayPal sandbox account?

Next, you'll need to go to the PayPal Developer site and use your existing PayPal account to log in. Once you're logged in, look under the Sandbox section in the lefthand menu and click Accounts. PayPal will have already created two test accounts for you: one for a Business account and one for a Personal account.

How do I run PayPal in test mode?

If you want to avoid this charge or do more extensive testing, you can use the gateway in test mode in combination with a PayPal developer account. Go to Payment Setup and ensure the PayPal account is the one used in the Sandbox. Check the box Test mode. Switch to the sandbox gateway.

Is PayPal sandbox real money?

In Sandbox mode, the PayPal gateway functions exactly the same as in Live Mode except transactions do not involve real money. To run sandbox mode you'll need a developer account from https://developer.paypal.com.


1 Answers

I know this is late but I stumbled across the answer for me.

You didn't specify the API Name you are working with DoExpressCheckoutPayment and according to Paypal's Negative Testing Docs we are supposed to use an AMT field and

To trigger an error condition on an amount-related field, specify a error code value as a number with two digits to the right of the decimal point. For example, specify a value of 107.55 to trigger the 10755 error.

I found their information to be completely false! What I finally got working was to use PAYMENTREQUEST_0_AMT and NOT use a decimal.

So here is what I came up with

USER={yourUID}&
PWD={yourPSWD}&
SIGNATURE={yourSig}&
TOKEN={yourToken}&
METHOD=DoExpressCheckoutPayment&
VERSION=119&
PAYMENTREQUEST_0_AMT=10486

Edit: I later found a better option specifically for the Payment Method Refused (10486) that I mentioned above. Take a look: https://developer.paypal.com/docs/classic/express-checkout/ht_ec_fundingfailure10486/#testing-saleorauth

like image 166
Joshua Goossen Avatar answered Sep 28 '22 08:09

Joshua Goossen