From 7f0edb6a783d9a50f94f65c815c1280baecaac89 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 5 May 2023 19:03:44 +0200 Subject: wallet-core: refund DD37 refactoring --- packages/taler-wallet-webextension/src/cta/Refund/state.ts | 6 +++--- packages/taler-wallet-webextension/src/cta/Refund/test.ts | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'packages/taler-wallet-webextension/src/cta') diff --git a/packages/taler-wallet-webextension/src/cta/Refund/state.ts b/packages/taler-wallet-webextension/src/cta/Refund/state.ts index 3a5e79040..7d6576445 100644 --- a/packages/taler-wallet-webextension/src/cta/Refund/state.ts +++ b/packages/taler-wallet-webextension/src/cta/Refund/state.ts @@ -35,7 +35,7 @@ export function useComponentState({ const info = useAsyncAsHook(async () => { if (!talerRefundUri) throw Error("ERROR_NO-URI-FOR-REFUND"); - const refund = await api.wallet.call(WalletApiOperation.PrepareRefund, { + const refund = await api.wallet.call(WalletApiOperation.StartRefundQueryForUri, { talerRefundUri, }); return { refund, uri: talerRefundUri }; @@ -70,8 +70,8 @@ export function useComponentState({ const { refund, uri } = info.response; const doAccept = async (): Promise => { - const res = await api.wallet.call(WalletApiOperation.ApplyRefund, { - talerRefundUri: uri, + const res = await api.wallet.call(WalletApiOperation.AcceptPurchaseRefund, { + transactionId: uri, }); onSuccess(res.transactionId); diff --git a/packages/taler-wallet-webextension/src/cta/Refund/test.ts b/packages/taler-wallet-webextension/src/cta/Refund/test.ts index 1a40cfbe3..a2e48f76d 100644 --- a/packages/taler-wallet-webextension/src/cta/Refund/test.ts +++ b/packages/taler-wallet-webextension/src/cta/Refund/test.ts @@ -72,7 +72,7 @@ describe("Refund CTA states", () => { onSuccess: nullFunction, }; - handler.addWalletCallResponse(WalletApiOperation.PrepareRefund, undefined, { + handler.addWalletCallResponse(WalletApiOperation.StartRefundQueryForUri, undefined, { awaiting: "EUR:2", effectivePaid: "EUR:2", gone: "EUR:0", @@ -126,7 +126,7 @@ describe("Refund CTA states", () => { }, }; - handler.addWalletCallResponse(WalletApiOperation.PrepareRefund, undefined, { + handler.addWalletCallResponse(WalletApiOperation.StartRefundQueryForUri, undefined, { awaiting: "EUR:2", effectivePaid: "EUR:2", gone: "EUR:0", @@ -187,7 +187,7 @@ describe("Refund CTA states", () => { }, }; - handler.addWalletCallResponse(WalletApiOperation.PrepareRefund, undefined, { + handler.addWalletCallResponse(WalletApiOperation.StartRefundQueryForUri, undefined, { awaiting: "EUR:2", effectivePaid: "EUR:2", gone: "EUR:0", @@ -203,7 +203,7 @@ describe("Refund CTA states", () => { summary: "the summary", } as OrderShortInfo, }); - handler.addWalletCallResponse(WalletApiOperation.PrepareRefund, undefined, { + handler.addWalletCallResponse(WalletApiOperation.StartRefundQueryForUri, undefined, { awaiting: "EUR:1", effectivePaid: "EUR:2", gone: "EUR:0", @@ -219,7 +219,7 @@ describe("Refund CTA states", () => { summary: "the summary", } as OrderShortInfo, }); - handler.addWalletCallResponse(WalletApiOperation.PrepareRefund, undefined, { + handler.addWalletCallResponse(WalletApiOperation.StartRefundQueryForUri, undefined, { awaiting: "EUR:0", effectivePaid: "EUR:2", gone: "EUR:0", -- cgit v1.2.3