How can I check if a credit card has been decline in .NET code using the Paypal API
What method and property in the Paypal API can I use to set an开发者_Python百科 error code to simulate a declined credit card?
Or if there another way to do it via using a credit card in the sandbox?
Usually there's specific card and CSV numbers too simulate the responses. Read the documentation it will be in there.
You can see a full list of the paypal response codes here.
Assuming you are using a direct payment call, there's a few possible decline reasons but you probably want 15005 or 15006 - or just a short message response of "Processor Decline".
For those using Payflow Pro, chapter 5 of the official documentation contains the credit card numbers used, and more importantly, the codes you'll receive for each status.
These codes are different than the 5-character PayPal codes returned by the previously mentioned documents. (Or at least I can't find the simpler codes).
精彩评论