From 79c14e77ecdb0fcf11c109cd53ce8d065d47c611 Mon Sep 17 00:00:00 2001 From: ms Date: Wed, 1 Sep 2021 17:38:54 +0200 Subject: Avoid Sandbox (deprecated) POST /admin/payments/ API. --- .../src/integrationtests/test-libeufin-refund.ts | 34 +++++++--------------- 1 file changed, 11 insertions(+), 23 deletions(-) (limited to 'packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund.ts') diff --git a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund.ts b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund.ts index 843a35d88..cd488fcf5 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-libeufin-refund.ts @@ -63,43 +63,29 @@ export async function runLibeufinRefundTest(t: GlobalTestState) { * user01 checks whether one incoming payment exists in the * history. This one incoming payment will be the refund. */ - await LibeufinSandboxApi.bookPayment( - libeufinServices.libeufinSandbox, - user02sandbox, - user01sandbox, + await libeufinServices.libeufinSandbox.makeTransaction( + user02sandbox.ebicsBankAccount.label, // debit + user01sandbox.ebicsBankAccount.label, // credit + "EUR:1", "not a public key", - "1", - "EUR", ); - // check payment shows up in the Sandbox' history. - // NOTE: the debitor account has no entry so far, because - // the call above is a mere test method that books only one - // CRDT transaction. - const txsCredit = await LibeufinSandboxApi.getAccountTransactions( - libeufinServices.libeufinSandbox, - user02sandbox.ebicsBankAccount["label"]); - t.assertTrue(txsCredit["payments"].length == 1); - // Gets the faulty payment in the (ingested) history. await LibeufinNexusApi.fetchAllTransactions( libeufinServices.libeufinNexus, - user02nexus.localAccountName, + user01nexus.localAccountName, ); - // Give time to ingest. - delayMs(2000); - // Check payment shows up in Nexus history. const nexusTxs = await LibeufinNexusApi.getAccountTransactions( libeufinServices.libeufinNexus, - user02nexus.localAccountName, + user01nexus.localAccountName, ); t.assertTrue(nexusTxs.data["transactions"].length == 1); // This should pay the faulty payment back. await LibeufinNexusApi.submitInitiatedPayment( libeufinServices.libeufinNexus, - user02nexus.localAccountName, + user01nexus.localAccountName, // The initiated payment ID below got set by the Taler // facade; at this point only one can / must exist. "1", @@ -108,8 +94,10 @@ export async function runLibeufinRefundTest(t: GlobalTestState) { // Counterpart checks whether the reimbursement shows up. let history = await LibeufinSandboxApi.getAccountTransactions( libeufinServices.libeufinSandbox, - user01sandbox.ebicsBankAccount["label"], + user02sandbox.ebicsBankAccount["label"], ); - t.assertTrue(history["payments"].length == 1); + + // 2 is total: 1 the original payment + 1 the reimbursement. + t.assertTrue(history["payments"].length == 2); } runLibeufinRefundTest.suites = ["libeufin"]; -- cgit v1.2.3