diff options
author | Florian Dold <florian@dold.me> | 2021-06-17 13:34:59 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-06-17 13:35:08 +0200 |
commit | 5df7ddba97aa4482c781bfe8e87f60c3bc195ae4 (patch) | |
tree | 0956d310a83f0fafbb7d5a93001566f9035269a0 /packages/taler-wallet-cli/src/integrationtests/test-pay-abort.ts | |
parent | 0b4976601fe2ecb0462fe72ae188b5cbba06d9cc (diff) | |
download | wallet-core-5df7ddba97aa4482c781bfe8e87f60c3bc195ae4.tar.xz |
use the new wallet core API interface in all tests
Diffstat (limited to 'packages/taler-wallet-cli/src/integrationtests/test-pay-abort.ts')
-rw-r--r-- | packages/taler-wallet-cli/src/integrationtests/test-pay-abort.ts | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-pay-abort.ts b/packages/taler-wallet-cli/src/integrationtests/test-pay-abort.ts index 10f9904f1..29e0fd0a6 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-pay-abort.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-pay-abort.ts @@ -23,7 +23,7 @@ * Imports. */ import { PreparePayResultType, TalerErrorCode } from "@gnu-taler/taler-util"; -import { URL } from "@gnu-taler/taler-wallet-core"; +import { URL, WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { FaultInjectionRequestContext, FaultInjectionResponseContext, @@ -76,9 +76,12 @@ export async function runPayAbortTest(t: GlobalTestState) { // Make wallet pay for the order - const preparePayResult = await wallet.preparePay({ - talerPayUri: orderStatus.taler_pay_uri, - }); + const preparePayResult = await wallet.client.call( + WalletApiOperation.PreparePayForUri, + { + talerPayUri: orderStatus.taler_pay_uri, + }, + ); t.assertTrue( preparePayResult.status === PreparePayResultType.PaymentPossible, @@ -121,12 +124,12 @@ export async function runPayAbortTest(t: GlobalTestState) { }); await t.assertThrowsOperationErrorAsync(async () => { - await wallet.confirmPay({ + await wallet.client.call(WalletApiOperation.ConfirmPay, { proposalId: preparePayResult.proposalId, }); }); - let txr = await wallet.getTransactions(); + let txr = await wallet.client.call(WalletApiOperation.GetTransactions, {}); console.log(JSON.stringify(txr, undefined, 2)); t.assertDeepEqual(txr.transactions[1].type, "payment"); @@ -136,13 +139,13 @@ export async function runPayAbortTest(t: GlobalTestState) { TalerErrorCode.WALLET_RECEIVED_MALFORMED_RESPONSE, ); - await wallet.abortFailedPayWithRefund({ + await wallet.client.call(WalletApiOperation.AbortFailedPayWithRefund, { proposalId: preparePayResult.proposalId, }); await wallet.runUntilDone(); - txr = await wallet.getTransactions(); + txr = await wallet.client.call(WalletApiOperation.GetTransactions, {}); console.log(JSON.stringify(txr, undefined, 2)); const txTypes = txr.transactions.map((x) => x.type); |