Reply
Contributor
Posts: 23
Registered: ‎02-24-2017
Accepted Solution

How to test declines with Accept.JS

If I'm using a paymentNonce generated by Accept.JS to perform a transaction, how do I test declines? The transaction amount triggers have apparently been deprecated in favor of zip codes, but Accept.JS doesn't take a zip code. https://developer.authorize.net/hello_world/testing_guide/

Accepted Solutions
Solution
Accepted by topic author glyoder
‎03-15-2017 09:10 AM
All Star
Posts: 699
Registered: ‎11-03-2016

Re: How to test declines with Accept.JS

Hi @glyoder,

 

The Accept.js does take a zip code. If you'd like to test a decline, your best bet would be to insert code that sends the appropriate zip code in with your dispatchData call. Even if your form isn't asking for a zip code, you can still send the value in with your script.

 

Alternatively, even though our testing guide mentions that testing based on amounts is deprecated, it does still work for now. Sending a transaction of 70.02 through Accept.js will result in a decline.

View solution in original post


All Replies
Posts: 2,527
Topics: 56
Kudos: 200
Blog Posts: 67
Registered: ‎12-05-2011

Re: How to test declines with Accept.JS

[ Edited ]

Hello @glyoder

 

The Accept.js library is used solely to create a one-time token, it does not actually perform any additional validation other than simple mathmatical checks.

 

When you use createTransactionRequest to submit the nonce or one-time token, that is where you can use the testing guide to trigger a decline.

 

Richard


Build modern websites and mobile applications without increasing PCI burden using Authorize.Net Accept


DPM will be disabled in the sandbox on 7/1/2018. EOL 7/1/2019.
Contributor
Posts: 23
Registered: ‎02-24-2017

Re: How to test declines with Accept.JS

[ Edited ]

Understood, but we don't ask for a zip code in our use case -- we go straight from payment nonce to transaction with minimal info. Since payment amounts no longer trigger an error, I'm not sure how to proceed.

Solution
Accepted by topic author glyoder
‎03-15-2017 09:10 AM
All Star
Posts: 699
Registered: ‎11-03-2016

Re: How to test declines with Accept.JS

Hi @glyoder,

 

The Accept.js does take a zip code. If you'd like to test a decline, your best bet would be to insert code that sends the appropriate zip code in with your dispatchData call. Even if your form isn't asking for a zip code, you can still send the value in with your script.

 

Alternatively, even though our testing guide mentions that testing based on amounts is deprecated, it does still work for now. Sending a transaction of 70.02 through Accept.js will result in a decline.