Negative Test Error Conditions
By default, the sandbox mimics the live PayPal site as closely as possible and you must replicate specific error conditions in your test calls by creating the exact conditions needed to trigger the errors. The sandbox, in its default setting, is a positive test environment that's well-suited for testing your program as it follows an error-free path.
Negative testing is a key testing tool that forces flows through the specific error conditions that you want to test. Use negative testing to trigger:
- PayPal API errors.
- Virtual Terminal and
DoDirectPaymentoperation errors. (Verification and credit card validation errors.)
Note: Negative testing is available in the sandbox only. You cannot force or simulate error conditions in the live PayPal environment. You can use negative testing with REST APIs and NVP/SOAP PayPal APIs versions 2.4 and later. And also note that negative testing is only available for business accounts.
Important: Negative testing in the sandbox for REST APIs is in Beta, so it might have bugs or issues.