Reply
Member
Posts: 9
Registered: ‎03-24-2020

Handle Refunds from portal

This is something im facing right now and seems like there are no previoues posts related to this.

I have integrated Authorize.Dot net into my  application and have used Auth&Capture, Refunds service. 
when a user a create a Refund request from portal i need to store that in my database, when i configured webhooks i can successfully get the event but i really cant see how i can get the related captured transaction Id from the refund request,

appreciate if someone can help

Posts: 492
Topics: 0
Kudos: 99
Blog Posts: 0
Ideas: 0
Solutions: 42
Registered: ‎04-28-2017

Re: Handle Refunds from portal

[ Edited ]

Hello,


A refund webhook returns a payload like the following :

{
  "_links": {
    "self": {
      "href": "/rest/v1/notifications/4775***97-b*********XXXX-54122195b746"
    }
  },
  "notificationId": "477XXXXXXX5b746",
  "deliveryStatus": "Delivered",
  "eventType": "net.authorize.payment.refund.created",
  "eventDate": "2020-06-18T10:09:46.03",
  "webhookId": "0d42602d-*******-6e2756",
  "payload": {
    "responseCode": 1,
    "avsResponse": "P",
    "authAmount": 2.00,
    "invoiceNumber": "123",
    "entityName": "transaction",
    "id": "40050XXXXXX852"
  },
  "notificationDate": "2020-06-18T10:09:53.897"
}

The two fields in webhook notifications identify the type of payload and the identification number associated with the webhook event.

entityName - one of several payload types:

  • transaction

  • customerProfile

  • customerPaymentProfile

  • subscription

id - one of the four primary IDs returned by the API request that created the resource:

  • transId

  • customerProfileId

  • customerPaymentProfileId

  • subscriptionId

The type of ID shown in the id attribute corresponds to the type shown in the entityName field.

 

Then using the transaction ID you can get the details, including the refTransId, with a getTransactionDetailsRequest:

{
    "getTransactionDetailsRequest": {
        "merchantAuthentication": {
            "name": "LOGIN_d",
            "transactionKey": "TRANSACTION_KEY"
        },
        "transId": "40050XXXXXX852"
    }
}

Which returns:

{
    "transaction": {
        "transId": "40050XXXXXX852",
        "refTransId": "4005****75",
        "submitTimeUTC": "2020-06-18T10:09:45.457Z",
        "submitTimeLocal": "2020-06-18T03:09:45.457",
        "transactionType": "refundTransaction",
        "transactionStatus": "refundPendingSettlement",
        "responseCode": 1,
        "responseReasonCode": 1,
        "responseReasonDescription": "Approval",
        "AVSResponse": "P",
        "order": {
            "invoiceNumber": "123",
            "description": "Out of stock",
            "discountAmount": 0,
            "taxIsAfterDiscount": false
        },
        "authAmount": 2,
        "settleAmount": 2,
        "taxExempt": false,
        "payment": {
            "creditCard": {
                "cardNumber": "XXXX0027",
                "expirationDate": "XXXX",
                "cardType": "Visa"
            }
        },
        "recurringBilling": false,
        "product": "Card Not Present",
        "marketType": "eCommerce"
    },
    "messages": {
        "resultCode": "Ok",
        "message": [
            {
                "code": "I00001",
                "text": "Successful."
            }
        ]
    }
}

             

 

Powered by NexWebSites.com -
Certified Authorize.net developers
Member
Posts: 3
Registered: ‎03-29-2021

Re: Handle Refunds from portal

[ Edited ]

When we are getting any type of blunders then it's far being displayed on the authorize.Internet display screen itself shop. Hence we aren't capable of get this transaction response information for declined/replica transaction in our gadget.