I’ve signed up for Authorize.net and successfully:
- Converted my shopping cart into data that sends TO Authorize.net and processes it.
- Using Relay Response, sent user to my thank you page.
I cannot get my head wrapped around how to actually UPDATE my database once the transaction goes through. What terms do I search for to figure this out? Nearly all the documentation shows part of the solution but doesn’t actually instruct on where to put it and how to receive it back.
On my Shopping Cart page, I have a list of hidden input fields that Authorize.net provides. I plugged in my dollar amount, description, etc. I assume I put another hidden field called “x_po_num” and have the value be my dynamic PO# in the database.
Isn’t there a way to actually retrieve it on the Thank You page so I cross reference to the database and make simply add a value of “confirmed” or something?
How do I retrieve that value that was sent TO Authorize.net?
The data you get is simply in a
$_POSTarray which you canvar_dump()to see what values it contains.Here’s a sample relay response script in PHP:
You can also use Silent Post. Here is a PHP tutorial that shows how to work with that.