aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-06-03 12:03:48 -0300
committerSebastian <sebasjm@gmail.com>2024-06-03 12:12:23 -0300
commit1beb305d231e8e5632d1d3e2072c39bb74049924 (patch)
tree763720b1cdf2be015a09f550697f4edfa7aef2db /packages
parentfda35976e44b8dad3249124cd3a8cd8e0f723020 (diff)
downloadwallet-core-1beb305d231e8e5632d1d3e2072c39bb74049924.tar.xz
account letter
Diffstat (limited to 'packages')
-rw-r--r--packages/taler-util/src/payto.ts20
1 files changed, 19 insertions, 1 deletions
diff --git a/packages/taler-util/src/payto.ts b/packages/taler-util/src/payto.ts
index a471d0b87..39c25cffd 100644
--- a/packages/taler-util/src/payto.ts
+++ b/packages/taler-util/src/payto.ts
@@ -15,7 +15,7 @@
*/
import { generateFakeSegwitAddress } from "./bitcoin.js";
-import { Codec, Context, DecodingError, renderContext } from "./codec.js";
+import { Codec, Context, DecodingError, buildCodecForObject, codecForStringURL, renderContext } from "./codec.js";
import { URLSearchParams } from "./url.js";
export type PaytoUri =
@@ -291,3 +291,21 @@ export function talerPaytoFromExchangeReserve(
return `payto://${proto}/${url.host}${url.pathname}${reservePub}`;
}
+
+/**
+ * The account letter is all the information
+ * the merchant backend requires from the
+ * bank account to check transfer.
+ *
+ */
+export type AccountLetter = {
+ accountURI: PaytoString;
+ infoURL: string;
+};
+
+export const codecForAccountLetter =
+ (): Codec<AccountLetter> =>
+ buildCodecForObject<AccountLetter>()
+ .property("infoURL", codecForStringURL(true))
+ .property("accountURI", codecForPaytoString())
+ .build("AccountLetter");