To enable negative testing correctly:
- Go to the Settings> Profile > page of your Business Account trading account (see Sandbox Account Management ).
- On the Profile tab, set Negative Testing to.
To cause some specific error, please check out this link with an updated guide for testing API error handling procedures : https://developer.paypal.com/webapps/developer/docs/classic/lifecycle/ug_sandbox/#errors
Use negative testing to run the following types of errors:
- Errors that occur when calling the PayPal API.
- Error-related virtual terminal and DoDirectPayment operation (verification and validation of credit card validation).
You can force two types of API errors: those that are related to the amount of the transaction, and those that are not related to the amount.
Note. Negative testing is only available in the Sandbox - you cannot force or simulate error conditions in a PayPal live environment. Negative testing can be used with the classic PayPal APIs of version 2.4 and later.
source share