diff options
author | Florian Dold <florian@dold.me> | 2024-03-08 01:06:13 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-03-08 01:06:13 +0100 |
commit | b4ab2fcdf3e1bbc0ca9096661a1812481dca58b3 (patch) | |
tree | c6e09a24003360ff377a9cb64247a43d0adba851 /packages/taler-wallet-core/src/pay-peer-pull-debit.ts | |
parent | ae34a78ff026e2e96b1e15319157d36c57745665 (diff) | |
download | wallet-core-b4ab2fcdf3e1bbc0ca9096661a1812481dca58b3.tar.xz |
wallet-core: remove deprecated peer...PaymentId
Diffstat (limited to 'packages/taler-wallet-core/src/pay-peer-pull-debit.ts')
-rw-r--r-- | packages/taler-wallet-core/src/pay-peer-pull-debit.ts | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/packages/taler-wallet-core/src/pay-peer-pull-debit.ts b/packages/taler-wallet-core/src/pay-peer-pull-debit.ts index 0ccca82a2..114d2366a 100644 --- a/packages/taler-wallet-core/src/pay-peer-pull-debit.ts +++ b/packages/taler-wallet-core/src/pay-peer-pull-debit.ts @@ -561,18 +561,11 @@ export async function confirmPeerPullDebit( req: ConfirmPeerPullDebitRequest, ): Promise<AcceptPeerPullPaymentResponse> { let peerPullDebitId: string; - - if (req.transactionId) { - const parsedTx = parseTransactionIdentifier(req.transactionId); - if (!parsedTx || parsedTx.tag !== TransactionType.PeerPullDebit) { - throw Error("invalid peer-pull-debit transaction identifier"); - } - peerPullDebitId = parsedTx.peerPullDebitId; - } else if (req.peerPullDebitId) { - peerPullDebitId = req.peerPullDebitId; - } else { - throw Error("invalid request, transactionId or peerPullDebitId required"); + const parsedTx = parseTransactionIdentifier(req.transactionId); + if (!parsedTx || parsedTx.tag !== TransactionType.PeerPullDebit) { + throw Error("invalid peer-pull-debit transaction identifier"); } + peerPullDebitId = parsedTx.peerPullDebitId; const peerPullInc = await wex.db.runReadOnlyTx( ["peerPullDebit"], @@ -583,7 +576,7 @@ export async function confirmPeerPullDebit( if (!peerPullInc) { throw Error( - `can't accept unknown incoming p2p pull payment (${req.peerPullDebitId})`, + `can't accept unknown incoming p2p pull payment (${req.transactionId})`, ); } |