diff options
author | Sebastian <sebasjm@gmail.com> | 2023-09-29 14:46:13 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-09-29 14:46:29 -0300 |
commit | 779ddae8b8c0e1b544ee370ac4d4b366333e7197 (patch) | |
tree | 3d7794986cf94a9cce934d18ee2d596f580e2912 /packages/taler-util/src | |
parent | 552155c82616bc7d6148738f01c3f9a2d47e8e4d (diff) | |
download | wallet-core-779ddae8b8c0e1b544ee370ac4d4b366333e7197.tar.xz |
iban country code should be always uppercased
Diffstat (limited to 'packages/taler-util/src')
-rw-r--r-- | packages/taler-util/src/payto.ts | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/packages/taler-util/src/payto.ts b/packages/taler-util/src/payto.ts index 60c4ba838..85870afcd 100644 --- a/packages/taler-util/src/payto.ts +++ b/packages/taler-util/src/payto.ts @@ -89,12 +89,13 @@ export function buildPayto( return result; } case "iban": { + const uppercased = first.toUpperCase() const result: PaytoUriIBAN = { isKnown: true, targetType: "iban", - iban: first, + iban: uppercased, params: {}, - targetPath: !second ? first : `${second}/${first}`, + targetPath: !second ? uppercased : `${second}/${uppercased}`, }; return result; } @@ -200,13 +201,13 @@ export function parsePaytoUri(s: string): PaytoUri | undefined { let iban: string | undefined = undefined; let bic: string | undefined = undefined; if (parts.length === 1) { - iban = parts[0]; + iban = parts[0].toUpperCase(); } if (parts.length === 2) { bic = parts[0]; - iban = parts[1]; + iban = parts[1].toUpperCase(); } else { - iban = targetPath; + iban = targetPath.toUpperCase(); } return { isKnown: true, |