gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] 01/02: read bic from iban payto


From: gnunet
Subject: [taler-wallet-core] 01/02: read bic from iban payto
Date: Fri, 04 Nov 2022 19:58:51 +0100

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

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

commit 709ac2349c2b5a73377f8a33669d6349aede1787
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Fri Nov 4 15:58:10 2022 -0300

    read bic from iban payto
---
 packages/taler-util/src/payto.ts | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/packages/taler-util/src/payto.ts b/packages/taler-util/src/payto.ts
index b474e533c..3073b991c 100644
--- a/packages/taler-util/src/payto.ts
+++ b/packages/taler-util/src/payto.ts
@@ -37,6 +37,7 @@ export interface PaytoUriIBAN extends PaytoUriGeneric {
   isKnown: true;
   targetType: "iban";
   iban: string;
+  bic?: string;
 }
 
 export interface PaytoUriTalerBank extends PaytoUriGeneric {
@@ -134,12 +135,24 @@ export function parsePaytoUri(s: string): PaytoUri | 
undefined {
     };
   }
   if (targetType === "iban") {
+    const parts = targetPath.split("/");
+    let iban: string | undefined = undefined;
+    let bic: string | undefined = undefined;
+    if (parts.length === 1) {
+      iban = parts[0]
+    } if (parts.length === 2) {
+      bic = parts[0]
+      iban = parts[1]
+    } else {
+      iban = targetPath
+    }
     return {
       isKnown: true,
       targetPath,
       targetType,
       params,
-      iban: targetPath,
+      iban,
+      bic,
     };
   }
   if (targetType === "bitcoin") {

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