diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-12-06 00:24:34 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-12-06 00:24:34 +0100 |
commit | 65bccbd139c53a2baccec442a680373125488102 (patch) | |
tree | 216860ec3523af33091b8fb52193787034c667f8 /src/dbTypes.ts | |
parent | 7b54439fd62bd2a5e15b3068a8fbaffeb0a57468 (diff) | |
download | wallet-core-65bccbd139c53a2baccec442a680373125488102.tar.xz |
separate operations for pay, refund status query and refund submission
Diffstat (limited to 'src/dbTypes.ts')
-rw-r--r-- | src/dbTypes.ts | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/src/dbTypes.ts b/src/dbTypes.ts index 096c3f04e..e39d73672 100644 --- a/src/dbTypes.ts +++ b/src/dbTypes.ts @@ -970,18 +970,6 @@ export interface WireFee { sig: string; } -export enum PurchaseStatus { - /** - * We're currently paying, either for the first - * time or as a re-play potentially with a different - * session ID. - */ - SubmitPay = "submit-pay", - QueryRefund = "query-refund", - ProcessRefund = "process-refund", - Abort = "abort", - Dormant = "dormant", -} /** * Record that stores status information about one purchase, starting from when @@ -995,11 +983,6 @@ export interface PurchaseRecord { proposalId: string; /** - * Status of this purchase. - */ - status: PurchaseStatus; - - /** * Hash of the contract terms. */ contractTermsHash: string; @@ -1021,10 +1004,9 @@ export interface PurchaseRecord { merchantSig: string; /** - * The purchase isn't active anymore, it's either successfully paid or - * refunded/aborted. + * A successful payment has been made. */ - finished: boolean; + payFinished: boolean; /** * Pending refunds for the purchase. @@ -1046,13 +1028,15 @@ export interface PurchaseRecord { * When was the last refund made? * Set to 0 if no refund was made on the purchase. */ - lastRefundTimestamp: Timestamp | undefined; + lastRefundStatusTimestamp: Timestamp | undefined; /** * Last session signature that we submitted to /pay (if any). */ lastSessionId: string | undefined; + refundStatusRequested: boolean; + /** * An abort (with refund) was requested for this (incomplete!) purchase. */ @@ -1063,9 +1047,29 @@ export interface PurchaseRecord { */ abortDone: boolean; - retryInfo: RetryInfo; + payRetryInfo: RetryInfo; - lastError: OperationError | undefined; + lastPayError: OperationError | undefined; + + /** + * Retry information for querying the refund status with the merchant. + */ + refundStatusRetryInfo: RetryInfo; + + /** + * Last error (or undefined) for querying the refund status with the merchant. + */ + 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; } /** |