diff options
Diffstat (limited to 'packages/taler-wallet-core/src/operations/transactions.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/transactions.ts | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/packages/taler-wallet-core/src/operations/transactions.ts b/packages/taler-wallet-core/src/operations/transactions.ts index 3a219b39b..142eff7c1 100644 --- a/packages/taler-wallet-core/src/operations/transactions.ts +++ b/packages/taler-wallet-core/src/operations/transactions.ts @@ -114,11 +114,9 @@ import { suspendPeerPullCreditTransaction, } from "./pay-peer-pull-credit.js"; import { - abortPeerPullDebitTransaction, computePeerPullDebitTransactionActions, computePeerPullDebitTransactionState, - failPeerPullDebitTransaction, - resumePeerPullDebitTransaction, + PeerPullDebitTransactionContext, suspendPeerPullDebitTransaction, } from "./pay-peer-pull-debit.js"; import { @@ -1647,9 +1645,11 @@ export async function failTransaction( case TransactionType.PeerPullCredit: await failPeerPullCreditTransaction(ws, tx.pursePub); return; - case TransactionType.PeerPullDebit: - await failPeerPullDebitTransaction(ws, tx.peerPullDebitId); + case TransactionType.PeerPullDebit: { + const ctx = new PeerPullDebitTransactionContext(ws, tx.peerPullDebitId); + await ctx.failTransaction(); return; + } case TransactionType.PeerPushCredit: await failPeerPushCreditTransaction(ws, tx.peerPushCreditId); return; @@ -1692,9 +1692,11 @@ export async function resumeTransaction( case TransactionType.PeerPushDebit: await resumePeerPushDebitTransaction(ws, tx.pursePub); break; - case TransactionType.PeerPullDebit: - await resumePeerPullDebitTransaction(ws, tx.peerPullDebitId); - break; + case TransactionType.PeerPullDebit: { + const ctx = new PeerPullDebitTransactionContext(ws, tx.peerPullDebitId); + await ctx.resumeTransaction(); + return; + } case TransactionType.PeerPushCredit: await resumePeerPushCreditTransaction(ws, tx.peerPushCreditId); break; @@ -1936,9 +1938,11 @@ export async function abortTransaction( case TransactionType.PeerPullCredit: await abortPeerPullCreditTransaction(ws, txId.pursePub); break; - case TransactionType.PeerPullDebit: - await abortPeerPullDebitTransaction(ws, txId.peerPullDebitId); - break; + case TransactionType.PeerPullDebit: { + const ctx = new PeerPullDebitTransactionContext(ws, txId.peerPullDebitId); + await ctx.abortTransaction(); + return; + } case TransactionType.PeerPushCredit: await abortPeerPushCreditTransaction(ws, txId.peerPushCreditId); break; |