taler-typescript-core

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

commit 32de0432c0a9f050cba1eb44d93388fe28687a67
parent 6257e84ab59fbeb409ac74585b2fec6e6e9256f5
Author: Florian Dold <dold@taler.net>
Date:   Tue, 28 Jul 2026 19:56:58 +0200

harness: check the error code for a refund URI with no purchase

Issue: https://bugs.taler.net/n/10692

Diffstat:
Mpackages/taler-harness/src/integrationtests/test-refund.ts | 26++++++++++++++++++++++++++
1 file changed, 26 insertions(+), 0 deletions(-)

diff --git a/packages/taler-harness/src/integrationtests/test-refund.ts b/packages/taler-harness/src/integrationtests/test-refund.ts @@ -21,8 +21,12 @@ import { Duration, j2s, NotificationType, + Result, succeedOrThrow, + TalerErrorCode, TalerMerchantInstanceHttpClient, + TalerUriAction, + TalerUris, TransactionMajorState, TransactionMinorState, TransactionType, @@ -188,6 +192,28 @@ export async function runRefundTest(t: GlobalTestState) { ); t.assertTrue(!!refundDoneNotif); + + // A refund URI for an order that was paid with some other wallet must be + // reported as such, not as an internal wallet failure. + { + const parsed = Result.orUndefined(TalerUris.parse(ref.taler_refund_uri)); + t.assertTrue(parsed?.type === TalerUriAction.Refund); + const unknownOrderUri = TalerUris.stringify({ + ...parsed, + orderId: `${parsed.orderId}-not-mine`, + }); + + const err = await t.assertThrowsTalerErrorAsync(async () => { + await wallet.client.call(WalletApiOperation.StartRefundQueryForUri, { + talerRefundUri: unknownOrderUri, + }); + }); + + t.assertDeepEqual( + err.errorDetail.code, + TalerErrorCode.WALLET_PURCHASE_NOT_FOUND, + ); + } } runRefundTest.suites = ["wallet"];