Reply
Member
Posts: 1
Registered: ‎08-28-2019

Accept Hosted redirect integration with webhook and receipt of payment

Hi,

 

I have a product where the customer can submit multiple transactions with different cards/bank accounts to pay down the balance. For instance if the product is $300, they can submit a $100 transaction, a $50 transaction, an $80 transaction, and a $70 transaction. They could pay the balance down in one transaction. There is no limit in how many transactions they use. After they make a successful payment in Authorize.NET, we should update the new balance that is displayed to them.

 

We are using the Accept Hosted solution with the redirect method (no iFrame/no lightbox) and with webhooks. The problem that we encounter is that the webhooks are not guaranteed delivery and are not instanteous, and the redirect after the receipt page is not guaranteed. So we run the risk of reporting to the user that they owe more than they really do.

 

One potential fix would be to have a tracking table and pass an ID from that tracking table as a querystring back to the returnUrl and store it in the refId part of the transaction. Then process the querystring and put the tracking table record in a PENDING status until the webhook is processed. We would need to put the record in PENDING when the payment was submitted. But in the Accept Hosted redirect method, the customer is only ever taken to the returnUrl if they click the "Continue" button on the Authorize.NET hosted receipt page. As I speculated and can confirm from this forum topic response, the customer may not be taken to the returnUrl if they close the tab or the browser/computer crashes (two very possible situations) and this would result in the tracking record not being put into a PENDING state even though the transaction was submitted. So if that last transaction that succeeded was for $50 out of a total $300 balance, we should be reporting to the user they only owe $250, but since we didn't update its status to PENDING, we still see it as them owing $300.

 

You may think, "ok well the webhook will be sent within that time it takes them to re-open the browser and login." This will probably be true but we still run the risk of our system timing out, Authorize.NET's webhook system timing out, or any other number of exceptions happening in which case the webhook may not be received before they login again.

 

  1. Any ideas to accomplish the above?
  2. On a second note, the documentation says that ALL errors will be handled within the Accept Hosted form. Does this mean if they click the "Pay" button and are shown a receipt, we are guaranteed that the payment was successful?
Highlighted
All Star
Posts: 627
Registered: ‎11-05-2018

Re: Accept Hosted redirect integration with webhook and receipt of payment

@alexcasciani1

They never make it to the receipt button unless payment is successful. If I understand your situation correctly, I think a fix for you would be to put the total amount in the order description field of the API call. You would convert it to a string and put in the description-“ your current total outstanding balance is $xxx.xx, once you complete payment your outstanding balance will be reduced to $xxx.xx. “

You can also add some verbiage about “please note that it may take our systems up to one business day to reflect this”, either in the description or autogenerated email from auth.net.

This time lag disclaimer is to cover you for webhooks that do not make it to you. It can actually take 3 business days, but you May be able to manually add any updates that do not make it.