Reply
Member
Posts: 6
Registered: ‎04-29-2019

How to get the response from payment gateway Successful or Unsuccessful Parameters using suite

After the customer goes to payment Page
https://accept.authorize.net/payment/payment 
Pay and cancel button are available .If Cancel or Pay is clicked then redirected to Success or unsuccessful page by setting this in 
settings[2] = new settingType();
settings[2].settingName = settingNameEnum.hostedPaymentReturnOptions.ToString();
settings[2].settingValue = "{\"showReceipt\": true, \"url\": \"" + Convert.ToString(ConfigurationManager.AppSettings["successurl"]) + "\", \"urlText\": \"Continue\", \"cancelUrl\": \"" + Convert.ToString(ConfigurationManager.AppSettings["errorurl"]) + "\", \"cancelUrlText\": \"Cancel\"}";


But in the Unsuccessful page we don’t have the code from the Authorize.net to get the Invoice #, ref#, status and the error message.
Alternatively, when the customer clicks on PAY button, he is redirected to payment-success page but we don’t have the code for the Invoice #, Payment ref # and other parameters.
Kindly give the response code to implement in the Success/unsuccess page

All Star
Posts: 707
Registered: ‎11-05-2018

Re: How to get the response from payment gateway Successful or Unsuccessful Parameters using suite

@Sahithi

This is a recurring question/issue for hosted form integrations. You need webhooks. That’s how you get all that info. Search this forum for webhooks posts and also the webhooks reference on the website. I’ve got reams of posts in my history related to them.
Member
Posts: 6
Registered: ‎04-29-2019

Re: How to get the response from payment gateway Successful or Unsuccessful Parameters using suite

@Renaissance 

 

Thank you for the reply.

I have checked the previous codes for webhooks iam not clear.

I need some help using asp.net i have created enpoint in Authorized.net sandbox panel.

After that iam not undertanding with status, name and endpoint url.

I tried placing the order it goes to payment page after entering the  test credit card details takes me to success page but after that iam not understanding how the webhooks come into picture.

How can i get the transaction id in the success page using web hooks.

All Star
Posts: 707
Registered: ‎11-05-2018

Re: How to get the response from payment gateway Successful or Unsuccessful Parameters using suite

To get a transid in a customized success page you will need to use an iframe with an iframe communicator. The redirect method has a transid on the receipt page so it would be redundant. You need some method for your application to capture results of transactions and webhooks are the way to go. You can use the iframe, but when I implement iframes I still use webhooks + auth.nets user defined getTransactionDetails method call from the API reference. With that you get the entire transaction vs a much less detailed transaction response with iframe.

If you insist on getting a transaction Id on your customized success page using redirect, it is doable if your server has resources and very high uptime. You would have the success page pull the transid from your dB (which would have made it to your dB by means of webhook) based on a session or cookie Id. I’d say in about 50 to 75% of cases the webhook and subsequent dB update would beat the customer to the form if your server has any real cpu and other resources. You could have a message to refresh if the transid doesn’t appear the first time for the rest of them. To me this kind of acrobatics is insane to accomplish this when they already have a transid from auth.nets receipt, but it could be done quite easily.