Reply
Contributor
Posts: 17
Registered: ‎03-03-2016

How to link webhook to each user?

When customers purchase on our website, we are collecting their data (name, address, etc) and then passing it to auth.net via Access Hosted. We have a page that retrieves the webhook data when the transaction is appoved. After the transaction is made, we are trying to display a page with links based on the product they purchase.

 

The problem is, as we understand, the webhook gets the latest transaction, however if three people purchase on our website at the same time, how do we know which webhook goes to which person? We can't store the customer's data in session because the user goes to the payment form on auth.net. If there was some kind of link between the user's browser and the webhook, we would know who purchased what. It would help to be able to query the webhook somehow, like "Get webhook with invoice 123456". As of now it seems totally random which data we get back from the webhook.

 

The way this used to work with us is that we would send auth.net the user's data via the ID field. After the transaction was approved, they would pass that ID back to us so we can link them to the purchase and the POST data does not leave the user's browser.

Posts: 333
Kudos: 59
Solutions: 36
Registered: ‎03-13-2017

Re: How to link webhook to each user?

[ Edited ]

Hi @tapseries

 

You can pass a merchantReferenceID in your payment transaction request .

 

 

refId Merchant-assigned reference ID for the request.

If included in the request, this value is included in the response.

 

 

Once you have recieved the Webhook notificaiton of a payment , you can call our getTransactionDetails API using the transID in the notification and retireve the transactionDetails . 

 

The transactionDetails response will also have the same merchant ReferenceID which was passed in the payment request . 

 

https://developer.authorize.net/api/reference/index.html#transaction-reporting-get-transaction-detai...

 

We are going to update the payment webhook notification in our next release to return the merchantReferenceID so the extra API call is also not needed . 

 

Hope it helps !!! 





Send feedback at developer_feedback@authorize.net
Contributor
Posts: 38
Registered: ‎02-12-2018

Re: How to link webhook to each user?


@Anurag wrote:

 

We are going to update the payment webhook notification in our next release to return the merchantReferenceID so the extra API call is also not needed . 

 


Anurag,

 

Did this addition (quoted above) actually happen, and if so, is it in production or only in sandboxes right now?  A few weeks ago I was told by Authorize.net support that the merchant reference ID was still not included in webhooks, but I finally get to the point of being able to start testing them today in my sandbox, and there is indeed a merchantReferenceId element in the webhook response (for a payment auth/capture) that corresponds to the refid we sent with our Accept Hosted redirect request.  I'd like to use this if it is actually supported now, but after being told so recently that it wasn't, I'm leery of just making the assumption that this is available in production.

 

Thanks for any light you can shed on this.

All Star
Posts: 684
Registered: ‎11-05-2018

Re: How to link webhook to each user?

@dsandberg 

 

It is in the production responses.  Sandbox and production work identically, and I just verified on a log of a production transaction it is in there. This is very recent. Past week or so. 

Contributor
Posts: 38
Registered: ‎02-12-2018

Re: How to link webhook to each user?

Wow, it was just added in the last week, eh?  Timely for our purposes, at least.  Thanks much for that info.

New Member
Posts: 1
Registered: ‎11-25-2019

Re: How to link webhook to each user?

AMF Bowling is efforting to maintain the customers’ satisfaction by taking the AMF Bowling Customer Feedback Survey at the survey.

 

http://customerfeedbacksurvey.info/ 

AMF Bowling is efforting to maintain the customers’ satisfaction by taking the AMF Bowling Customer Feedback Survey at the survey

All Star
Posts: 684
Registered: ‎11-05-2018

Re: How to link webhook to each user?

@dsandberg

Lol I think they get more done now that I’ve taken over the forum. I just told someone not long ago that it’s not in there. Then I checked a few log files and found a few from early to mid November. One didn’t have a refid and one did.