aboutsummaryrefslogtreecommitdiff
path: root/src/types
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-05-12 16:19:40 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-05-12 16:19:40 +0530
commit3007419c98c24502c45409d4eea2e933662bc5e6 (patch)
treed7a150f8813d990d5cd4390dbd2234a05d3f3ed0 /src/types
parentee7141e28b482c9655e0b78052ead0f2b5ed5d05 (diff)
downloadwallet-core-3007419c98c24502c45409d4eea2e933662bc5e6.tar.xz
show offered paymentsv0.7.1-dev.2
Diffstat (limited to 'src/types')
-rw-r--r--src/types/transactions.ts24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/types/transactions.ts b/src/types/transactions.ts
index 7dda46f73..263e08a4e 100644
--- a/src/types/transactions.ts
+++ b/src/types/transactions.ts
@@ -111,15 +111,31 @@ interface TransactionWithdrawal extends TransactionCommon {
amountEffective?: AmountString;
}
-interface TransactionPayment extends TransactionCommon {
+export const 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",
+}
+
+export interface TransactionPayment extends TransactionCommon {
type: TransactionType.Payment;
// Additional information about the payment.
info: PaymentShortInfo;
- // true if the payment failed, false otherwise.
- // Note that failed payments with zero effective amount will not be returned by the API.
- failed: boolean;
+ status: PaymentStatus;
// Amount that must be paid for the contract
amountRaw: AmountString;