Reply
Member
Posts: 3
Registered: ‎01-24-2018

Multiple Payments Refund Issue In Authorize .net

In our application users can pay product amount in multiple payments(I am using Authorize.net). Now when I try to refund using our application I got following error message “Refund Failed. A duplicate transaction has been submitted”. Can you please let us know how to handle this situation?

Our Application code is in C# and .Net SDK is used.

 

Demo Scenario: Total Product Amount: $2000

1st payment paid on 15-December-2017=$500 (Sample Transaction ID from authorize.net: 40009683949)

2nd payment paid on 31-December-2017=$500 (Sample Transaction ID from authorize.net: 40009683950)

3rd payment paid on 10-January-2018=$500 (Sample Transaction ID from authorize.net: 40009683951)

4th payment paid on 15-January-2018=$500 (Sample Transaction ID from authorize.net: 40009683952)

While initiating refund process I have created loop and passing “Transaction Id”(different at each request) and “Amount”. First Transactions refunds successfully but other gives me “Refund Failed. A duplicate transaction has been submitted” error.

 

 

I have found an article on authorize.net for this issue: https://support.authorize.net/authkb/index?page=content&id=A425&actp=search&viewlocale=en_US&searchi...

According to this article I have to send extra parameter: "x_duplicate_window" with the request. I have tried but my code is not working(There is no sample code available in authorize .net)

 

Here is my Code:

var x_duplicate_window_Setting = new settingType { settingName = "x_duplicate_window", settingValue = "-1" };        settingType[] extraOptions = { x_duplicate_window_Setting };

        var transactionRequest = new transactionRequestType
        {   transactionType = transactionTypeEnum.refundTransaction.ToString(),    
// refund type
payment = paymentType,
amount = TransactionAmount,
refTransId
= TransactionID,
transactionSettings
= extraOptions };

Error Message: Refund Failed. Setting Name 'x_duplicate_window' is invalid for this method.

Anyone know how to solve this issue??

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

Re: Multiple Payments Refund Issue In Authorize .net

x_duplicate_window is the field name if you are using the AIM api.

Since you are using the .NET sdk that uses the XML based api the format is different.

 

The field is called duplicateWindow and it is in the transactionSettings node. Use 0 instead of -1.

 

Example:

          <transactionSettings>
            <setting>
              <settingName>duplicateWindow</settingName>
              <settingValue>0</settingValue>
            </setting>
          </transactionSettings>

 

Here is the  documentation on the transaction settings:

https://developer.authorize.net/api/reference/features/payment_transactions.html#Transaction_Setting...

 

The developer reference guide:

https://developer.authorize.net/api/reference/#payment-transactions

Member
Posts: 3
Registered: ‎01-24-2018

Re: Multiple Payments Refund Issue In Authorize .net

Can you please tell me how to use this in my code. Where to write this code? 

Using SDK.. I have not found any options.

 

 

Member
Posts: 3
Registered: ‎01-24-2018

Re: Multiple Payments Refund Issue In Authorize .net

Any One have any idea?

Member
Posts: 2
Registered: ‎03-06-2019

Re: Multiple Payments Refund Issue In Authorize .net

[ Edited ]

 

This is an old question, but it comes up in google as an answer so I figured I'd supply one. I found this answer here
https://community.developer.authorize.net/t5/Integration-and-Testing/C-add-settingType-to-transactio...

 

Hope this helps someone.

 

var settings = new settingType[] { 
           new settingType
           {
               settingName = settingNameEnum.duplicateWindow.ToString(),
               settingValue = "0"
           } 
};
var transactionRequest = new transactionRequestType {
           transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),    // charge the card
           amount = amount,
           payment = paymentType,
           billTo = billingAddress,
           lineItems = lineItems,
           transactionSettings=settings};