From 9a1a3b350d4147243dbe2ecfcdcb846c0f3c6dcb Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 6 Sep 2023 11:23:33 +0200 Subject: harness: get rid of deprecated merchant API client --- .../src/integrationtests/test-refund-incremental.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'packages/taler-harness/src/integrationtests/test-refund-incremental.ts') diff --git a/packages/taler-harness/src/integrationtests/test-refund-incremental.ts b/packages/taler-harness/src/integrationtests/test-refund-incremental.ts index 8ac0948f2..7c895ad2b 100644 --- a/packages/taler-harness/src/integrationtests/test-refund-incremental.ts +++ b/packages/taler-harness/src/integrationtests/test-refund-incremental.ts @@ -26,7 +26,7 @@ import { import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { GlobalTestState, - MerchantPrivateApi, + MerchantApiClient, delayMs, } from "../harness/harness.js"; import { @@ -43,6 +43,8 @@ export async function runRefundIncrementalTest(t: GlobalTestState) { const { walletClient, bank, exchange, merchant } = await createSimpleTestkudosEnvironmentV2(t); + const merchantClient = new MerchantApiClient(merchant.makeInstanceBaseUrl()); + // Withdraw digital cash into the wallet. const wres = await withdrawViaBankV2(t, { @@ -56,7 +58,7 @@ export async function runRefundIncrementalTest(t: GlobalTestState) { // Set up order. - const orderResp = await MerchantPrivateApi.createOrder(merchant, "default", { + const orderResp = await merchantClient.createOrder({ order: { summary: "Buy me!", amount: "TESTKUDOS:10", @@ -67,7 +69,7 @@ export async function runRefundIncrementalTest(t: GlobalTestState) { ), }); - let orderStatus = await MerchantPrivateApi.queryPrivateOrderStatus(merchant, { + let orderStatus = await merchantClient.queryPrivateOrderStatus({ orderId: orderResp.order_id, }); @@ -85,13 +87,13 @@ export async function runRefundIncrementalTest(t: GlobalTestState) { // Check if payment was successful. - orderStatus = await MerchantPrivateApi.queryPrivateOrderStatus(merchant, { + orderStatus = await merchantClient.queryPrivateOrderStatus({ orderId: orderResp.order_id, }); t.assertTrue(orderStatus.order_status === "paid"); - let ref = await MerchantPrivateApi.giveRefund(merchant, { + let ref = await merchantClient.giveRefund({ amount: "TESTKUDOS:2.5", instance: "default", justification: "foo", @@ -120,7 +122,7 @@ export async function runRefundIncrementalTest(t: GlobalTestState) { // refund will be grouped with the previous one. await delayMs(1200); - ref = await MerchantPrivateApi.giveRefund(merchant, { + ref = await merchantClient.giveRefund({ amount: "TESTKUDOS:5", instance: "default", justification: "bar", @@ -133,7 +135,7 @@ export async function runRefundIncrementalTest(t: GlobalTestState) { // refund will be grouped with the previous one. await delayMs(1200); - ref = await MerchantPrivateApi.giveRefund(merchant, { + ref = await merchantClient.giveRefund({ amount: "TESTKUDOS:10", instance: "default", justification: "bar", @@ -153,7 +155,7 @@ export async function runRefundIncrementalTest(t: GlobalTestState) { console.log(wr); } - orderStatus = await MerchantPrivateApi.queryPrivateOrderStatus(merchant, { + orderStatus = await merchantClient.queryPrivateOrderStatus({ orderId: orderResp.order_id, }); -- cgit v1.2.3