diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-07-24 14:42:35 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-07-24 14:42:35 +0530 |
commit | 530f0b3f2e6a44840a2069b84ac9e5a438d01e8e (patch) | |
tree | b663d9e73bff705e4d858f240326bc719667e05e /src/operations | |
parent | 245564ec5c4378215c3fab7583f7848ad23efc65 (diff) |
implement merchant API changes
Diffstat (limited to 'src/operations')
-rw-r--r-- | src/operations/refund.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/operations/refund.ts b/src/operations/refund.ts index af3325cfd..b91d42a3f 100644 --- a/src/operations/refund.ts +++ b/src/operations/refund.ts @@ -227,7 +227,7 @@ async function acceptRefunds( // Still pending. if ( - refundStatus.success === false && + refundStatus.type === "failure" && existingRefundInfo?.type === RefundState.Pending ) { continue; @@ -235,7 +235,7 @@ async function acceptRefunds( // Invariant: (!existingRefundInfo) || (existingRefundInfo === Pending) - if (refundStatus.success === true) { + if (refundStatus.type === "success") { await applySuccessfulRefund(tx, p, refreshCoinsMap, refundStatus); } else { await storePendingRefund(tx, p, refundStatus); @@ -417,7 +417,7 @@ async function processPurchaseQueryRefundImpl( codecForMerchantOrderStatus(), ); - if (!refundResponse.paid) { + if (refundResponse.order_status !== "paid") { logger.error("can't refund unpaid order"); return; } |