From 05cb8fc7935cb409d4776eb78f21452a86e66693 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Tue, 12 May 2020 11:26:19 -0300 Subject: Small tweaks of transactions API --- taler-wallet.rst | 52 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 10 deletions(-) (limited to 'taler-wallet.rst') diff --git a/taler-wallet.rst b/taler-wallet.rst index 11167ea9..beae2068 100644 --- a/taler-wallet.rst +++ b/taler-wallet.rst @@ -92,8 +92,8 @@ Transactions are all operations or events that are affecting the balance. .. ts:def:: TransactionsRequest interface TransactionsRequest { - // return only transactions in the given currency - currency: string; + // return only transactions in the given currency, if present + currency?: string; // if present, results will be limited to transactions related to the given search string search?: string; @@ -177,9 +177,8 @@ Transactions are all operations or events that are affecting the balance. // Additional information about the payment. info: TransactionInfo; - // true if the payment failed, false otherwise. - // Note that failed payments with zero effective amount will not be returned by the API. - failed: boolean; + // The current status of this payment. + status: PaymentStatus; // Amount that must be paid for the contract amountRaw: Amount; @@ -210,6 +209,26 @@ Transactions are all operations or events that are affecting the balance. fulfillmentUrl: string; } + .. ts:def:: PaymentStatus + + enum PaymentStatus { + // Explicitly aborted after timeout / failure + Aborted = "aborted", + + // Payment failed, wallet will auto-retry. + // User should be given the option to retry now / abort. + Failed = "failed", + + // Paid successfully + Paid = "paid", + + // Only offered, user must accept / decline + Offered = "offered", + + // User accepted, payment is processing. + Accepted = "accepted", + } + .. ts:def:: TransactionRefund interface TransactionRefund extends Transaction { @@ -236,11 +255,8 @@ Transactions are all operations or events that are affecting the balance. interface TransactionTip extends Transaction { type: string = "tip", - // true if the user still needs to accept/decline this tip - waiting: boolean; - - // true if the user has accepted this top, false otherwise - accepted: boolean; + // The current status of this tip. + status: TipStatus; // Exchange that the tip will be (or was) withdrawn from exchangeBaseUrl: string; @@ -255,6 +271,22 @@ Transactions are all operations or events that are affecting the balance. amountEffective: Amount; } + .. ts:def:: TipStatus + + enum TipStatus { + // Only offered, user must accept / decline + Offered = "offered", + + // User accepted, tip is processing. + Accepted = "accepted", + + // User declined. + Declined = "declined", + + // Received successfully + Received = "received", + } + .. ts:def:: TransactionRefresh // A transaction shown for refreshes that are not associated to other transactions -- cgit v1.2.3