From 5be0708a10874be939e63ca82082cd665165823c Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 27 Apr 2020 21:11:20 +0530 Subject: adopt new merchant refund API --- src/types/dbTypes.ts | 58 +++++++++++++++++++--------------------------------- 1 file changed, 21 insertions(+), 37 deletions(-) (limited to 'src/types/dbTypes.ts') diff --git a/src/types/dbTypes.ts b/src/types/dbTypes.ts index a9344c045..158d438cf 100644 --- a/src/types/dbTypes.ts +++ b/src/types/dbTypes.ts @@ -27,7 +27,7 @@ import { AmountJson } from "../util/amounts"; import { Auditor, CoinDepositPermission, - MerchantRefundPermission, + MerchantRefundDetails, PayReq, TipResponse, ExchangeSignKeyJson, @@ -1091,7 +1091,7 @@ export interface RefundEventRecord { export interface RefundInfo { refundGroupId: string; - perm: MerchantRefundPermission; + perm: MerchantRefundDetails; } export const enum RefundReason { @@ -1102,7 +1102,7 @@ export const enum RefundReason { /** * Refund from an aborted payment. */ - AbortRefund = "abort-refund", + AbortRefund = "abort-pay-refund", } export interface RefundGroupInfo { @@ -1110,28 +1110,6 @@ export interface RefundGroupInfo { reason: RefundReason; } -export interface PurchaseRefundState { - /** - * Information regarding each group of refunds we receive at once. - */ - refundGroups: RefundGroupInfo[]; - - /** - * Pending refunds for the purchase. - */ - refundsPending: { [refundSig: string]: RefundInfo }; - - /** - * Applied refunds for the purchase. - */ - refundsDone: { [refundSig: string]: RefundInfo }; - - /** - * Submitted refunds for the purchase. - */ - refundsFailed: { [refundSig: string]: RefundInfo }; -} - /** * Record stored for every time we successfully submitted * a payment to the merchant (both first time and re-play). @@ -1230,9 +1208,25 @@ export interface PurchaseRecord { timestampAccept: Timestamp; /** - * State of refunds for this proposal. + * Information regarding each group of refunds we receive at once. + */ + refundGroups: RefundGroupInfo[]; + + /** + * Pending refunds for the purchase. A refund is pending + * when the merchant reports a transient error from the exchange. + */ + refundsPending: { [refundKey: string]: RefundInfo }; + + /** + * Applied refunds for the purchase. + */ + refundsDone: { [refundKey: string]: RefundInfo }; + + /** + * Refunds that permanently failed. */ - refundState: PurchaseRefundState; + refundsFailed: { [refundKey: string]: RefundInfo }; /** * When was the last refund made? @@ -1280,16 +1274,6 @@ export interface PurchaseRecord { */ lastRefundStatusError: OperationError | undefined; - /** - * Retry information for querying the refund status with the merchant. - */ - refundApplyRetryInfo: RetryInfo; - - /** - * Last error (or undefined) for querying the refund status with the merchant. - */ - lastRefundApplyError: OperationError | undefined; - /** * Continue querying the refund status until this deadline has expired. */ -- cgit v1.2.3