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-push-credit.ts | |
parent | ae34a78ff026e2e96b1e15319157d36c57745665 (diff) | |
download | wallet-core-b4ab2fcdf3e1bbc0ca9096661a1812481dca58b3.tar.gz wallet-core-b4ab2fcdf3e1bbc0ca9096661a1812481dca58b3.tar.bz2 wallet-core-b4ab2fcdf3e1bbc0ca9096661a1812481dca58b3.zip |
wallet-core: remove deprecated peer...PaymentId
Diffstat (limited to 'packages/taler-wallet-core/src/pay-peer-push-credit.ts')
-rw-r--r-- | packages/taler-wallet-core/src/pay-peer-push-credit.ts | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/packages/taler-wallet-core/src/pay-peer-push-credit.ts b/packages/taler-wallet-core/src/pay-peer-push-credit.ts index f6ba429a6..ecc1e827f 100644 --- a/packages/taler-wallet-core/src/pay-peer-push-credit.ts +++ b/packages/taler-wallet-core/src/pay-peer-push-credit.ts @@ -901,20 +901,14 @@ export async function confirmPeerPushCredit( ): Promise<AcceptPeerPushPaymentResponse> { let peerInc: PeerPushPaymentIncomingRecord | undefined; let peerPushCreditId: string; - if (req.peerPushCreditId) { - peerPushCreditId = req.peerPushCreditId; - } else if (req.transactionId) { - const parsedTx = parseTransactionIdentifier(req.transactionId); - if (!parsedTx) { - throw Error("invalid transaction ID"); - } - if (parsedTx.tag !== TransactionType.PeerPushCredit) { - throw Error("invalid transaction ID type"); - } - peerPushCreditId = parsedTx.peerPushCreditId; - } else { - throw Error("no transaction ID (or deprecated peerPushCreditId) provided"); + const parsedTx = parseTransactionIdentifier(req.transactionId); + if (!parsedTx) { + throw Error("invalid transaction ID"); + } + if (parsedTx.tag !== TransactionType.PeerPushCredit) { + throw Error("invalid transaction ID type"); } + peerPushCreditId = parsedTx.peerPushCreditId; logger.trace(`confirming peer-push-credit ${peerPushCreditId}`); @@ -934,7 +928,7 @@ export async function confirmPeerPushCredit( if (!peerInc) { throw Error( - `can't accept unknown incoming p2p push payment (${req.peerPushCreditId})`, + `can't accept unknown incoming p2p push payment (${req.transactionId})`, ); } |