JoseMarmolejos
JoseMarmolejos

Reputation: 1770

Negative testing using the Rest API

I'm trying to get a direct credit card payment declined through the rest api but no matter the amount I send, I always get the transaction approved. I read in the classic API docs that by sending 105.39 as the amount total I could force the api to decline the payment, but all I'm getting is a INTERNAL_SERVER_ERROR response when I do this.

So the question is: how do I get the rest api (sandbox) to decline a direct credit card payment?

Upvotes: 2

Views: 1414

Answers (1)

Jeff Brateman
Jeff Brateman

Reputation: 3277

The developer sandbox is very forgiving, and will usually accept just about anything (yes, this is less than ideal). I'd recommend just trying a bad card number in live (4111 1111 1111 1111 comes to mind). Don't do it too many times in a row, however, or PayPal will start throttling your requests.

If you're really just looking for a mocked endpoint that returns canned errors, I'd try mockable.

Upvotes: 3

Related Questions