commit 4aa2da87ca341ee12a7a13a5e37392c0a8432231
parent 16251fffb2c6fc328aa56e26a04cddcf3c98c885
Author: Florian Dold <florian@dold.me>
Date: Tue, 25 Nov 2025 20:55:21 +0100
taler-harness: fix another exchange-unreachable case
Diffstat:
1 file changed, 34 insertions(+), 19 deletions(-)
diff --git a/packages/taler-harness/src/integrationtests/test-kyc-merchant-activate-bank-account.ts b/packages/taler-harness/src/integrationtests/test-kyc-merchant-activate-bank-account.ts
@@ -23,6 +23,7 @@ import {
j2s,
Logger,
MerchantAccountKycRedirectsResponse,
+ MerchantAccountKycStatus,
parsePaytoUri,
succeedOrThrow,
} from "@gnu-taler/taler-util";
@@ -40,26 +41,31 @@ export async function runKycMerchantActivateBankAccountTest(
t: GlobalTestState,
) {
// Set up test environment
- const { merchant, bankClient, bank, wireGatewayApi, merchantAdminAccessToken } =
- await createKycTestkudosEnvironment(t, {
- adjustExchangeConfig(config) {
- config.setString("exchange", "enable_kyc", "yes");
-
- // no kyc deposit requirement, the exchange
- // just need the merchant to prove the that it is the
- // legal owner of the account making a simple
- // wire transfer
- },
- });
+ const {
+ merchant,
+ bankClient,
+ bank,
+ wireGatewayApi,
+ merchantAdminAccessToken,
+ } = await createKycTestkudosEnvironment(t, {
+ adjustExchangeConfig(config) {
+ config.setString("exchange", "enable_kyc", "yes");
+
+ // no kyc deposit requirement, the exchange
+ // just need the merchant to prove the that it is the
+ // legal owner of the account making a simple
+ // wire transfer
+ },
+ });
let accountPub: string;
const headers = {
- Authorization: `Bearer ${merchantAdminAccessToken}`
- }
+ Authorization: `Bearer ${merchantAdminAccessToken}`,
+ };
{
const instanceUrl = new URL("private", merchant.makeInstanceBaseUrl());
- const resp = await harnessHttpLib.fetch(instanceUrl.href, {headers});
+ const resp = await harnessHttpLib.fetch(instanceUrl.href, { headers });
const parsedResp = await readSuccessResponseJsonOrThrow(
resp,
codecForQueryInstancesResponse(),
@@ -73,7 +79,7 @@ export async function runKycMerchantActivateBankAccountTest(
const kycStatusUrl = new URL("private/kyc", merchant.makeInstanceBaseUrl())
.href;
logger.info(`requesting GET ${kycStatusUrl}`);
- const resp = await harnessHttpLib.fetch(kycStatusUrl, {headers});
+ const resp = await harnessHttpLib.fetch(kycStatusUrl, { headers });
if (resp.status === 200) {
kycRespOne = await readSuccessResponseJsonOrThrow(
resp,
@@ -139,16 +145,25 @@ export async function runKycMerchantActivateBankAccountTest(
merchant.makeInstanceBaseUrl(),
);
kycStatusLongpollUrl.searchParams.set("lpt", "1");
- const resp = await harnessHttpLib.fetch(kycStatusLongpollUrl.href, {headers});
+ const resp = await harnessHttpLib.fetch(kycStatusLongpollUrl.href, {
+ headers,
+ });
t.assertDeepEqual(resp.status, 200);
const parsedResp = await readSuccessResponseJsonOrThrow(
resp,
codecForAccountKycRedirects(),
);
logger.info(`kyc resp 2: ${j2s(parsedResp)}`);
- if (parsedResp.kyc_data[0].payto_kycauths == null) {
- kycRespTwo = parsedResp;
- break;
+ if (
+ parsedResp.kyc_data[0].status !==
+ MerchantAccountKycStatus.EXCHANGE_UNREACHABLE
+ ) {
+ if (parsedResp.kyc_data[0].payto_kycauths == null) {
+ kycRespTwo = parsedResp;
+ break;
+ }
+ } else {
+ logger.info(`kyc status is exchange-unreachable`);
}
// Wait 500ms
await delayMs(500);