diff options
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-payment-share.ts')
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-payment-share.ts | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-payment-share.ts b/packages/taler-harness/src/integrationtests/test-payment-share.ts index 156571372..c12140d06 100644 --- a/packages/taler-harness/src/integrationtests/test-payment-share.ts +++ b/packages/taler-harness/src/integrationtests/test-payment-share.ts @@ -22,7 +22,7 @@ import { PreparePayResultType, } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; -import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js"; +import { GlobalTestState, MerchantApiClient } from "../harness/harness.js"; import { createSimpleTestkudosEnvironmentV2, createWalletDaemonWithClient, @@ -41,6 +41,8 @@ export async function runPaymentShareTest(t: GlobalTestState) { merchant, } = await createSimpleTestkudosEnvironmentV2(t); + const merchantClient = new MerchantApiClient(merchant.makeInstanceBaseUrl()); + // Withdraw digital cash into the wallet. await withdrawViaBankV2(t, { walletClient: firstWallet, @@ -62,7 +64,7 @@ export async function runPaymentShareTest(t: GlobalTestState) { }); await secondWallet.call(WalletApiOperation.TestingWaitTransactionsFinal, {}); - //create two orders to pay + // create two orders to pay async function createOrder(amount: string) { const order = { summary: "Buy me!", @@ -70,26 +72,16 @@ export async function runPaymentShareTest(t: GlobalTestState) { fulfillment_url: "taler://fulfillment-success/thx", }; - const instance = "default"; const args = { order }; const auth = {}; - const orderResp = await MerchantPrivateApi.createOrder( - merchant, - instance, - { - order: args.order, - }, - auth, - ); + const orderResp = await merchantClient.createOrder({ + order: args.order, + }); - const orderStatus = await MerchantPrivateApi.queryPrivateOrderStatus( - merchant, - { - orderId: orderResp.order_id, - }, - auth, - ); + const orderStatus = await merchantClient.queryPrivateOrderStatus({ + orderId: orderResp.order_id, + }); t.assertTrue(orderStatus.order_status === "unpaid"); return { id: orderResp.order_id, uri: orderStatus.taler_pay_uri }; |