[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: Finalizing loop's cause repro
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: Finalizing loop's cause reproduction. |
Date: |
Fri, 25 Sep 2020 16:50:55 +0200 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new 2c0464b4 Finalizing loop's cause reproduction.
2c0464b4 is described below
commit 2c0464b49479d62b58968a5e28c890555456807b
Author: MS <ms@taler.net>
AuthorDate: Fri Sep 25 16:50:26 2020 +0200
Finalizing loop's cause reproduction.
---
.../taler-integrationtests/src/merchantApiTypes.ts | 5 ++-
.../taler-integrationtests/src/test-claim-loop.ts | 38 +++++++++++-----------
2 files changed, 23 insertions(+), 20 deletions(-)
diff --git a/packages/taler-integrationtests/src/merchantApiTypes.ts
b/packages/taler-integrationtests/src/merchantApiTypes.ts
index e89e3264..1806ab70 100644
--- a/packages/taler-integrationtests/src/merchantApiTypes.ts
+++ b/packages/taler-integrationtests/src/merchantApiTypes.ts
@@ -82,6 +82,7 @@ export const codecForCheckPaymentPaidResponse = (): Codec<
CheckPaymentPaidResponse
> =>
buildCodecForObject<CheckPaymentPaidResponse>()
+ .property("order_status_url", codecForConstString("paid"))
.property("order_status", codecForConstString("paid"))
.property("refunded", codecForBoolean())
.property("wired", codecForBoolean())
@@ -159,6 +160,8 @@ export interface CheckPaymentPaidResponse {
// The refund details for this order. One entry per
// refunded coin; empty array if there are no refunds.
refund_details: RefundDetails[];
+
+ order_status_url: string;
}
export interface CheckPaymentUnpaidResponse {
@@ -282,4 +285,4 @@ export interface TipCreateRequest {
// URL that the user should be directed to after tipping,
// will be included in the tip_token.
next_url: string;
-}
\ No newline at end of file
+}
diff --git a/packages/taler-integrationtests/src/test-claim-loop.ts
b/packages/taler-integrationtests/src/test-claim-loop.ts
index ead0076d..fdc87ba0 100644
--- a/packages/taler-integrationtests/src/test-claim-loop.ts
+++ b/packages/taler-integrationtests/src/test-claim-loop.ts
@@ -25,6 +25,7 @@ import {
} from "./harness";
import { createSimpleTestkudosEnvironment, withdrawViaBank } from "./helpers";
import { PreparePayResultType, TalerErrorCode } from "taler-wallet-core";
+import { URL } from "url"
/**
* Run test for basic, bank-integrated withdrawal.
@@ -42,38 +43,37 @@ runTest(async (t: GlobalTestState) => {
await withdrawViaBank(t, { wallet, bank, exchange, amount: "TESTKUDOS:20" });
// Set up order.
-
const orderResp = await MerchantPrivateApi.createOrder(merchant, "default", {
order: {
summary: "Buy me!",
amount: "TESTKUDOS:5",
fulfillment_url: "taler://fulfillment-success/thx",
- },
+ }
});
-
- let orderStatus = await MerchantPrivateApi.queryPrivateOrderStatus(merchant,
{
+
+ // Query private order status before claiming it.
+ let orderStatusBefore = await
MerchantPrivateApi.queryPrivateOrderStatus(merchant, {
orderId: orderResp.order_id,
});
+ let statusUrlBefore = new URL(orderStatusBefore.order_status_url);
- // orderStatus has a "order_status_url" value _with_
- // a 'token' URI parameter.
-
- t.assertTrue(orderStatus.order_status === "unpaid");
-
- const talerPayUri = orderStatus.taler_pay_uri;
-
- // Make wallet claim the order.
-
- const preparePayResult = await wallet.preparePay({
- talerPayUri,
+ // Make wallet claim the unpaid order.
+ t.assertTrue(orderStatusBefore.order_status === "unpaid");
+ const talerPayUri = orderStatusBefore.taler_pay_uri;
+ const y = await wallet.preparePay({
+ talerPayUri
});
- let orderStatusAgain = await
MerchantPrivateApi.queryPrivateOrderStatus(merchant, {
+ // Query private order status after claiming it.
+ let orderStatusAfter = await
MerchantPrivateApi.queryPrivateOrderStatus(merchant, {
orderId: orderResp.order_id,
});
-
- // orderStatusAgain has a "order_status_url" value
- // _without_ a 'token' URI parameter.
+ let statusUrlAfter = new URL(orderStatusAfter.order_status_url)
+
+ let tokenBefore = statusUrlBefore.searchParams.get("token")
+ let tokenAfter = statusUrlAfter.searchParams.get("token")
+
+ t.assertTrue(tokenBefore === tokenAfter)
await t.shutdown();
});
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: Finalizing loop's cause reproduction.,
gnunet <=