cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

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.

tapseries
Contributor
6 REPLIES 6

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
Anurag
Moderator Moderator
Moderator

@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.

@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. 

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

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

@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.