diff options
author | Florian Dold <florian@dold.me> | 2023-09-06 11:23:33 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-09-06 11:23:33 +0200 |
commit | 9a1a3b350d4147243dbe2ecfcdcb846c0f3c6dcb (patch) | |
tree | f9b01f5748edf391146d2bbaec62aad285d261ec /packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts | |
parent | c9a0d2eb968133b1ad156e1dc86e6c06dad09c7a (diff) | |
download | wallet-core-9a1a3b350d4147243dbe2ecfcdcb846c0f3c6dcb.tar.xz |
harness: get rid of deprecated merchant API client
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts')
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts b/packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts index 08c9d4bb2..599a3fc16 100644 --- a/packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts +++ b/packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts @@ -29,9 +29,8 @@ import { BankService, ExchangeService, GlobalTestState, - MerchantPrivateApi, + MerchantApiClient, MerchantService, - WalletCli, harnessHttpLib, } from "../harness/harness.js"; import { @@ -66,7 +65,8 @@ async function testWithClaimToken( }); await wres.withdrawalFinishedCond; const sessionId = "mysession"; - const orderResp = await MerchantPrivateApi.createOrder(merchant, "default", { + const merchantClient = new MerchantApiClient(merchant.makeInstanceBaseUrl()); + const orderResp = await merchantClient.createOrder({ order: { summary: "Buy me!", amount: "TESTKUDOS:5", @@ -255,18 +255,14 @@ async function testWithClaimToken( t.assertTrue(confirmPayRes2.type === ConfirmPayResultType.Done); // Create another order with identical fulfillment URL to test the "already paid" flow - const alreadyPaidOrderResp = await MerchantPrivateApi.createOrder( - merchant, - "default", - { - order: { - summary: "Buy me!", - amount: "TESTKUDOS:5", - fulfillment_url: "https://example.com/article42", - public_reorder_url: "https://example.com/article42-share", - }, + const alreadyPaidOrderResp = await merchantClient.createOrder({ + order: { + summary: "Buy me!", + amount: "TESTKUDOS:5", + fulfillment_url: "https://example.com/article42", + public_reorder_url: "https://example.com/article42-share", }, - ); + }); const apOrderId = alreadyPaidOrderResp.order_id; const apToken = alreadyPaidOrderResp.token; @@ -319,6 +315,7 @@ async function testWithoutClaimToken( const sessionId = "mysession2"; const { bank, exchange } = c; const { merchant, merchantBaseUrl } = c; + const merchantClient = new MerchantApiClient(merchant.makeInstanceBaseUrl()); const wres = await withdrawViaBankV2(t, { walletClient, bank, @@ -326,7 +323,7 @@ async function testWithoutClaimToken( amount: "TESTKUDOS:20", }); await wres.withdrawalFinishedCond; - const orderResp = await MerchantPrivateApi.createOrder(merchant, "default", { + const orderResp = await merchantClient.createOrder({ order: { summary: "Buy me!", amount: "TESTKUDOS:5", @@ -514,18 +511,14 @@ async function testWithoutClaimToken( t.assertTrue(confirmPayRes2.type === ConfirmPayResultType.Done); // Create another order with identical fulfillment URL to test the "already paid" flow - const alreadyPaidOrderResp = await MerchantPrivateApi.createOrder( - merchant, - "default", - { - order: { - summary: "Buy me!", - amount: "TESTKUDOS:5", - fulfillment_url: "https://example.com/article42", - public_reorder_url: "https://example.com/article42-share", - }, + const alreadyPaidOrderResp = await merchantClient.createOrder({ + order: { + summary: "Buy me!", + amount: "TESTKUDOS:5", + fulfillment_url: "https://example.com/article42", + public_reorder_url: "https://example.com/article42-share", }, - ); + }); const apOrderId = alreadyPaidOrderResp.order_id; const apToken = alreadyPaidOrderResp.token; |