aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-cli/src/integrationtests/test-paywall-flow.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-06-17 13:34:59 +0200
committerFlorian Dold <florian@dold.me>2021-06-17 13:35:08 +0200
commit5df7ddba97aa4482c781bfe8e87f60c3bc195ae4 (patch)
tree0956d310a83f0fafbb7d5a93001566f9035269a0 /packages/taler-wallet-cli/src/integrationtests/test-paywall-flow.ts
parent0b4976601fe2ecb0462fe72ae188b5cbba06d9cc (diff)
downloadwallet-core-5df7ddba97aa4482c781bfe8e87f60c3bc195ae4.tar.xz
use the new wallet core API interface in all tests
Diffstat (limited to 'packages/taler-wallet-cli/src/integrationtests/test-paywall-flow.ts')
-rw-r--r--packages/taler-wallet-cli/src/integrationtests/test-paywall-flow.ts37
1 files changed, 25 insertions, 12 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/test-paywall-flow.ts b/packages/taler-wallet-cli/src/integrationtests/test-paywall-flow.ts
index 865fd77d1..77e322622 100644
--- a/packages/taler-wallet-cli/src/integrationtests/test-paywall-flow.ts
+++ b/packages/taler-wallet-cli/src/integrationtests/test-paywall-flow.ts
@@ -25,6 +25,7 @@ import {
ConfirmPayResultType,
} from "@gnu-taler/taler-util";
import axios from "axios";
+import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
/**
* Run test for basic, bank-integrated withdrawal.
@@ -90,9 +91,12 @@ export async function runPaywallFlowTest(t: GlobalTestState) {
console.log(pubUnpaidStatus);
- let preparePayResp = await wallet.preparePay({
- talerPayUri: pubUnpaidStatus.taler_pay_uri,
- });
+ let preparePayResp = await wallet.client.call(
+ WalletApiOperation.PreparePayForUri,
+ {
+ talerPayUri: pubUnpaidStatus.taler_pay_uri,
+ },
+ );
t.assertTrue(preparePayResp.status === PreparePayResultType.PaymentPossible);
@@ -112,9 +116,12 @@ export async function runPaywallFlowTest(t: GlobalTestState) {
publicOrderStatusResp.data,
);
- const confirmPayRes = await wallet.confirmPay({
- proposalId: proposalId,
- });
+ const confirmPayRes = await wallet.client.call(
+ WalletApiOperation.ConfirmPay,
+ {
+ proposalId: proposalId,
+ },
+ );
t.assertTrue(confirmPayRes.type === ConfirmPayResultType.Done);
@@ -148,9 +155,12 @@ export async function runPaywallFlowTest(t: GlobalTestState) {
// Pay with new taler://pay URI, which should
// have the new session ID!
// Wallet should now automatically re-play payment.
- preparePayResp = await wallet.preparePay({
- talerPayUri: talerPayUriOne,
- });
+ preparePayResp = await wallet.client.call(
+ WalletApiOperation.PreparePayForUri,
+ {
+ talerPayUri: talerPayUriOne,
+ },
+ );
t.assertTrue(preparePayResp.status === PreparePayResultType.AlreadyConfirmed);
t.assertTrue(preparePayResp.paid);
@@ -185,9 +195,12 @@ export async function runPaywallFlowTest(t: GlobalTestState) {
// Here the re-purchase detection should kick in,
// and the wallet should re-pay for the old order
// under the new session ID (mysession-three).
- preparePayResp = await wallet.preparePay({
- talerPayUri: orderStatus.taler_pay_uri,
- });
+ preparePayResp = await wallet.client.call(
+ WalletApiOperation.PreparePayForUri,
+ {
+ talerPayUri: orderStatus.taler_pay_uri,
+ },
+ );
t.assertTrue(preparePayResp.status === PreparePayResultType.AlreadyConfirmed);
t.assertTrue(preparePayResp.paid);