cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to map transaction detail with webhook notification.

Consider C#/asp.net/Webforms used to integrate with accept hosted suite where we use authorize.net payment form to enter credit card details and pay. 

 

In above scenario, we use GetAnAcceptPaymentPage.Run to generate token.

Once we have a token we make a post request to authorize.net payment page.

We add credit card details and pay.

The system goes to receipt page with continue button.

Upon clicking we dont get any response back

 

However I have registered with webhook to receive all events. I have added handler ashx which recieves the notification once the payment is made. Based on the transactionId I receive the transaction details.

 

Problem statement:

How to map the webhook received response with the transaction that was made with authorize.net hosted payment method? 

mvkotekar1983
Contributor
1 ACCEPTED SOLUTION

Accepted Solutions
Just saw your reply on the other post. You are welcome. Here’s how my app does what you are asking. It again will contain details you dont need. I typed this in response to an earlier question you had before I seen this one. It’s breakfast time for me. I’m up all hours.

In regards to the uniqueness of the transaction, the transaction Id will be in the json payload. In order to tie the transaction Id to your records, you will need to pass some retrievable value in your accept hosted API call.

By retrievable, I mean something you call pull from authorize in a gettransactiondetails method call. For my application I use the invoice number which is tied to the customers shopping cart. Here’s how that works, again in php, and again I would imagine you can find a parallel method in C#.

1. When the API call is made, the invoice number is passed
2. If transaction succeeds. Webhook comes in
3. The json payload is captured and the transaction id is programmatically extracted
4. The transaction id is passed as a parameter in the gettransactiondetails method call
5. This will return a response object that has the entire transaction that relates to that transaction id, including the invoice
6. I extract the invoice number from the response object
7. The invoice number is used to locate the appropriate record in the dB to insert the transaction Id

View solution in original post

Renaissance
All Star
3 REPLIES 3
Just saw your reply on the other post. You are welcome. Here’s how my app does what you are asking. It again will contain details you dont need. I typed this in response to an earlier question you had before I seen this one. It’s breakfast time for me. I’m up all hours.

In regards to the uniqueness of the transaction, the transaction Id will be in the json payload. In order to tie the transaction Id to your records, you will need to pass some retrievable value in your accept hosted API call.

By retrievable, I mean something you call pull from authorize in a gettransactiondetails method call. For my application I use the invoice number which is tied to the customers shopping cart. Here’s how that works, again in php, and again I would imagine you can find a parallel method in C#.

1. When the API call is made, the invoice number is passed
2. If transaction succeeds. Webhook comes in
3. The json payload is captured and the transaction id is programmatically extracted
4. The transaction id is passed as a parameter in the gettransactiondetails method call
5. This will return a response object that has the entire transaction that relates to that transaction id, including the invoice
6. I extract the invoice number from the response object
7. The invoice number is used to locate the appropriate record in the dB to insert the transaction Id
Renaissance
All Star

Thanks a lot for the response. I am using Invoice# property of the order/order type I guess and its retrieved successfully from getTransactionDetail. 

 

I did try the following but didnt had good results. 

1. UserFields[] did not work

2. RefId and TransferId: I guess these are related only to one transaction. Couple of posts say, authorize.net payment page does not hold any of these data and pertains to only one request responses. 

 

 

Just to close the loop, invoiceNumber field works for our requirement where I can map the payment related data from createPaymentPage to the getTransactionDetail and that helps us update our domain related inhouse data. 

 

Appreciate your help on all the posts. 

Glad I was able to help and glad you got your app working the way you needed. In a somewhat unrelated matter, I think a huge range of problems can be solved in a similar manner to what we’ve done here. A common theme I see is “when will the API do this” when just a slight out of the box mentality will allow you to accomplish what you’re looking to do. I seen the refID posts and none of them put a drop of rain on my parade, because I’ve got invoice number, PO number, and a whole list of other settings I can use.
The only thing I cannot do thus far is to add my own styling to the accept hosted form through means other than iframe. I don’t see that coming and can live with it. Other than that, the limitations with what can be accomplished with the API currently in place are what my clients will pay for and what I decide I want to do.