Reply
Contributor
Posts: 33
Registered: ‎02-12-2018

Look up transaction by refid?

Is there any way to search for a transaction (via the API) when all we have is the refid that we passed to getHostedPaymentPageRequest?

 

(We are seeking a way to do a batch of queries on any transactions done via hosted payment pages that didn't get returned to us for some reason, e.g., the user closing the browser immediately after paying.  We know about webhooks, but we have some significant obstacles to using them, so we are hoping to find a shortcut that would allow us to search for transactions matching any refid values that we used to generate Accept Payment Pages but didn't get a transaction response from.) 

Highlighted
Trusted Contributor
Posts: 458
Registered: ‎11-05-2018

Re: Look up transaction by refid?

[ Edited ]
I am almost 100% certain you cannot do an API call using only the refId as a parameter. Right now I’m looking to get some insurance against failed webhooks (or more accurately webhooks that the server didn’t respond to, or that the scripts on my endpoint didn’t execute correctly for.) and need something similar. I think the route to go is to use the transaction reporting API. That’s what I’m going to try. You can pull authorizes transactions data records and compare them against yours. If you have any value in the transaction response (I think the refId might be in there, or maybe you could pass something else solely for your use) then you could probably engineer some sort of function that would go through the list and identify matches based on the refid or some substitute you pass in your original API call.
Trusted Contributor
Posts: 458
Registered: ‎11-05-2018

Re: Look up transaction by refid?

Here is what I have implemented-
-run unsettled transaction list API call
-run settled batch API call
-run transaction list API call on each batch
-combine all settled and unsettled transactions from above

Then pull my records and display them side by side in a table.If my records have more transactions than authorizes records per the previous api calls, or if my records have the same, then I haven’t missed any. If authorize records have more then I look for the missing transid. I only display the date, transid, and status in my table, but I am almost certain you could retrieve the refid and/or invoice number as well.