PayPal Sandbox Testing

The PayPal sandbox works a little differently from other gateways.

To test PayPal you must:

  1. Create a PayPal developer account at developer.paypal.com.
  2. Create a sandbox account.
  3. Get the API credentials / test credit card.
Sandbox accounts Sandbox accounts - select Test credentials

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: