cancel
Showing results for 
Search instead for 
Did you mean: 

Accept.js Expiration Month Issue

I'm trying to use accept js to get a payment nonce back for a card but no matter what I pass in for the expiration month I am gettin the error "Please provide valid expiration month".

 

I have tried strings:

 

"08"

"12"

 

And integers:

 

8

12

 

But no matter what I send I get the invalid expiration month error code.

 

Has anyone seen this? Or am i doing something wrong? The expiration year seems to be working correctly (not getting an error about it in the response messages).

 

 

Example Code:

 

var secureData = {};
var authData = {};
var cardData = {};
cardData.cardNumber = data.CardNumber; //Test card
cardData.month = data.ExpirationMonth; //"08"
cardData.year = data.ExpirationYear; // "2021"
cardData.cardCode = data.CSC; // "333"
secureData.cardData = cardData; 
authData.clientKey = clientKey;
authData.apiLoginID = loginId;
secureData.authData = authData;
Accept.dispatchData(secureData, responseHandler);
Devin
Contributor
4 REPLIES 4

Where is data.ExpirationMonth coming from? console.log(data.ExpirationMonth) immediately before the call to sendPaymentDataToAnet().

 

 

Powered by NexWebSites.com -
Certified Authorize.net developers
NexusSoftware
Trusted Contributor

@NexusSoftware

 

I know for a fact that data.ExpirationMonth is being populated. Doesn't work as a string or an integer.

Substitute data.ExpirationMonth with a hard coded 2-digit month string value for testing purposes. 

Powered by NexWebSites.com -
Certified Authorize.net developers
NexusSoftware
Trusted Contributor

Did you ever work this out? This has started happening to me recently after previously working fine,