Reputation: 1496
My customer is switching to Authorize.Net. He performs about 400 transactions daily, where commissions are paid through an upline, but only ONCE A TRANSACTION is SETTLED.
For this purpose, I create an object that brings all unsettled transactions for the last 7 days, and query one by one:
let payload =
{
getTransactionDetailsRequest: {
merchantAuthentication: {
name: processor.name,
transactionKey: processor.key
},
transId: transaction.authorizeId
}
}
const response = await axios.post(process.env.AUTHENDPOINT, (payload), { headers: { 'Content-Type': 'application/json' } });
I'm working on test mode, and querying 50 transactions takes forever; so this won't work.
I then switched to getSettledBatchListRequest, which brings a response similar to this one:
{
"batchList": [
{
"batchId": "12329641",
"settlementTimeUTC": "2021-12-16T00:18:04Z",
"settlementTimeLocal": "2021-12-15T16:18:04",
"settlementState": "settledSuccessfully",
"paymentMethod": "eCheck"
},
{
"batchId": "12332812",
"settlementTimeUTC": "2021-12-16T02:26:14Z",
"settlementTimeLocal": "2021-12-15T18:26:14",
"settlementState": "settledSuccessfully",
"paymentMethod": "creditCard",
"marketType": "eCommerce",
"product": "Card Not Present"
},
{
"batchId": "12333336",
"settlementTimeUTC": "2021-12-17T00:18:26Z",
"settlementTimeLocal": "2021-12-16T16:18:26",
"settlementState": "settledSuccessfully",
"paymentMethod": "eCheck"
},
The problem is that getSettledBatchListRequest forces me to a second query (getTransactionListRequest) for getting the transId by utilizing the batchId obtained through getSettledBatchListRequest.
The question is this: Is there a method to bring all settled transactions within a timeframe, which does not require batchId but a date range; or a different approach to accomplish what I need (mark a transaction as SETTLED on my end)?
Thanks.
Upvotes: 1
Views: 393
Reputation: 648
You have no way around. Authorize does not have an API for listing settled transactions together with the tranId. Ive no idea why they dont provide a simple API like that.
Im guessing y bring the last 7 days cause of eChecks, which make sense cause it takes up to 6 days to clear (usually just 3 but it tepends on the bank), the thing is that usually CC or DC transactions go thru just fine once they are accepted.
So if eChecks are the reason u are checking the transactions, a good scenario would be the one I said before, using getUnsettledTransactionListRequest and assuming a CC transaction as SETTLED on the fly; then keep using getTransactionDetailsRequest individually, but just for eChecks.
This will drastically decrease the number of calls to getTransactionDetailsRequest for each Unsettled transaction in your database.
Here're Authorize statuses:
https://account.authorize.net/help/Miscellaneous/Pop-up_Terms/ALL/Transaction_Status.htm
Upvotes: 1