cancel
Showing results for 
Search instead for 
Did you mean: 

Accept hosted form token in webhook

I'm having trouble implementing a simple use-case. I'm trying to accept payments with accept hosted redirect method. From reading forum posts, I understood that webhooks are the way to receive information about successful payments. My problem is that getHostedPaymentPageRequest returns a token with no other information which can later be used to identify the transaction id (transId) from a webhook with any useful information on how was the payment initiated.
For example, when requesting a form token with getHostedPaymentPageRequest, I know which user is trying to make a payment, but when a webhook hits my endpoint, I do not receive the token which was used for redirect. Is it a limitation of redirect method or am I doing something wrong?
sparik
Member
1 ACCEPTED SOLUTION

Accepted Solutions

@sparik 

 

This is a very common thing that Accept Hosted integrations need, and it is a long solved problem.  You pass an internal order reference number in your API call under invoice number. Then when the webhook comes, you extract the transaction Id and use it to pull the invoice number from a getTransactionDetails method call (see the sample code in API transaction reporting section for this method call definition).  You then update the order by tying it to the invoice number. 

View solution in original post

Renaissance
All Star
2 REPLIES 2

@sparik 

 

This is a very common thing that Accept Hosted integrations need, and it is a long solved problem.  You pass an internal order reference number in your API call under invoice number. Then when the webhook comes, you extract the transaction Id and use it to pull the invoice number from a getTransactionDetails method call (see the sample code in API transaction reporting section for this method call definition).  You then update the order by tying it to the invoice number. 

Renaissance
All Star
Thanks. That worked. Also, it turns out invoiceNumber has max length of 20. I didn't find it mentioned anywhere in the documentation.