taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 9b715aedfc64af93fa7b7aabb6a099ce1563f02d
parent 28886113f7c45b338256e19e42498bc21cb109b7
Author: Florian Dold <dold@taler.net>
Date:   Sun,  6 Sep 2026 12:41:06 +0200

wallet: finish peer-pull purse creation after KYC approval

Move a successful post-KYC purse creation into the ready state. Fetch
the resulting authenticated purse URI before preparing the payer side.

Diffstat:
Mpackages/taler-harness/src/integrationtests/test-kyc-peer-pull.ts | 11++++++++++-
Mpackages/taler-wallet-core/src/pay-peer-pull-credit.test.ts | 6++++++
Mpackages/taler-wallet-core/src/pay-peer-pull-credit.ts | 1+
3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/packages/taler-harness/src/integrationtests/test-kyc-peer-pull.ts b/packages/taler-harness/src/integrationtests/test-kyc-peer-pull.ts @@ -123,10 +123,19 @@ export async function runKycPeerPullTest(t: GlobalTestState) { }, }); + // Purse creation after KYC adds the exchange commitment to the invoice URI. + const readyPull = await walletClient.call( + WalletApiOperation.GetTransactionById, + { + transactionId: pullRes.transactionId as TransactionIdStr, + }, + ); + t.assertTrue(readyPull.type === TransactionType.PeerPullCredit); + t.assertTrue(!!readyPull.talerUri); const prepRes = await w0.walletClient.call( WalletApiOperation.PreparePeerPullDebit, { - talerUri: pullRes.talerUri, + talerUri: readyPull.talerUri, }, ); diff --git a/packages/taler-wallet-core/src/pay-peer-pull-credit.test.ts b/packages/taler-wallet-core/src/pay-peer-pull-credit.test.ts @@ -158,6 +158,12 @@ test("late pull-credit create confirmations preserve cleanup", () => { PeerPullPaymentCreditStatus.PendingReady, ); assert.strictEqual( + statusAfterPullCreditCreate( + PeerPullPaymentCreditStatus.PendingMergeKycRequired, + ), + PeerPullPaymentCreditStatus.PendingReady, + ); + assert.strictEqual( statusAfterPullCreditCreate(PeerPullPaymentCreditStatus.Aborted), PeerPullPaymentCreditStatus.AbortingDeletePurse, ); diff --git a/packages/taler-wallet-core/src/pay-peer-pull-credit.ts b/packages/taler-wallet-core/src/pay-peer-pull-credit.ts @@ -1261,6 +1261,7 @@ export function statusAfterPullCreditCreate( ): PeerPullPaymentCreditStatus { switch (status) { case PeerPullPaymentCreditStatus.PendingCreatePurse: + case PeerPullPaymentCreditStatus.PendingMergeKycRequired: return PeerPullPaymentCreditStatus.PendingReady; case PeerPullPaymentCreditStatus.Aborted: return PeerPullPaymentCreditStatus.AbortingDeletePurse;