Can you somehow configure a test account in the PayPal Sandbox testing environment to return a credit card declined failure message when that user tries to submit a payment or trigger a failure message on an individual transaction?

I've looked around on the Internet for way to do this, and some of the suggested solutions included:

  • Altering the test user account address to trigger address verification failure (which did not work, but it was seven-year-old documentation).
  • Turn on negative testing and fire off requests to the sandbox to get a failure message according to the amount you send in (which won't work for me, as I'm trying to test this from the user's perspective by creating the transaction through the Web site and submitting for PayPal payment, and seeing how the system processes the response).
  • Submitting a transaction over $1000 (which won't work as our transactions do not exceed $100 in value).

I know you can fail an eCheck payment while it's pending, but I don't see any way to do the same with credit card payments. Is there a means?

  • I also saw a suggestion that you can trigger a decline if you add a credit card that is not one of PayPal's stock credit card numbers during the payment process, but this did not trigger a decline on payment. Commented Apr 11, 2013 at 19:38

1 Answer 1


Most payment providers supply test card numbers to enable you to do this, for example WorldPay has the following:


Testing Transactions A number of different cases can be tested by entering the following values as the card/accountholder name () in the order:

REFUSED – will simulate a refused payment REFERRED - will simulate a refusal with the refusal reason ‘referred' FRAUD - will simulate a refusal with the refusal reason ‘fraud suspicion' ERROR - will simulate a payment that ends in error. All other card/accountholder names will simulate an authorised payment.

For test purposes we have provided a set of test credit and debit card numbers, these are listed below in the Test Card Numbers section.

Captures and refunds can be simulated through the Merchant Administration Interface. Use the "Capture" or "Refund" button in the Payment and Order Details page. Alternatively, you can send an XML capture or refund order modification to the Test environment.

(I haven't added the numbers to this post as they can change, going to the Worldpay site and getting the latest information is always the best thing to do)

You can create test accounts in PayPal, so I would try using some of the credit card details referred to in the link above with a PayPal test account and see how it goes. It looks like PayPal will also generate test credit card numbers so that you can test valid transactions (Having a quick look at their Sandbox guide):


(Specifically Page 30)

Hopefully the above has given you all the information you need.

  • I am not sure how to apply this suggestion to the PayPal sandbox interface. Commented Apr 23, 2013 at 18:18
  • When you create a test account in the sandbox, it assigns a test credit card to your account. You can add another credit card to the account, and if you can find a test account number not already associated with a sandbox test account, payment using that credit card will automatically succeed. Additionally, test accounts all look to have the name associated with the PayPal developer account used to log into the Sandbox, so all you can do is change the first name to Refused, but a transaction with Refused <lastname> plus additional test credit card number will still succeed. Commented Apr 23, 2013 at 18:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.