summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/transactions.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-09-09 02:18:03 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-09-09 02:18:03 +0530
commit67df550b4f6d67f8de346985df26133dc8da5c05 (patch)
tree575b514c1f6a9723fd32678da42f21c3c7ab523b /packages/taler-wallet-core/src/operations/transactions.ts
parent68ca4600e0e3460423a6c33530bd4bb8096afa65 (diff)
downloadwallet-core-67df550b4f6d67f8de346985df26133dc8da5c05.tar.gz
wallet-core-67df550b4f6d67f8de346985df26133dc8da5c05.tar.bz2
wallet-core-67df550b4f6d67f8de346985df26133dc8da5c05.zip
implement payment aborts with integration test
Diffstat (limited to 'packages/taler-wallet-core/src/operations/transactions.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/transactions.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts
index 5bc4ebace..87236d5a0 100644
--- a/packages/taler-wallet-core/src/operations/transactions.ts
+++ b/packages/taler-wallet-core/src/operations/transactions.ts
@@ -23,6 +23,7 @@ import {
WalletRefundItem,
RefundState,
ReserveRecordStatus,
+ AbortStatus,
} from "../types/dbTypes";
import { Amounts, AmountJson } from "../util/amounts";
import { timestampCmp } from "../util/time";
@@ -242,7 +243,9 @@ export async function getTransactions(
status: pr.timestampFirstSuccessfulPay
? PaymentStatus.Paid
: PaymentStatus.Accepted,
- pending: !pr.timestampFirstSuccessfulPay,
+ pending:
+ !pr.timestampFirstSuccessfulPay &&
+ pr.abortStatus === AbortStatus.None,
timestamp: pr.timestampAccept,
transactionId: paymentTransactionId,
info: info,
@@ -324,7 +327,10 @@ export async function getTransactions(
amountRaw: Amounts.stringify(tipRecord.tipAmountRaw),
pending: !tipRecord.pickedUpTimestamp,
timestamp: tipRecord.acceptedTimestamp,
- transactionId: makeEventId(TransactionType.Tip, tipRecord.walletTipId),
+ transactionId: makeEventId(
+ TransactionType.Tip,
+ tipRecord.walletTipId,
+ ),
error: tipRecord.lastError,
});
});
@@ -337,5 +343,5 @@ export async function getTransactions(
txPending.sort((h1, h2) => timestampCmp(h1.timestamp, h2.timestamp));
txNotPending.sort((h1, h2) => timestampCmp(h1.timestamp, h2.timestamp));
- return { transactions: [...txPending, ...txNotPending] };
+ return { transactions: [...txNotPending, ...txPending] };
}