gnunet-svn
[Top][All Lists]
Advanced

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

[libeufin] branch master updated (340506a -> 57f6f57)


From: gnunet
Subject: [libeufin] branch master updated (340506a -> 57f6f57)
Date: Thu, 02 Jul 2020 18:33:57 +0200

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

heng-yeow pushed a change to branch master
in repository libeufin.

    from 340506a  more ISO parsing/schema work
     new 089b2fd  Improve error handling when adding bank connections
     new 57f6f57  Update start script to import one bank account by default and 
submit one prepare payment

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../bank-accounts/AddBankConnectionDrawer.tsx      | 42 ++++++++++++-----
 integration-tests/start-testenv.py                 | 55 +++++++++++++---------
 2 files changed, 65 insertions(+), 32 deletions(-)

diff --git a/frontend/src/components/bank-accounts/AddBankConnectionDrawer.tsx 
b/frontend/src/components/bank-accounts/AddBankConnectionDrawer.tsx
index 57b85cc..6978192 100644
--- a/frontend/src/components/bank-accounts/AddBankConnectionDrawer.tsx
+++ b/frontend/src/components/bank-accounts/AddBankConnectionDrawer.tsx
@@ -1,5 +1,5 @@
 import React, { useState } from 'react';
-import { Button, Drawer, Input, Form, Steps } from 'antd';
+import { message, Button, Drawer, Input, Form, Steps } from 'antd';
 const { Step } = Steps;
 
 const layout = {
@@ -20,6 +20,10 @@ const AddBankConnectionDrawer = (props) => {
 
   const steps = [{ title: 'Fill up details' }, { title: 'Print document' }];
 
+  const showError = (err) => {
+    message.error(String(err));
+  };
+
   const createBankConnection = async () => {
     const authHeader = await window.localStorage.getItem('authHeader');
     await fetch(`/bank-connections`, {
@@ -109,17 +113,33 @@ const AddBankConnectionDrawer = (props) => {
   };
 
   const next = async () => {
-    await createBankConnection();
-    await connectBankConnection();
-    await fetchKeyLetter();
-    await updateBankAccounts();
+    let isError = true;
+    await createBankConnection()
+      .then(async () => {
+        await connectBankConnection()
+          .then(async () => {
+            await fetchKeyLetter()
+              .then(async () => {
+                await updateBankAccounts()
+                  .then(() => {
+                    isError = false;
+                  })
+                  .catch((err) => showError(err));
+              })
+              .catch((err) => showError(err));
+          })
+          .catch((err) => showError(err));
+      })
+      .catch((err) => showError(err));
 
-    setServerURL('');
-    setHostID('');
-    setPartnerID('');
-    setUserID('');
-    setSystemID('');
-    setCurrentStep(currentStep + 1);
+    if (!isError) {
+      setServerURL('');
+      setHostID('');
+      setPartnerID('');
+      setUserID('');
+      setSystemID('');
+      setCurrentStep(currentStep + 1);
+    }
   };
 
   const closeDrawer = () => {
diff --git a/integration-tests/start-testenv.py 
b/integration-tests/start-testenv.py
index 386a63b..bfde5ba 100755
--- a/integration-tests/start-testenv.py
+++ b/integration-tests/start-testenv.py
@@ -367,6 +367,19 @@ assertResponse(
         headers=dict(Authorization=USER_AUTHORIZATION_HEADER),
     )
 )
+
+# 2.d, import bank account
+assertResponse(
+    post(
+        "http://localhost:5001/bank-connections/my-ebics-1/import-account";,
+        json=dict(
+          offeredAccountId=BC1_SUBSCRIBER1_BANK_ACCOUNT_LABEL,
+          nexusBankAccountId=BC1_SUBSCRIBER1_BANK_ACCOUNT_LABEL
+        ),
+        headers=dict(Authorization=USER_AUTHORIZATION_HEADER),
+    )
+)
+
 # assertResponse(
 #     post(
 #         "http://localhost:5001/bank-connections/my-ebics-3/import-accounts";,
@@ -382,7 +395,7 @@ assertResponse(
 #     )
 # )
 
-# # 3, ask nexus to download history
+# 3, ask nexus to download history
 # assertResponse(
 #     post(
 #         
f"http://localhost:5001/bank-accounts/{BC1_SUBSCRIBER1_BANK_ACCOUNT_LABEL}/fetch-transactions";,
@@ -390,7 +403,7 @@ assertResponse(
 #     )
 # )
 
-# # 4, make sure history is empty
+# 4, make sure history is empty
 # resp = assertResponse(
 #     get(
 #         
f"http://localhost:5001/bank-accounts/{BC1_SUBSCRIBER1_BANK_ACCOUNT_LABEL}/transactions";,
@@ -400,25 +413,25 @@ assertResponse(
 # if len(resp.json().get("transactions")) != 0:
 #     fail("unexpected number of transactions")
 
-# # 5.a, prepare a payment
-# resp = assertResponse(
-#     post(
-#         "http://localhost:5001/bank-accounts/{}/payment-initiations".format(
-#             BC1_SUBSCRIBER1_BANK_ACCOUNT_LABEL
-#         ),
-#         json=dict(
-#             iban="FR7630006000011234567890189",
-#             bic="AGRIFRPP",
-#             name="Jacques La Fayette",
-#             subject="integration test",
-#             amount="EUR:1",
-#         ),
-#         headers=dict(Authorization=USER_AUTHORIZATION_HEADER),
-#     )
-# )
-# PREPARED_PAYMENT_UUID = resp.json().get("uuid")
-# if PREPARED_PAYMENT_UUID == None:
-#     fail("Payment UUID not received")
+# 5.a, prepare a payment
+resp = assertResponse(
+    post(
+        "http://localhost:5001/bank-accounts/{}/payment-initiations".format(
+            BC1_SUBSCRIBER1_BANK_ACCOUNT_LABEL
+        ),
+        json=dict(
+            iban="FR7630006000011234567890189",
+            bic="AGRIFRPP",
+            name="Jacques La Fayette",
+            subject="integration test",
+            amount="EUR:1",
+        ),
+        headers=dict(Authorization=USER_AUTHORIZATION_HEADER),
+    )
+)
+PREPARED_PAYMENT_UUID = resp.json().get("uuid")
+if PREPARED_PAYMENT_UUID == None:
+    fail("Payment UUID not received")
 
 # # 5.b, submit prepared statement
 # assertResponse(

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