aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/integrationtests/test-wallet-balance.ts
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-09-09 07:34:11 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2023-09-09 07:34:11 +0200
commit5495551071a3fdc36c38deb4c1cf6f4aa5b98bd4 (patch)
treeadf7730b190618a0499e50a2d43cf1b850cddd16 /packages/taler-harness/src/integrationtests/test-wallet-balance.ts
parent94cfcc875065f988815c31aaf8ebf36f75ac5983 (diff)
parent6c3cfa9be7a332c2cc8490f25ebd6c73c8244842 (diff)
Merge branch 'master' into age-withdraw
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-wallet-balance.ts')
-rw-r--r--packages/taler-harness/src/integrationtests/test-wallet-balance.ts29
1 files changed, 24 insertions, 5 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-wallet-balance.ts b/packages/taler-harness/src/integrationtests/test-wallet-balance.ts
index 15b0fd427..fc2774adf 100644
--- a/packages/taler-harness/src/integrationtests/test-wallet-balance.ts
+++ b/packages/taler-harness/src/integrationtests/test-wallet-balance.ts
@@ -17,9 +17,15 @@
/**
* Imports.
*/
-import { Amounts, PreparePayResultType } from "@gnu-taler/taler-util";
+import {
+ Amounts,
+ Duration,
+ MerchantApiClient,
+ MerchantContractTerms,
+ PreparePayResultType,
+} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
-import { GlobalTestState, MerchantPrivateApi } from "../harness/harness.js";
+import { GlobalTestState } from "../harness/harness.js";
import {
createSimpleTestkudosEnvironmentV2,
withdrawViaBankV2,
@@ -37,6 +43,19 @@ export async function runWalletBalanceTest(t: GlobalTestState) {
const { merchant, walletClient, exchange, bank } =
await createSimpleTestkudosEnvironmentV2(t);
+ await merchant.addInstanceWithWireAccount({
+ id: "myinst",
+ name: "My Instance",
+ paytoUris: ["payto://void/foo"],
+ defaultWireTransferDelay: Duration.toTalerProtocolDuration(
+ Duration.fromSpec({ minutes: 1 }),
+ ),
+ });
+
+ const merchantClient = new MerchantApiClient(
+ merchant.makeInstanceBaseUrl("myinst"),
+ );
+
// Withdraw digital cash into the wallet.
const wres = await withdrawViaBankV2(t, {
@@ -48,17 +67,17 @@ export async function runWalletBalanceTest(t: GlobalTestState) {
await wres.withdrawalFinishedCond;
- const order = {
+ const order: Partial<MerchantContractTerms> = {
summary: "Buy me!",
amount: "TESTKUDOS:5",
fulfillment_url: "taler://fulfillment-success/thx",
};
- const orderResp = await MerchantPrivateApi.createOrder(merchant, "default", {
+ const orderResp = await merchantClient.createOrder({
order,
});
- let orderStatus = await MerchantPrivateApi.queryPrivateOrderStatus(merchant, {
+ let orderStatus = await merchantClient.queryPrivateOrderStatus({
orderId: orderResp.order_id,
});