How to trigger a paypal payment declined error after successful
preauthorization?
In paypal sandbox, I use the adaptive payments api to setup a
preauthorization. Then the pay call can be used to make a payment with the
preauthorization token.
I'd like to test for a failure case where the pay call does not succeed.
Is there a way I can modify the limits of the credit card, remove the
card, or do something similar, so that the pay call fails?
Here are some things I tried that did not work:
1) Negative testing mode turned on for the merchant account. And followed
docs below
To trigger errors on fields that are not amount related, specify the error
code in whole. For example, use a value of 10539 to trigger a "payment
declined" error.
This just resulted in a successful pay call, and from the docs it is not
entirely clear to me if this method is even supported by adaptive
payments.
2) Deleting the credit card in sandbox for a particular test account. When
I click on 'remove', sandbox just displays a message that says:
'Your credit card has not been removed.'
3) Editing the credit card in sandbox, so that I can edit the expire date
to the past. When I click on 'edit' in sandbox, it just takes me to an
error page that says
Bad Request
4) Canceling the pre approval from the personal sandbox test account. This
method works, however it is not ideal since it can not be un-canceled. I'd
like to test a scenario where after the payment is declined, the customer
takes some action on their paypal account (e.g. raises limits, adds a
credit card, etc), so the pay call would succeed on a second try.
No comments:
Post a Comment