aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-07-12 17:41:14 +0200
committerFlorian Dold <florian@dold.me>2022-07-12 17:41:14 +0200
commitf11483b511ff1f839b9913c4832eee9109f67aeb (patch)
tree6f4e1c5891a24bbb7500cea3964d3826d2ef87e1 /packages/taler-wallet-core/src/wallet.ts
parentb214934b75418d0d01c9556577d9594f1db5a319 (diff)
downloadwallet-core-f11483b511ff1f839b9913c4832eee9109f67aeb.tar.xz
wallet-core: implement accepting p2p push payments
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r--packages/taler-wallet-core/src/wallet.ts17
1 files changed, 16 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
index d072f9e96..b56e9402d 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -32,11 +32,13 @@ import {
codecForAcceptBankIntegratedWithdrawalRequest,
codecForAcceptExchangeTosRequest,
codecForAcceptManualWithdrawalRequet,
+ codecForAcceptPeerPushPaymentRequest,
codecForAcceptTipRequest,
codecForAddExchangeRequest,
codecForAny,
codecForApplyRefundFromPurchaseIdRequest,
codecForApplyRefundRequest,
+ codecForCheckPeerPushPaymentRequest,
codecForConfirmPayRequest,
codecForCreateDepositGroupRequest,
codecForDeleteTransactionRequest,
@@ -144,7 +146,11 @@ import {
processDownloadProposal,
processPurchasePay,
} from "./operations/pay.js";
-import { initiatePeerToPeerPush } from "./operations/peer-to-peer.js";
+import {
+ acceptPeerPushPayment,
+ checkPeerPushPayment,
+ initiatePeerToPeerPush,
+} from "./operations/peer-to-peer.js";
import { getPendingOperations } from "./operations/pending.js";
import { createRecoupGroup, processRecoupGroup } from "./operations/recoup.js";
import {
@@ -1055,6 +1061,15 @@ async function dispatchRequestInternal(
const req = codecForInitiatePeerPushPaymentRequest().decode(payload);
return await initiatePeerToPeerPush(ws, req);
}
+ case "checkPeerPushPayment": {
+ const req = codecForCheckPeerPushPaymentRequest().decode(payload);
+ return await checkPeerPushPayment(ws, req);
+ }
+ case "acceptPeerPushPayment": {
+ const req = codecForAcceptPeerPushPaymentRequest().decode(payload);
+ await acceptPeerPushPayment(ws, req);
+ return {};
+ }
}
throw TalerError.fromDetail(
TalerErrorCode.WALLET_CORE_API_OPERATION_UNKNOWN,