fix pending operation query for refunds
This commit is contained in:
parent
165486a112
commit
27e42111e7
@ -366,6 +366,7 @@ async function gatherPurchasePending(
|
||||
now,
|
||||
pr.payRetryInfo.nextRetry,
|
||||
);
|
||||
if (!onlyDue || pr.payRetryInfo.nextRetry.t_ms <= now.t_ms) {
|
||||
resp.pendingOperations.push({
|
||||
type: "pay",
|
||||
givesLifeness: true,
|
||||
@ -375,12 +376,14 @@ async function gatherPurchasePending(
|
||||
lastError: pr.lastPayError,
|
||||
});
|
||||
}
|
||||
}
|
||||
if (pr.refundStatusRequested) {
|
||||
resp.nextRetryDelay = updateRetryDelay(
|
||||
resp.nextRetryDelay,
|
||||
now,
|
||||
pr.refundStatusRetryInfo.nextRetry,
|
||||
);
|
||||
if (!onlyDue || pr.refundStatusRetryInfo.nextRetry.t_ms <= now.t_ms) {
|
||||
resp.pendingOperations.push({
|
||||
type: "refund-query",
|
||||
givesLifeness: true,
|
||||
@ -389,6 +392,7 @@ async function gatherPurchasePending(
|
||||
lastError: pr.lastRefundStatusError,
|
||||
});
|
||||
}
|
||||
}
|
||||
const numRefundsPending = Object.keys(pr.refundsPending).length;
|
||||
if (numRefundsPending > 0) {
|
||||
const numRefundsDone = Object.keys(pr.refundsDone).length;
|
||||
@ -397,6 +401,7 @@ async function gatherPurchasePending(
|
||||
now,
|
||||
pr.refundApplyRetryInfo.nextRetry,
|
||||
);
|
||||
if (!onlyDue || pr.refundApplyRetryInfo.nextRetry.t_ms <= now.t_ms) {
|
||||
resp.pendingOperations.push({
|
||||
type: "refund-apply",
|
||||
numRefundsDone,
|
||||
@ -407,6 +412,7 @@ async function gatherPurchasePending(
|
||||
lastError: pr.lastRefundApplyError,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user