cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

how do i get transaction response in continue/return url for Accept Hosted.

Hi all,

 

I am implementing accept hosted via php. I have followed https://developer.authorize.net/api/reference/features/accept_hosted.html and successfully getting payment form. I am using redirect method for getting form. As per the reference guide i can get response on provided response url but have no idea how to do that.   

 

Since the response is POST type and in order to use the response i must know its variable name. So what is its variable name???

 

Please help.

 

 

akansha1
Member
14 REPLIES 14

If the showReceipt parameter is true, system will display a receipt page after the transaction, with a "Continue" button that points back to the url provided in the url parameter.

Else if the value of the showReceipt parameter is false, the browser will return directly to the return URL.

When showReceipt is false, a return URL must be provided in the url parameter. Otherwise the receipt page will be shown.

Powered by NexWebSites.com -
Certified Authorize.net developers
NexusSoftware
Trusted Contributor

In both cases, when showReceipt is set to true or false, i am getting default receipt page https://test.authorize.net/payment/payment with continue button redirecting to the url i have specified in hostedPaymentReturnOptions.

 

However this is not the problem for me. In https://developer.authorize.net/api/reference/features/accept_hosted.html it is mentioned that 

---------------------------------------------------

"With any of the form integration methods, information specific to the customer can be passed back to the merchantโ€™s server by embedding it in the continue/return URL or the cancel URL. By embedding information into the URL that is provided in the token request, the merchant server can identify the specific customer and transaction that has been processed when the customer returns. Any name-value pairs embedded in the URL should be URL-encoded to ensure correct processing in the form request."

------------------

 

I need to know how i can embedd the response in continue/return url???

 

Although i was digging into the problem and found out an alternate. When i specify an url in SILENT POST URL section of authorize.net account section. i get the response on that url after every transaction.

 

I want that response on the continue url. How can i get that? Advance thanks for any help.

 

 

When not using an IFrame, the continue/return URL and cancel URL create buttons that when clicked cause the browser to perform a simple GET request to that URL. No other information about the transaction is provided directly. When using the redirect method, an Authorize.Net generated receipt will be shown and cannot be disabled.

 

Instead of the Silent Post method, you should use Webhooks, which will enable you to enroll in the events of your choice and designate a URL to receive the notifications as they occur.

Powered by NexWebSites.com -
Certified Authorize.net developers

Is Webhooks the only way i can get transaction response when using redirect method???

 

It's not the only way, but it is the best way.

Powered by NexWebSites.com -
Certified Authorize.net developers

Here is the working source code: https://github.com/mvkotekar/Authorize.Net-Hosted.git

 

I also have similar issue, I have used the webhooks sample code to listen to the transactions. However webhook project runs on different port like 9000. HOw do I ensure I get the response in my application itself rather than seperate listening port ?

Mvkotekar,

I am not familiar with your implementation method for the Accept Hosted integration, but Webhooks are a hobby horse of mine as I find them extremely useful.

I know nothing of C#, but in my php integration it is very simple. You create a file to be hosted on your server with the rest of your application. You then enroll in events on your merchant interface (or pretend merchant interface if youโ€™re using a sandbox) and all enrolled events will be sent to your endpoint. You can do anything with them. I think your application may be more complex however. Your C# http requests may work entirely differently than my php app from what little I know.

Thanks for your response. All am trying to do is, use the webhook notifications inside my asp.net application. However, the examples mentioned in authroize.net, It had to run with nodejs on other port like 9000. 

 

In your php application, do you have both authorize.net payment logic and also subscribed to all transaction events ? if Yes, am trying to achieve the same thing in C#/ASP.net.

 

Any help from C#/ASP.net please ?

Sorry my friend,

I am not sure what youโ€™re referring to when you say authorize payment logic. Here is how my application works from end to end, there may be details you donโ€™t need.

1. customer enters items in cart
2. Customer enters shipping information on our website
3. Customer reviews order and shipping details
4. When customer clicks continue, the Accept Hosted API call is made, and all parameters are passed to authorize.net. Simultaneously, the customers order is placed, even though payment hasnโ€™t occurred
5. The customer completes payment
6. If successful, I have a Webhooks endpoint that receives the response. Hereโ€™s how that works

1. I am enrolled in payment events on my pretend merchant interface (and also on my clients real merchant interface). We choose what events to receive.
2. Going back to step 6, authorize sends the Webhooks to the endpoint I specify on my account. It is something similar to mysite.com/webhooksendpoint.php, with webhooksendpoint.php being the file that receives the Webhook and executes all the subsequent scripts
3. Authorizes Webhook contains 2 things I need- the X-Anet header, and the json payload. I capture the payload in its entirety, and capture the header separate from all other headers
4. I hash the json payload with my signature key
5. I set up a conditional that compares the digest of the hash in step 4 with the X-Anet header
6. If they do not match, a timestamp is made and inserted into a dB table, along with the senders IP address (Iโ€™m building this now. My original process simply made a log file, but I want something easier to track if security issues arise)
7. If they match, then the following occurs
8. I extract the transaction Id from the json payload
9. The transaction id is used to make a gettransactiondetails method call
10. In the method call, the invoice number tied to the customers pre-payment order (remember, the order is placed before they go to the hosted payment form) is retrieved and used to locate the record tied to that transaction.
11. The transaction id is entered in with the appropriate record. This is how my client can differentiate orders that were paid from orders that were not.

You can set up multiple endpoints for each type of event, or you can set up one endpoint for everything. If you set up one endpoint that captures more than one event, you will have to somehow extract the event from the payload to determine what you want to do. This is very easy to do, and right now Iโ€™m weighing my options for some updates Iโ€™m making.