read bic from iban payto
This commit is contained in:
parent
cd6321d303
commit
709ac2349c
@ -37,6 +37,7 @@ export interface PaytoUriIBAN extends PaytoUriGeneric {
|
|||||||
isKnown: true;
|
isKnown: true;
|
||||||
targetType: "iban";
|
targetType: "iban";
|
||||||
iban: string;
|
iban: string;
|
||||||
|
bic?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PaytoUriTalerBank extends PaytoUriGeneric {
|
export interface PaytoUriTalerBank extends PaytoUriGeneric {
|
||||||
@ -134,12 +135,24 @@ export function parsePaytoUri(s: string): PaytoUri | undefined {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (targetType === "iban") {
|
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 {
|
return {
|
||||||
isKnown: true,
|
isKnown: true,
|
||||||
targetPath,
|
targetPath,
|
||||||
targetType,
|
targetType,
|
||||||
params,
|
params,
|
||||||
iban: targetPath,
|
iban,
|
||||||
|
bic,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (targetType === "bitcoin") {
|
if (targetType === "bitcoin") {
|
||||||
|
Loading…
Reference in New Issue
Block a user