Before 2 weeks ago we were able to simulate negative testing but actually we can't test error condition (pending, error) in PayPal sandbox, the AdaptivePayment API response give always COMPLETED.
We followed this guide to set correctly our sandbox account, There are some problems with the new Developer environment.
Can someone tell some tips for testing negative conditions?
Advance Thanks
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.
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.
Then, navigate to Payments » PayPal Standard and check the box labeled Enable PayPal Standard payments to activate PayPal's settings. Under PayPal Email Address, you should then enter the test Business email listed on your PayPal Sandbox page. Then set the Mode to Test/Sandbox.
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.
It is available, but you have to go to https://developer.paypal.com/developer/accounts
This option is not available at https://www.sandbox.paypal.com
Also you may need to link your account if you already created an account in the sandbox: https://devblog.paypal.com/sandbox-account-linking/
You need to find a screen that looks like this and click Profile
Then the option is available.
In order to enable correctly Negative Testing:
In order to trigger some particular error please check at this link the updated guide for Testing API error handling routines: https://developer.paypal.com/webapps/developer/docs/classic/lifecycle/ug_sandbox/#errors
Use negative testing to trigger the following types of errors:
You can force two types of API errors: those related to the transaction amount, and those not related to the amount.
Note: Negative testing is available only in the Sandbox—you cannot force or simulate error conditions in the live PayPal environment. Negative testing can be used with Classic PayPal API versions 2.4 and later.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With