diff options
author | Florian Dold <florian@dold.me> | 2023-05-05 19:03:44 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-05-07 21:51:02 +0200 |
commit | 7f0edb6a783d9a50f94f65c815c1280baecaac89 (patch) | |
tree | b4f3bc24fece1f651e8c2f69fc0fcf52e1d6f330 /packages/taler-wallet-webextension/src/cta/Refund | |
parent | a0bf83fbb5db026389cc7d203adcff050d5a1b28 (diff) | |
download | wallet-core-7f0edb6a783d9a50f94f65c815c1280baecaac89.tar.xz |
wallet-core: refund DD37 refactoring
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Refund')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Refund/state.ts | 6 | ||||
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Refund/test.ts | 10 |
2 files changed, 8 insertions, 8 deletions
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<void> => { - 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", |