aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-02-19 23:13:44 +0100
committerFlorian Dold <florian@dold.me>2023-02-19 23:13:44 +0100
commite6ed901626a5219a1d091f4f41654365d2c29531 (patch)
tree1dfb2fbc7615ebe6e91621b901bf90968bd98edf /packages/taler-wallet-core/src/wallet.ts
parent925ef1f410e01323ee24ab9019afcc1713bf07c2 (diff)
downloadwallet-core-e6ed901626a5219a1d091f4f41654365d2c29531.tar.xz
wallet-core: various p2p payment fixes
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r--packages/taler-wallet-core/src/wallet.ts15
1 files changed, 9 insertions, 6 deletions
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<Op extends WalletApiOperation>(
}
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<Op extends WalletApiOperation>(
}
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);