gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] 02/02: fixes for test-paywall-flow


From: gnunet
Subject: [taler-wallet-core] 02/02: fixes for test-paywall-flow
Date: Tue, 18 Aug 2020 09:28:11 +0200

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository wallet-core.

commit f6d81037a723ec7f89165811153544c5ec18e2ec
Author: Florian Dold <florian.dold@gmail.com>
AuthorDate: Tue Aug 18 12:58:02 2020 +0530

    fixes for test-paywall-flow
---
 .../src/test-paywall-flow.ts                       | 33 ++++++++++++++++------
 1 file changed, 24 insertions(+), 9 deletions(-)

diff --git a/packages/taler-integrationtests/src/test-paywall-flow.ts 
b/packages/taler-integrationtests/src/test-paywall-flow.ts
index 0671fecb..5214acc4 100644
--- a/packages/taler-integrationtests/src/test-paywall-flow.ts
+++ b/packages/taler-integrationtests/src/test-paywall-flow.ts
@@ -82,14 +82,14 @@ runTest(async (t: GlobalTestState) => {
     );
   }
 
-  let pubUnpaidStatusResp = codecForMerchantOrderStatusUnpaid().decode(
+  let pubUnpaidStatus = codecForMerchantOrderStatusUnpaid().decode(
     publicOrderStatusResp.data,
   );
 
-  console.log(pubUnpaidStatusResp);
+  console.log(pubUnpaidStatus);
 
   let preparePayResp = await wallet.preparePay({
-    talerPayUri: pubUnpaidStatusResp.taler_pay_uri,
+    talerPayUri: pubUnpaidStatus.taler_pay_uri,
   });
 
   t.assertTrue(preparePayResp.status === PreparePayResultType.PaymentPossible);
@@ -106,7 +106,7 @@ runTest(async (t: GlobalTestState) => {
     );
   }
 
-  let pubUnpaidStatus = codecForMerchantOrderStatusUnpaid().decode(
+  pubUnpaidStatus = codecForMerchantOrderStatusUnpaid().decode(
     publicOrderStatusResp.data,
   );
 
@@ -120,10 +120,12 @@ runTest(async (t: GlobalTestState) => {
     validateStatus: () => true,
   });
 
-  if (publicOrderStatusResp.status != 410) {
+  console.log(publicOrderStatusResp.data);
+
+  if (publicOrderStatusResp.status != 202) {
     console.log(publicOrderStatusResp.data);
     throw Error(
-      `expected status 410 (after paying), but got 
${publicOrderStatusResp.status}`,
+      `expected status 202 (after paying), but got 
${publicOrderStatusResp.status}`,
     );
   }
 
@@ -190,6 +192,17 @@ runTest(async (t: GlobalTestState) => {
   t.assertTrue(preparePayResp.status === 
PreparePayResultType.AlreadyConfirmed);
   t.assertTrue(preparePayResp.paid);
 
+  // The first order should now be paid under "mysession-three",
+  // as the wallet did re-purchase detection
+  orderStatus = await merchant.queryPrivateOrderStatus({
+    orderId: firstOrderId,
+    sessionId: "mysession-three",
+  });
+
+  t.assertTrue(orderStatus.order_status === "paid");
+
+  // Now check if the public status of the new order is correct.
+
   console.log("requesting public status", publicOrderStatusUrl);
 
   // Ask the order status of the claimed-but-unpaid order
@@ -197,9 +210,9 @@ runTest(async (t: GlobalTestState) => {
     validateStatus: () => true,
   });
 
-  if (publicOrderStatusResp.status != 403) {
+  if (publicOrderStatusResp.status != 402) {
     throw Error(
-      `expected status 403, but got ${publicOrderStatusResp.status}`,
+      `expected status 402, but got ${publicOrderStatusResp.status}`,
     );
   }
 
@@ -207,5 +220,7 @@ runTest(async (t: GlobalTestState) => {
     publicOrderStatusResp.data,
   );
 
-  t.assertTrue(pubUnpaidStatusResp.already_paid_order_id === firstOrderId);
+  console.log(publicOrderStatusResp.data);
+
+  t.assertTrue(pubUnpaidStatus.already_paid_order_id === firstOrderId);
 });

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]