简体   繁体   中英

Authorize.Net In-Person SDK: Unable to refund a credit card transaction; charges a new transaction instead

The Authorize.Net In-Person SDK in Windows C# documentation is spotty and their Customer Support Team gives contradictory information.

I succeeded in Voiding a credit card transaction by bypassing the SDK altogether. However, I have not succeeded in implementing the Refund functionality.

I have tried very many things that were suggested by different members of their Customer Support Team, and am hesitant to spend more time before first ascertaining whether anyone has ever successfully used this library.

I first charged the card with the function "startEMVTransaction". When I was not able to Refund the charge, it was suggested that I charge the card using the following commands:

  1. processCardInBackground
  2. startQuickChipTransaction

However, whenever I have tried to refund a transaction (regardless of the way the transaction was charged) the response from the SDK was that the transaction was successful. However, instead of a refund, the card was charged anew. Below is a snippet from the code in case you are curious.

I generated the createTransactionRequest instance as follows:

   transactionRequestType transaction = new transactionRequestType()
    {
      transactionType = transactionTypeEnum.refundTransaction.ToString(),
      amount = <amount to refund expressed as Decimal>,
      refTransId = "<ID of transaction to refund>",

      retail = new transRetailInfoType()
      {
        deviceType = "5",     // "5" PC-based terminal
        marketType = "2",     // retail transactions submitted with track data
      },
    };
    transaction.terminalNumber = this.terminalID;
    createTransactionRequest request = new createTransactionRequest()
    {
      transactionRequest = transaction
    };
    request.merchantAuthentication = new merchantAuthenticationType()
    {
      Item = this.sessionToken,
      mobileDeviceId = this.deviceID,
      ItemElementName = ItemChoiceType.sessionToken
    };

And I invoked the method startQuickChipTransaction as follows:

this.launcher.startQuickChipTransaction(request, SDKTransactionType.REFUND, this)

AuthorizeNet Customer Service responded yesterday. They have now implemented the functionality, and sample code is available on https://github.com/AuthorizeNet/sample-code-csharp/blob/master/PaymentTransactions/RefundTransaction.cs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM