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-pay-paid.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-pay-paid.ts')
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-pay-paid.ts | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-pay-paid.ts b/packages/taler-harness/src/integrationtests/test-pay-paid.ts index 8d39ad4f6..4fe13b3ae 100644 --- a/packages/taler-harness/src/integrationtests/test-pay-paid.ts +++ b/packages/taler-harness/src/integrationtests/test-pay-paid.ts @@ -19,7 +19,7 @@ */ import { GlobalTestState, - MerchantPrivateApi, + MerchantApiClient, harnessHttpLib, } from "../harness/harness.js"; import { @@ -71,7 +71,9 @@ export async function runPayPaidTest(t: GlobalTestState) { const merchant = faultyMerchant; - let orderResp = await MerchantPrivateApi.createOrder(merchant, "default", { + const merchantClient = new MerchantApiClient(merchant.makeInstanceBaseUrl()); + + let orderResp = await merchantClient.createOrder({ order: { summary: "Buy me!", amount: "TESTKUDOS:5", @@ -80,7 +82,7 @@ export async function runPayPaidTest(t: GlobalTestState) { }, }); - let orderStatus = await MerchantPrivateApi.queryPrivateOrderStatus(merchant, { + let orderStatus = await merchantClient.queryPrivateOrderStatus({ orderId: orderResp.order_id, sessionId: "mysession-one", }); @@ -127,12 +129,9 @@ export async function runPayPaidTest(t: GlobalTestState) { publicOrderStatusResp.json(), ); - const confirmPayRes = await walletClient.call( - WalletApiOperation.ConfirmPay, - { - proposalId: proposalId, - }, - ); + const confirmPayRes = await walletClient.call(WalletApiOperation.ConfirmPay, { + proposalId: proposalId, + }); t.assertTrue(confirmPayRes.type === ConfirmPayResultType.Done); @@ -153,7 +152,7 @@ export async function runPayPaidTest(t: GlobalTestState) { * ========================================================================= */ - orderStatus = await MerchantPrivateApi.queryPrivateOrderStatus(merchant, { + orderStatus = await merchantClient.queryPrivateOrderStatus({ orderId: orderResp.order_id, sessionId: "mysession-two", }); @@ -180,7 +179,7 @@ export async function runPayPaidTest(t: GlobalTestState) { }, }); - let orderRespTwo = await MerchantPrivateApi.createOrder(merchant, "default", { + let orderRespTwo = await merchantClient.createOrder({ order: { summary: "Buy me!", amount: "TESTKUDOS:5", @@ -189,13 +188,10 @@ export async function runPayPaidTest(t: GlobalTestState) { }, }); - let orderStatusTwo = await MerchantPrivateApi.queryPrivateOrderStatus( - merchant, - { - orderId: orderRespTwo.order_id, - sessionId: "mysession-two", - }, - ); + let orderStatusTwo = await merchantClient.queryPrivateOrderStatus({ + orderId: orderRespTwo.order_id, + sessionId: "mysession-two", + }); t.assertTrue(orderStatusTwo.order_status === "unpaid"); |