[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] 01/06: use URL api to stringify payto://
From: |
gnunet |
Subject: |
[taler-wallet-core] 01/06: use URL api to stringify payto:// |
Date: |
Tue, 17 Jan 2023 20:01:38 +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 3cde52effc5bc1ec82285b52938bc024083c3278
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Mon Jan 16 19:34:44 2023 -0300
use URL api to stringify payto://
---
packages/taler-util/src/payto.ts | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/packages/taler-util/src/payto.ts b/packages/taler-util/src/payto.ts
index 8eb0b88a8..1ac081a76 100644
--- a/packages/taler-util/src/payto.ts
+++ b/packages/taler-util/src/payto.ts
@@ -81,13 +81,12 @@ export function addPaytoQueryParams(
* @returns
*/
export function stringifyPaytoUri(p: PaytoUri): string {
- const url = `${paytoPfx}${p.targetType}/${p.targetPath}`;
+ const url = new URL(`${paytoPfx}${p.targetType}/${p.targetPath}`);
const paramList = !p.params ? [] : Object.entries(p.params);
- if (paramList.length > 0) {
- const search = paramList.map(([key, value]) =>
`${key}=${value}`).join("&");
- return `${url}?${search}`;
- }
- return url;
+ paramList.forEach(([key, value]) => {
+ url.searchParams.set(key, value)
+ })
+ return url.href;
}
/**
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-wallet-core] branch master updated (99d7cbae0 -> 420493b3e), gnunet, 2023/01/17
- [taler-wallet-core] 02/06: payto URI builder, gnunet, 2023/01/17
- [taler-wallet-core] 03/06: stronger type check to be sure that ErrorDetails is consistent, gnunet, 2023/01/17
- [taler-wallet-core] 06/06: use payto builder and prevent showing cancel for non-payment, gnunet, 2023/01/17
- [taler-wallet-core] 01/06: use URL api to stringify payto://,
gnunet <=
- [taler-wallet-core] 04/06: re-use the same kyc function from withdrawal for deposits, gnunet, 2023/01/17
- [taler-wallet-core] 05/06: throw error after 5 seconds if wallet-core didn't reply to a command, gnunet, 2023/01/17