PayPal Commerce test cards
Use these details to try payments in a PayPal sandbox (test) account. They work only in the sandbox: never use them in live, and never put real card or bank details into a sandbox.
You need a PayPal developer account and sandbox accounts first: see PayPal sandbox testing for how to set them up.
How to choose a test result
Section titled “How to choose a test result”- Cards: the name sets the result. Enter one of the decline triggers below as the customer’s first name in the checkout and leave the last name empty: we send the first and last name together as the name on the card, so if both are filled in, PayPal receives both and the trigger won’t match. The triggers only work when the connection’s Account Type shows PayPal with Advanced Card Processing (see Connecting PayPal Commerce).
- 3D Secure: in the sandbox, we ask PayPal for 3D Secure on every card payment made with the customer present, so expect a 3D Secure step. PayPal’s 3D Secure test scenarios page lists cards for each outcome.
- Other PayPal errors: enter
PayPal-Mock-Responseas the customer’s first name and a PayPal error code as the last name (see Errors from PayPal’s API below). We then send PayPal’s mock response header, which works only in the sandbox. - PayPal button: log in with a personal sandbox account, not the business account.
- Venmo: the amount sets the result: type it as shown below, for example
12.34. Venmo appears only for US customers, and only if Disable Venmo Button is off in the PayPal Commerce connection here.
Use a future expiry date and a 3-digit CVC, or a 4-digit CVC for American Express.
Successful payments
Section titled “Successful payments”| Card | Number | Notes |
|---|---|---|
| Visa | 4012 8888 8888 1881 |
PayPal’s suggested default test card |
| Visa | 4444 3333 2222 1111 |
Used in our own tests |
| Mastercard | 2223 0000 4840 0011 |
|
| American Express | 3714 496353 98431 |
|
| Diners Club | 3646 151000 0039 |
|
| JCB | 3636 5000 0000 0260 |
|
| Discover | Generate one | PayPal doesn’t list a fixed Discover number. Use the credit card generator on PayPal’s Card testing page. |
PayPal lists more test numbers on its Card testing page. Its credit card generator makes extra test cards, which PayPal says you can use to test card payments, including in PayPal Checkout, or add to a personal sandbox account.
Declines and errors
Section titled “Declines and errors”To make a card payment fail, use a test card (for example 4012 8888 8888 1881) and enter one of these triggers as the customer’s first name, with the last name left empty. Triggers are case-sensitive. They work on card payments taken with Advanced Card Payments, which PayPal calls Expanded Checkout.
| Number or trigger | Result |
|---|---|
CCREJECT-REFUSED |
Declined: do not honour (0500) |
CCREJECT-BANK_ERROR |
Declined: generic decline (5100) |
CCREJECT-IF |
Declined: insufficient funds (5120) |
CCREJECT-EC |
Declined: expired card (5400) |
CCREJECT-IA |
Declined: invalid account (1330) |
CCREJECT-IRC |
Declined: invalid or restricted card (5180) |
CCREJECT-LS |
Declined: lost or stolen card (9520) |
CCREJECT-SF |
Declined: suspected fraud (9500) |
CCREJECT-CVV_F |
Declined: CVC check failed (00N7) |
PayPal returns these payments with an address check result of “globally unavailable” and a CVC result of “not processed”.
PayPal
Section titled “PayPal”To pay with the PayPal button, log in to PayPal with a personal sandbox account. That account plays the customer; the business sandbox account is the merchant. PayPal creates one of each when you register as a developer. You can find their email addresses and passwords, or create more, in the PayPal Developer Dashboard under Sandbox > Accounts.
Venmo is only available in the US. In the sandbox, these amounts give an error and any other amount succeeds:
| Amount | Result |
|---|---|
12.34 |
Declined: insufficient funds |
21.43 |
Declined: account closed |
11.45 |
Declined: account frozen |
10.23 |
Declined: suspected fraud |
13.42 |
Declined: generic decline |
| Any other amount | Approved |
On a desktop you see Venmo’s web login. On a phone you see the Venmo app if it is installed, or the web login if not. The desktop QR code that customers see in live can’t be tested in the sandbox.
Errors from PayPal’s API
Section titled “Errors from PayPal’s API”To make PayPal return a particular error, enter these details as the customer’s name in the checkout:
| Field | What to enter |
|---|---|
| First name | PayPal-Mock-Response |
| Last name | The PayPal error code to return, for example INSTRUMENT_DECLINED, PAYER_CANNOT_PAY, CARD_EXPIRED or TRANSACTION_REFUSED |
We then add PayPal’s PayPal-Mock-Response header to our calls to PayPal for that payment, for card and PayPal button payments alike, and PayPal’s sandbox returns that error instead of its normal response. It works only in the sandbox. PayPal explains the header on its Negative testing request headers page and lists the error codes on its Orders API errors page.
Was this page helpful?
What went wrong?
Thanks for telling us.