Hi All, Hopefully I'm asking this in the correct place.
I'm using the Authorize Transaction Details API (with PHP) and I'm running into a bit of an issue with my integration. The site that I'm working on is basically a portal that allows administrators to charge customers. I then need to be able to see which charges were made by which administrator later on. To do this I'm storing the transaction ID along with the administrator ID in my database.
The issue arises when I try to display transaction details for these. I get all of the transaction IDs for transactions made by a particular administrator, then run through a foreach loop calling getTransactionDetails($transaction_id). My test administrator has roughly 25 charges, and it takes 16 seconds for my script to execute.
I'm guessing getTransactionDetails() is simply somewhat of a demanding API call. If this is the case, are there any workarounds? Any suggestions would be greatly appreciated, as right now I'm considering just using Ajax so that my page loads before all of the transaction details are gathered.
01-11-2012 06:00 AM
It not that it is a demanding API call. It is a web service call, is depend a lot on your internet speed.
01-11-2012 06:43 AM
You could have your page use threads to call Authorize.net multiple times simultaneously. Or, as you said, use AJAX to essentially do the same thing. Or you could just store the details in your own database - there's no practical reason why the info can't be two places at the same time. If it's stored in your database, you obviously won't have to deal with any small amount of lag on Authorize.net's end of things.
01-11-2012 01:31 PM
Thanks for the responses, guys!
As it turns out, it looks like the Internet speed we're getting at our colocation isn't up to snuff. It looks like were getting about 1Mbps, which would explain the relative slowness of the requests.
Hopefully the Internet slowness clears up. Just in case, I'm now using AJAX and pagination so there are never more than 10 requests on a page. I'm also considering storing more data in the database, which would essentially rid me of the issues I'm having. The only reason I didn't do that in the first place was because I'd like to store as little in our storage as possible so that I'm not getting some of the information from the DB and some through the API.
Thanks again.
01-12-2012 01:22 PM