39
votes

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?

4
What did paypal say when you asked them directly for support?admdrew
@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
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
@jayoaK I don't think I ever got a conclusive answer from them directly; I solved my specific issue with my answer below…Kris
@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 ?, ThanksBMaximus

4 Answers

45
votes

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.

36
votes

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
votes

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.

1
votes

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).