summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/pay-peer-pull-debit.ts
diff options
context:
space:
mode:
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.ts17
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})`,
);
}