gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] branch master updated: harness: fix merchant account


From: gnunet
Subject: [taler-wallet-core] branch master updated: harness: fix merchant account creation
Date: Wed, 26 Jun 2024 22:09:20 +0200

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

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

The following commit(s) were added to refs/heads/master by this push:
     new 48c46f144 harness: fix merchant account creation
48c46f144 is described below

commit 48c46f144a6a59aa25c8670536cf116faf546298
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Jun 26 22:09:10 2024 +0200

    harness: fix merchant account creation
    
    Due to a refactoring, the instance bank accounts were only created on
    the default instance
---
 packages/taler-harness/src/index.ts | 41 ++++++++++++++++++++++++-------------
 1 file changed, 27 insertions(+), 14 deletions(-)

diff --git a/packages/taler-harness/src/index.ts 
b/packages/taler-harness/src/index.ts
index c38b0cd08..bdcc72951 100644
--- a/packages/taler-harness/src/index.ts
+++ b/packages/taler-harness/src/index.ts
@@ -1044,7 +1044,10 @@ deploymentCli
   .action(async (args) => {
     const httpLib = createPlatformHttpLib({});
     const baseUrl = args.provisionMerchantInstance.merchantApiBaseUrl;
-    const api = new TalerMerchantManagementHttpClient(baseUrl, httpLib);
+    const managementApi = new TalerMerchantManagementHttpClient(
+      baseUrl,
+      httpLib,
+    );
     const managementToken = createRFC8959AccessTokenEncoded(
       args.provisionMerchantInstance.managementToken,
     );
@@ -1061,7 +1064,7 @@ deploymentCli
     const bankPassword = args.provisionMerchantInstance.bankPassword;
     const accountPayto = args.provisionMerchantInstance.payto as PaytoString;
 
-    const createResp = await api.createInstance(managementToken, {
+    const createResp = await managementApi.createInstance(managementToken, {
       address: {},
       auth: {
         method: "token",
@@ -1088,18 +1091,28 @@ deploymentCli
       process.exit(2);
     }
 
-    const createAccountResp = await api.addBankAccount(instanceTokenEnc, {
-      payto_uri: accountPayto,
-      credit_facade_url: bankURL,
-      credit_facade_credentials:
-        bankUser && bankPassword
-          ? {
-              type: "basic",
-              username: bankUser,
-              password: bankPassword,
-            }
-          : undefined,
-    });
+    const instanceUrl = managementApi.getSubInstanceAPI(instanceId).href;
+
+    const instanceApi = new TalerMerchantInstanceHttpClient(
+      instanceUrl,
+      httpLib,
+    );
+
+    const createAccountResp = await instanceApi.addBankAccount(
+      instanceTokenEnc,
+      {
+        payto_uri: accountPayto,
+        credit_facade_url: bankURL,
+        credit_facade_credentials:
+          bankUser && bankPassword
+            ? {
+                type: "basic",
+                username: bankUser,
+                password: bankPassword,
+              }
+            : undefined,
+      },
+    );
     if (createAccountResp.type != "ok") {
       console.error(
         `unable to configure bank account for instance ${instanceId}, status 
${createAccountResp.case}`,

-- 
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]