Payments.js when tokenizing card via Vault, how to get last 4 digits or exp date?

You are here

2 posts / 0 new
Last post
lgellert_sage
Payments.js when tokenizing card via Vault, how to get last 4 digits or exp date?
Our requirement is to allow customers to add credit cards in advance of payment or save a card for later use. How can we use Payments.js with requestType = "vault" and keep some identifier about the card such as the last 4 digits or the expiration date? Currently the response only contains the new token, such as: "vaultResponse":{"status":1,"data":"200bd800ae574298a4c8d1938a708c44","message":"SUCCESS"}     Also when we use the token to create a SalesOrder in Sage 100, a new row needs to be created in the AR_CustomerCreditCard table which calls for the ExpirationDateYear, ExpirationDateMonth, and Last4UnencryptedCreditCardNos. Not sure if this is going to work unless we can get that data in the call back. Thanks!    
thomash
Re: Payments.js when tokenizing card via Vault, how to get last

That's a great question. We have many methods you can utilize to gather additional data from

transactions. In this case the best one to use is .getLastCard(). This also has the alias

.getPaymentDetails(). You can read up on this method here within the documentation

for PaymentsJS on our GitHub repository. If you have any additional questions, please feel free

to reply to this article or reach out to our group at [email protected]

Log in or register to post comments