summaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/integrationtests/test-payment-expired.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-payment-expired.ts')
-rw-r--r--packages/taler-harness/src/integrationtests/test-payment-expired.ts27
1 files changed, 14 insertions, 13 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-payment-expired.ts b/packages/taler-harness/src/integrationtests/test-payment-expired.ts
index 176fc74f7..3f1f7f2dd 100644
--- a/packages/taler-harness/src/integrationtests/test-payment-expired.ts
+++ b/packages/taler-harness/src/integrationtests/test-payment-expired.ts
@@ -22,16 +22,16 @@ import {
ConfirmPayResultType,
Duration,
MerchantApiClient,
- MerchantContractTerms,
PreparePayResultType,
+ TalerMerchantApi,
j2s,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
import { GlobalTestState } from "../harness/harness.js";
import {
applyTimeTravelV2,
- createSimpleTestkudosEnvironmentV2,
- withdrawViaBankV2,
+ createSimpleTestkudosEnvironmentV3,
+ withdrawViaBankV3,
} from "../harness/helpers.js";
/**
@@ -49,14 +49,14 @@ import {
export async function runPaymentExpiredTest(t: GlobalTestState) {
// Set up test environment
- const { walletClient, bank, exchange, merchant } =
- await createSimpleTestkudosEnvironmentV2(t);
+ const { walletClient, bankClient, exchange, merchant } =
+ await createSimpleTestkudosEnvironmentV3(t);
// Withdraw digital cash into the wallet.
- await withdrawViaBankV2(t, {
+ await withdrawViaBankV3(t, {
walletClient,
- bank,
+ bankClient,
exchange,
amount: "TESTKUDOS:20",
});
@@ -64,7 +64,7 @@ export async function runPaymentExpiredTest(t: GlobalTestState) {
await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {});
// Order that can only be paid within five minutes.
- const order: Partial<MerchantContractTerms> = {
+ const order: TalerMerchantApi.Order = {
summary: "Buy me!",
amount: "TESTKUDOS:5",
fulfillment_url: "taler://fulfillment-success/thx",
@@ -117,15 +117,16 @@ export async function runPaymentExpiredTest(t: GlobalTestState) {
});
await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {});
- const bal = await walletClient.call(WalletApiOperation.GetBalances, {});
- console.log(bal);
-
- t.assertAmountEquals(bal.balances[0].available, "TESTKUDOS:18.93");
-
const txns = await walletClient.call(WalletApiOperation.GetTransactions, {
+ sort: "stable-ascending",
includeRefreshes: true,
});
console.log(j2s(txns));
+
+ const bal = await walletClient.call(WalletApiOperation.GetBalances, {});
+ console.log(j2s(bal));
+
+ t.assertAmountEquals(bal.balances[0].available, "TESTKUDOS:18.93");
}
runPaymentExpiredTest.suites = ["wallet"];