40

I'm having trouble testing credit card payments with PayPal's sandbox. When viewing a buyer's sandbox account's profile from within developer.paypal.com, I can see the following credit card details:

account

Although, when using these details on the payment screen, I get the message "We're sorry, we can't complete this payment. Please try another card."

error

I have read in other questions that you should be able to log into a sandbox account, go to add an additional credit card and it should generate some test numbers for you... However, when I do this, all of the fields are blank:

add

I have also tried using some "valid" numbers (i.e. they pass the Luhn algorithm), but none of those worked for me either.

I've also tried the numbers listed on this page: https://www.paypalobjects.com/en_US/vhelp/paypalmanager_help/credit_card_numbers.htm - They didn't work.

I've tried both US and UK accounts. No luck.

Any ideas?

Kris
  • 1,094
  • 3
  • 13
  • 23
  • What did paypal say when you asked them directly for support? – admdrew Feb 03 '14 at 20:49
  • @admdrew I'm waiting to hear back from them. However, the first point on the support page says "Visit StackOverflow to check out our PayPal forum", so thought I'd ask here as well while I'm waiting, to see if I'm missing something obvious. – Kris Feb 03 '14 at 20:59
  • adding the new card to the account works but when I go to pay using the newly added card it still gives me the same generic error: "Error: There is a problem with your card. Please verify card details with your Bank.". @Kris did you ever hear anything back from them about this? – jtate Oct 13 '15 at 13:36
  • @jayoaK I don't think I ever got a conclusive answer from them directly; I solved my specific issue with my answer below… – Kris Oct 29 '15 at 10:00
  • @Kris can you please provide a link how you managed to give the options of paying with CreditCard and PayPal? i have implemented the paypal, and now i am trying to do the credit card, but this solution you provide (redirecting to paypal and giving the options on their site) is more suitable for me. can you please give a hand ?, Thanks – BMaximus May 24 '16 at 06:54
  • developer.paypal.com/developer/creditCardGenerator I used this but still getting an error: "SORRY THIS CARD IS NOT SUPPORTED." – Sumit Shukla Aug 14 '20 at 12:08
  • Check these cards https://www.paypalobjects.com/en_AU/vhelp/paypalmanager_help/credit_card_numbers.htm – Knase Oct 18 '21 at 13:33

5 Answers5

52

A bit late in the game but just in case it helps anyone.

If you are testing using the Sandbox and on the payment page you want to test payments NOT using a PayPal account but using the "Pay with Debit or Credit Card option" (i.e. when a regular Joe/Jane, NOT PayPal users, want to buy your stuff) and want to save yourself some time: just go to a site like http://www.getcreditcardnumbers.com/ and get numbers from there. You can use any Expiry date (in the future) and any numeric CCV (123 works).

The "test credit card numbers" in the PayPal documentation are just another brick in their infuriating wall of convoluted stuff.

I got the url above from PayPal's tech support.

Tested using a simple Hosted button and IPN. Good luck.

cucu8
  • 891
  • 10
  • 12
  • 2
    Thanks, this works. PayPal must have changed their validation on the sandbox, because the test numbers I used to use don't work anymore. – jdhildeb Jul 29 '15 at 21:45
  • 1
    This is probably a bad thing though - and terrible if Paypal did distribute it. The schemes provide specific test-pan ranges (which are valid card numbers, but will never route). you perhaps should have a look at: http://support.worldpay.com/support/kb/bg/testandgolive/tgl5103.html – Jmons Dec 07 '15 at 10:14
  • 6
    +1 for "infuriating wall of convolution". I absolutely agree. They're a pain in the butt to code with. Idiots. – Martin May 13 '16 at 12:31
  • 1
    I am having the same problem, but this is not working for me, any ideas ? – William Aug 13 '20 at 03:56
  • 1
    https://developer.paypal.com/developer/creditCardGenerator/ I used this but still getting error: "SORRY THIS CARD IS NOT SUPPORTED." – Sumit Shukla Aug 14 '20 at 12:07
  • still the same issue with the cards, any new solution ??? – Avin Mathew Jan 05 '22 at 13:52
  • We gave up on PayPal quite a while ago. Sorry. – cucu8 Jan 06 '22 at 17:07
36

In case anyone else comes across this in a search for an answer...

The test numbers listed in various places no longer work in the Sandbox. PayPal have the same checks in place now so that a card cannot be linked to more than one account.

Go here and get a number generated. Use any expiry date and CVV

https://ppmts.custhelp.com/app/answers/detail/a_id/750/

It's worked every time for me so far...

2

If a credit card is already added to a PayPal account then it won't let you use that card to process directly with Payments Advanced. The system expects buyers to login to PayPal and just choose that credit card as their funding source if they want to pay with it.

As for testing on the sandbox, I've always used old, expired credit cards I have laying around and they seem to work fine for me.

You could always try the ones starting on page 87 of the PayFlow documentation, too. They should work.

Drew Angell
  • 25,968
  • 5
  • 32
  • 51
  • I've now also tried the numbers listed in the PDF you've referenced, and a couple of expired cards I have. Still the same error message. I can complete the process when paying with a PayPal account, so I don't think I've misconfigured anything… I'll have to see what PayPal comes back to me with in my support request I guess. – Kris Feb 04 '14 at 10:51
  • 1
    The link is deprecated. Currently, it suggests to update bookmarks with this one: https://developer.paypal.com/webapps/developer/docs/classic/payflow/integration-guide/ – Namek May 18 '16 at 07:36
  • HOW did this answer didn't get attention!!! the test now works fine after I used another card number rather than the one submitted with the sandbox account. thanks – Accountant م Oct 30 '17 at 21:50
1

It turns out, after messing around with all of the settings in the test business account, that one (or more) of the fraud related settings in the payment receiving preferences / security settings screens were causing the test payments to fail (without any useful error).

Kris
  • 1,094
  • 3
  • 13
  • 23
  • 7
    Would be really really helpful if you could remember which setting this was. – Jordan Reiter Aug 23 '16 at 18:10
  • By default, PayPal rejects payments with duplicate invoice ids. You can either turn this check off in the settings for your sandbox account or make sure that your POST form generates a new invoice id for each request. – Marc Culler Feb 18 '18 at 17:47
1

Now you can use the Credit Card Generator tool under Mock (in your Paypal Developer Interface). Just look at the following screenshot.enter image description here

Youssef
  • 2,866
  • 1
  • 24
  • 20