I have a maintenance project which uses Authorize.Net for payment. Currently, the system provides an email receipt provided by the gateway. Is there any way to grab the receipt and display on the thank you page as a printable receipt ?
Help would be appreciated.
Not realistically. It’s hard to say exactly how you would do this since which API you are using will affect your programming, but technically you can pipe the copy of the receipt sent to you into a PHP program which would then place it into a database or flat file. Meanwhile you can have your PHP script waiting for the file or database record to exist and, when it does, output it to the screen.
This would be a bad plan for several reasons:
If the email never arrives your user could be left waiting for a receipt that never comes. That could result in unhappy users and potentially chargebacks.
Even if this works it will be slow which will also result in lower customer satisfaction.
This is a hack.
There are much better ways to provide a printable receipt to your users. If you’re using the AIM, ARB, or CIM APIs you have instant access to the response from Authorize.Net. You can easily generate your own printable receipt for them with this information. If you’re using SIM you can use relay response to get the transaction information from Authorize.Net to accomplish the same thing.
These are better solutions because:
They’re fast. You will get a response from Authorize.Net within seconds and can print out the information in less then a second.
You have total control of the receipts content and appearance.
It’s reliable. You can count on getting a fast response every time.
If working with APIs seems daunting to you, you may find using their Silent Post feature appealing. It’s just like Paypal’s IPN where after a transaction is processed, regardless of which API you use, all of the transaction information is sent to a PHP script you specify. It is POSTed just like a form submission so it’s easy to work with. You can then email your users a receipt with that information.
Disclaimer: I wrote the Sitepoint chargeback article and the Silent Post article