From e6ed901626a5219a1d091f4f41654365d2c29531 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Sun, 19 Feb 2023 23:13:44 +0100 Subject: wallet-core: various p2p payment fixes --- packages/taler-wallet-core/src/wallet.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'packages/taler-wallet-core/src/wallet.ts') diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 0d02b667b..cbf11d84e 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -195,16 +195,17 @@ import { processPurchase, } from "./operations/pay-merchant.js"; import { - acceptPeerPullPayment, + acceptIncomingPeerPullPayment, acceptPeerPushPayment, - checkPeerPullPayment, + prepareIncomingPeerPullPayment, checkPeerPushPayment, initiatePeerPullPayment, initiatePeerPushPayment, - preparePeerPullPayment, + checkPeerPullPaymentInitiation, preparePeerPushPayment, processPeerPullInitiation, processPeerPushInitiation, + processPeerPullDebit, } from "./operations/pay-peer.js"; import { getPendingOperations } from "./operations/pending.js"; import { @@ -328,6 +329,8 @@ async function callOperationHandler( return await processPeerPushInitiation(ws, pending.pursePub); case PendingTaskType.PeerPullInitiation: return await processPeerPullInitiation(ws, pending.pursePub); + case PendingTaskType.PeerPullDebit: + return await processPeerPullDebit(ws, pending.peerPullPaymentIncomingId); default: return assertUnreachable(pending); } @@ -1440,7 +1443,7 @@ async function dispatchRequestInternal( } case WalletApiOperation.PreparePeerPullPayment: { const req = codecForPreparePeerPullPaymentRequest().decode(payload); - return await preparePeerPullPayment(ws, req); + return await checkPeerPullPaymentInitiation(ws, req); } case WalletApiOperation.InitiatePeerPullPayment: { const req = codecForInitiatePeerPullPaymentRequest().decode(payload); @@ -1448,11 +1451,11 @@ async function dispatchRequestInternal( } case WalletApiOperation.CheckPeerPullPayment: { const req = codecForCheckPeerPullPaymentRequest().decode(payload); - return await checkPeerPullPayment(ws, req); + return await prepareIncomingPeerPullPayment(ws, req); } case WalletApiOperation.AcceptPeerPullPayment: { const req = codecForAcceptPeerPullPaymentRequest().decode(payload); - return await acceptPeerPullPayment(ws, req); + return await acceptIncomingPeerPullPayment(ws, req); } case WalletApiOperation.ApplyDevExperiment: { const req = codecForApplyDevExperiment().decode(payload); -- cgit v1.2.3