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-payment-idempotency.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-payment-idempotency.ts')
-rw-r--r-- | packages/taler-wallet-cli/src/integrationtests/test-payment-idempotency.ts | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-payment-idempotency.ts b/packages/taler-wallet-cli/src/integrationtests/test-payment-idempotency.ts index 061fe511c..58c951b68 100644 --- a/packages/taler-wallet-cli/src/integrationtests/test-payment-idempotency.ts +++ b/packages/taler-wallet-cli/src/integrationtests/test-payment-idempotency.ts @@ -20,6 +20,7 @@ import { GlobalTestState, MerchantPrivateApi } from "./harness"; import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers"; import { PreparePayResultType } from "@gnu-taler/taler-util"; +import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; /** * Test the wallet-core payment API, especially that repeated operations @@ -59,13 +60,19 @@ export async function runPaymentIdempotencyTest(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, + }, + ); - const preparePayResultRep = await wallet.preparePay({ - talerPayUri: orderStatus.taler_pay_uri, - }); + const preparePayResultRep = await wallet.client.call( + WalletApiOperation.PreparePayForUri, + { + talerPayUri: orderStatus.taler_pay_uri, + }, + ); t.assertTrue( preparePayResult.status === PreparePayResultType.PaymentPossible, @@ -76,11 +83,10 @@ export async function runPaymentIdempotencyTest(t: GlobalTestState) { const proposalId = preparePayResult.proposalId; - const r2 = await wallet.apiRequest("confirmPay", { + await wallet.client.call(WalletApiOperation.ConfirmPay, { // FIXME: should be validated, don't cast! proposalId: proposalId, }); - t.assertTrue(r2.type === "response"); // Check if payment was successful. @@ -90,9 +96,12 @@ export async function runPaymentIdempotencyTest(t: GlobalTestState) { t.assertTrue(orderStatus.order_status === "paid"); - const preparePayResultAfter = await wallet.preparePay({ - talerPayUri, - }); + const preparePayResultAfter = await wallet.client.call( + WalletApiOperation.PreparePayForUri, + { + talerPayUri, + }, + ); t.assertTrue( preparePayResultAfter.status === PreparePayResultType.AlreadyConfirmed, |