aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/integrationtests/test-merchant-spec-public-orders.ts
diff options
context:
space:
mode:
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.ts45
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;