Reply
Member
Posts: 3
Registered: ‎01-14-2021

Testing a credit card that is supposed to decline but gets accepted

In developer mode, I've tested credit cards that usually give the correct response (invalid expiration date, invalid card number, accepted, etc.). However, when I enter in my credit card and intentionally put in something incorrect (such as wrong year) and pass it through, it goes through as accepted. This shouldn't happen because it's not an actual valid card, yet I can't seem to get the proper error response to appear, just that it's accepted. 

How can I go about getting this to work in development? This applies to any scenario where a card should be declined and the transaction shouldn't return a success, but still does.

Administrator
Posts: 170
Registered: ‎11-29-2017

Re: Testing a credit card that is supposed to decline but gets accepted

In the production system the expiration date will be passed on through the system to be validated by the card issuer. In the sandbox there are no live processor connections and the transaction will not reach the issuer. As a result, an expired card will not result in a decline in the test system unless you use the test triggers.

 

Using the Transaction Amount Triggers, submit a request with the amount of $8 to generate an expired card response.

here: https://developer.authorize.net/hello_world/testing_guide.html

Member
Posts: 3
Registered: ‎01-14-2021

Re: Testing a credit card that is supposed to decline but gets accepted

An expired card works; I meant that I'd enter in the incorrect expiration date (2023 instead of 2024, for example) and it would still go through, or if I test a card that has no more credit available and still gets "charged". 

Administrator
Posts: 170
Registered: ‎11-29-2017

Re: Testing a credit card that is supposed to decline but gets accepted

The same principle applies - the sandbox doesn't go out to the card issuer so the responses are simulated. Due to that, no expiration dates or card verifications (outside of basic field & data type validations) occur in the sandbox.

 

In the cases you have described, the simulator will return a successful response.

Member
Posts: 3
Registered: ‎01-14-2021

Re: Testing a credit card that is supposed to decline but gets accepted

So is there any way to test the cases I've mentioned in a non-live environment, or do I just have to test in a live environment and debug from there?

Highlighted
Regular Contributor
Posts: 81
Registered: ‎05-29-2015

Re: Testing a credit card that is supposed to decline but gets accepted

See the Testing Guide.  You set the Bill-to zip to certain values to get a different return.