Reply
Member
Posts: 2
Registered: ‎09-15-2019
Accepted Solution

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?

Accepted Solutions
Highlighted
Solution
Accepted by topic author sparik
‎09-23-2019 03:38 AM
All Star
Posts: 684
Registered: ‎11-05-2018

Re: Accept hosted form token in webhook

@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


All Replies
Highlighted
Solution
Accepted by topic author sparik
‎09-23-2019 03:38 AM
All Star
Posts: 684
Registered: ‎11-05-2018

Re: Accept hosted form token in webhook

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

Member
Posts: 2
Registered: ‎09-15-2019

Re: Accept hosted form token in webhook

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