PayPal Sandbox Testing
The PayPal sandbox works a little differently from other gateways.
To test PayPal you must:
- Create a PayPal developer account at developer.paypal.com.
- Create a sandbox account.
- Get the API credentials / test credit card.
Failure scenarios
To test failure scenarios, an HTTP header needs to be passed to PayPal. This applies only to sandbox payments.
You can do this by setting the customer name:
first_name: PayPal-Mock-Response
last_name: PAYER_CANNOT_PAY
Where the last name is the response you want to emulate.
See PayPal's documentation for details: