From 70d0199572ee6a95c68dd0b960d80e4ae93c4b0a Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 25 Aug 2022 23:35:29 +0200 Subject: integration tests: various fixes --- .../taler-wallet-core/src/operations/testing.ts | 27 +++++++++++++--------- .../taler-wallet-core/src/operations/withdraw.ts | 3 +++ 2 files changed, 19 insertions(+), 11 deletions(-) (limited to 'packages/taler-wallet-core/src/operations') diff --git a/packages/taler-wallet-core/src/operations/testing.ts b/packages/taler-wallet-core/src/operations/testing.ts index 8d28c62f7..a5aa1106f 100644 --- a/packages/taler-wallet-core/src/operations/testing.ts +++ b/packages/taler-wallet-core/src/operations/testing.ts @@ -90,16 +90,21 @@ export async function withdrawTestBalance( ws: InternalWalletState, req: WithdrawTestBalanceRequest, ): Promise { - const bankBaseUrl = req.bankBaseUrl; const amount = req.amount; const exchangeBaseUrl = req.exchangeBaseUrl; - const bankUser = await registerRandomBankUser(ws.http, bankBaseUrl); + logger.trace( + `Registered bank user, bank access base url ${req.bankAccessApiBaseUrl}`, + ); + const bankUser = await registerRandomBankUser( + ws.http, + req.bankAccessApiBaseUrl, + ); logger.trace(`Registered bank user ${JSON.stringify(bankUser)}`); const wresp = await createDemoBankWithdrawalUri( ws.http, - bankBaseUrl, + req.bankAccessApiBaseUrl, bankUser, amount, ); @@ -112,7 +117,7 @@ export async function withdrawTestBalance( await confirmBankWithdrawalUri( ws.http, - bankBaseUrl, + req.bankAccessApiBaseUrl, bankUser, wresp.withdrawal_id, ); @@ -133,13 +138,13 @@ function getMerchantAuthHeader(m: MerchantBackendInfo): Record { */ export async function createDemoBankWithdrawalUri( http: HttpRequestLibrary, - bankBaseUrl: string, + bankAccessApiBaseUrl: string, bankUser: BankUser, amount: AmountString, ): Promise { const reqUrl = new URL( `accounts/${bankUser.username}/withdrawals`, - bankBaseUrl, + bankAccessApiBaseUrl, ).href; const resp = await http.postJson( reqUrl, @@ -161,13 +166,13 @@ export async function createDemoBankWithdrawalUri( async function confirmBankWithdrawalUri( http: HttpRequestLibrary, - bankBaseUrl: string, + bankAccessApiBaseUrl: string, bankUser: BankUser, withdrawalId: string, ): Promise { const reqUrl = new URL( `accounts/${bankUser.username}/withdrawals/${withdrawalId}/confirm`, - bankBaseUrl, + bankAccessApiBaseUrl, ).href; const resp = await http.postJson( reqUrl, @@ -187,9 +192,9 @@ async function confirmBankWithdrawalUri( async function registerRandomBankUser( http: HttpRequestLibrary, - bankBaseUrl: string, + bankAccessApiBaseUrl: string, ): Promise { - const reqUrl = new URL("testing/register", bankBaseUrl).href; + const reqUrl = new URL("testing/register", bankAccessApiBaseUrl).href; const randId = makeId(8); const bankUser: BankUser = { // euFin doesn't allow resource names to have upper case letters. @@ -377,7 +382,7 @@ export async function runIntegrationTest( await withdrawTestBalance(ws, { amount: Amounts.stringify(withdrawAmountTwo), bankBaseUrl: args.bankBaseUrl, - bankAccessApiBaseUrl: args.bankBaseUrl, + bankAccessApiBaseUrl: args.bankAccessApiBaseUrl, exchangeBaseUrl: args.exchangeBaseUrl, }); diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index 03ec9b61b..a33f59162 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -376,6 +376,9 @@ export async function getBankWithdrawalInfo( `withdrawal-operation/${uriResult.withdrawalOperationId}`, uriResult.bankIntegrationApiBaseUrl, ); + + logger.info(`bank withdrawal status URL: ${reqUrl.href}}`); + const resp = await http.get(reqUrl.href); const status = await readSuccessResponseJsonOrThrow( resp, -- cgit v1.2.3