03-27-2017 04:41 PM
I am using SIM. I want the user to be directed to a page on my website when they are finished making a payment. I need the user to actually be directed back to the website. Because I need to update the database to say weither or not the payment went through. Seems like it should be a simple thing to do, only I have gotten different/conflicting informaion.
The last information that I got, wich did not work. Is this even possible with SIM and why did they tell me that it was possible if it really isn't possible.
03-27-2017 05:40 PM
It's possible to have the user redirect back to your website whether you're using SIM or its new replacement, Accept Hosted. However, just having the user come back to the website isn't a great way of updating things on your end.
In these redirect scenarios, it's possible and likely that you'll have customers close the browser before they're redirected, so if you're dependent on them to come back so that you can update the database, you'll see problems.
A better solution would be to still set up the redirect to provide your own custom receipt or confirmation page to the user, but to only update the database when you receive confirmation through a different channel. Our event notification system is based on Webhooks, and you can register to get a Webhook notification sent to your server whenever a transaction is approved.
03-28-2017 10:36 AM
Thank you for your answer!
Ouch. That is a lot to wrap my brain around. I assume that those code examples are written in jquery? I do not know much jquery.
Do you have a place where I can look at a working sample of the code? I am not really sure how this all works. I assume I would set up a cron job that would run every hour or so. The code for the cron job would sent a chunk of code to Authorize.net and then they would send me back results based on what I was asking them for. All I need is yes or no to did the payment go through, and the invoice number. Then I can use php and mysql to put the needed info into the database.
03-28-2017 11:44 AM
You can certainly do a timed solution like you suggest. You would just periodically call one of our transaction reporting functions to see if there were new transactions. A better way would be to use Webhooks, although that's a little more complicated.
The Webhooks documentation isn't referencing jquery. It's just examples of the Webhook REST API. You'd use the Webhooks REST API to interact with the Webhooks system to tell it what types of events you want notifications for, and where you want those notifications to go. Then, every time an event happens that matches what you signed up for (like a transaction being approved), we make a POST to the URL you gave us telling you "here's what happened".
So if you have a PHP script at the URL that you submitted when you created the Webhook, that PHP script will be run whenever we post to it. In that PHP script, you'd check the information that we posted to you, and if it checks out as verified, you'd make the call to MySQL to update the database.