- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
AcceptJS Refund a transaction
Hello,
I'm trying to refund a transaction using NodeJS (backend) / AcceptJS.
Here is what I'm trying to do.
- Get opaqueData from AcceptJS (so I don't have to send CC info to my server)
- Using opaqueData, doing a authorize and capture on the CC in my NodeJS backend
- I save the transactionId and other response information from step 2 into my db
- Refund the authorize and capture transaction from step 2 in my NodeJS backend.
I'm running into an error with step 4, the message I get back is 'Credit card number is required.'. However, I don't want to save the credit card information on my server. How do I go about doing a refund of a transaction that was initiated using the opaqueData from AcceptJS?
I read that you cannot use the nonce/opaqueData from step 1 for the refund.
Thanks in advance.
โ04-07-2017 09:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not sure if this will help, but here's what I did. My backend is C#, but I'm using Accept.js and opaqueData in the front-end so Credit Cards numbers don't touch my server.
In my web site (asp.net MVC). If the transaction is settled, you need to do a refund and specify the refund amount. If it's not settled, you do a void. As a side note, it works the same for ACH too: Void and Debit.
Here's some of my c# code with my comment. I think it will help you:
/* When issuing a credit card refund, the request must include either a full card number and expiration, or previous transID and last 4 digits of the card number. If you don't have the last 4 digits, you can use getTransactionDetails to get the payment object needed to issue a refund. */ var creditCard = new creditCardType { cardNumber = CCLast4Digits, expirationDate = "XXXX" };
Hope that helps!
โ04-07-2017 11:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the help. Now I'm getting a E00027 error with
CODE: 54
EXPLANATION: The referenced transaction does not meet the criteria for issuing a credit.
Any suggestions? Does the transaction need to be 'settled' before you issue a 'refund' on the transaction? If so, how can you cancel a transaction if it has been captured but not settled.
โ04-10-2017 07:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are correct, an unsettled transaction can only be voided which cancels the entire transaction. After it settles, you can issue a refund.
Richard
โ04-10-2017 07:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I figured out that you can void a transaction that has been unsettled transaction.
How would you know if a transaction has been settled or not?
โ04-10-2017 08:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the update. Please see my latest question. Thanks!
โ04-10-2017 09:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @joshyboyrules
You can use getTransactionDetails using the transaction ID to obtain the settlement state.
Richard
โ04-10-2017 10:19 AM

