@genesis-tech/genesispay-seller 0.13.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/CHANGELOG.md +206 -0
  2. package/README.md +670 -91
  3. package/dist/checkout-documents.d.ts +99 -0
  4. package/dist/checkout-documents.d.ts.map +1 -0
  5. package/dist/checkout-documents.js +155 -0
  6. package/dist/checkout-documents.js.map +1 -0
  7. package/dist/checkout-return.d.ts +41 -0
  8. package/dist/checkout-return.d.ts.map +1 -0
  9. package/dist/checkout-return.js +68 -0
  10. package/dist/checkout-return.js.map +1 -0
  11. package/dist/client.d.ts +318 -0
  12. package/dist/client.d.ts.map +1 -0
  13. package/dist/client.js +718 -0
  14. package/dist/client.js.map +1 -0
  15. package/dist/contract-mandates.d.ts +39 -0
  16. package/dist/contract-mandates.d.ts.map +1 -0
  17. package/dist/contract-mandates.js +98 -0
  18. package/dist/contract-mandates.js.map +1 -0
  19. package/dist/contract-usage.d.ts +29 -0
  20. package/dist/contract-usage.d.ts.map +1 -0
  21. package/dist/contract-usage.js +92 -0
  22. package/dist/contract-usage.js.map +1 -0
  23. package/dist/customers.d.ts +41 -0
  24. package/dist/customers.d.ts.map +1 -0
  25. package/dist/customers.js +76 -0
  26. package/dist/customers.js.map +1 -0
  27. package/dist/entitlements.d.ts +19 -0
  28. package/dist/entitlements.d.ts.map +1 -0
  29. package/dist/entitlements.js +30 -0
  30. package/dist/entitlements.js.map +1 -0
  31. package/dist/errors.d.ts +129 -0
  32. package/dist/errors.d.ts.map +1 -0
  33. package/dist/errors.js +273 -0
  34. package/dist/errors.js.map +1 -0
  35. package/dist/fulfillment-attempts.d.ts +29 -0
  36. package/dist/fulfillment-attempts.d.ts.map +1 -0
  37. package/dist/fulfillment-attempts.js +71 -0
  38. package/dist/fulfillment-attempts.js.map +1 -0
  39. package/dist/fulfillment.d.ts +152 -0
  40. package/dist/fulfillment.d.ts.map +1 -0
  41. package/dist/fulfillment.js +810 -0
  42. package/dist/fulfillment.js.map +1 -0
  43. package/dist/genesispay-settlement.d.ts +32 -0
  44. package/dist/genesispay-settlement.d.ts.map +1 -0
  45. package/dist/genesispay-settlement.js +500 -0
  46. package/dist/genesispay-settlement.js.map +1 -0
  47. package/dist/index.d.ts +22 -0
  48. package/dist/index.d.ts.map +1 -0
  49. package/dist/index.js +21 -0
  50. package/dist/index.js.map +1 -0
  51. package/dist/invoices.d.ts +111 -0
  52. package/dist/invoices.d.ts.map +1 -0
  53. package/dist/invoices.js +192 -0
  54. package/dist/invoices.js.map +1 -0
  55. package/dist/item-tax.d.ts +15 -0
  56. package/dist/item-tax.d.ts.map +1 -0
  57. package/dist/item-tax.js +19 -0
  58. package/dist/item-tax.js.map +1 -0
  59. package/dist/mandate-gate.d.ts +54 -0
  60. package/dist/mandate-gate.d.ts.map +1 -0
  61. package/dist/mandate-gate.js +183 -0
  62. package/dist/mandate-gate.js.map +1 -0
  63. package/dist/mandates.d.ts +189 -0
  64. package/dist/mandates.d.ts.map +1 -0
  65. package/dist/mandates.js +234 -0
  66. package/dist/mandates.js.map +1 -0
  67. package/dist/networks.d.ts +10 -0
  68. package/dist/networks.d.ts.map +1 -0
  69. package/dist/networks.js +23 -0
  70. package/dist/networks.js.map +1 -0
  71. package/dist/payment-gate.d.ts +98 -0
  72. package/dist/payment-gate.d.ts.map +1 -0
  73. package/dist/payment-gate.js +370 -0
  74. package/dist/payment-gate.js.map +1 -0
  75. package/dist/plans.d.ts +68 -0
  76. package/dist/plans.d.ts.map +1 -0
  77. package/dist/plans.js +127 -0
  78. package/dist/plans.js.map +1 -0
  79. package/dist/products.d.ts +170 -0
  80. package/dist/products.d.ts.map +1 -0
  81. package/dist/products.js +1317 -0
  82. package/dist/products.js.map +1 -0
  83. package/dist/resource.d.ts +47 -0
  84. package/dist/resource.d.ts.map +1 -0
  85. package/dist/resource.js +71 -0
  86. package/dist/resource.js.map +1 -0
  87. package/dist/strict-response.d.ts +21 -0
  88. package/dist/strict-response.d.ts.map +1 -0
  89. package/dist/strict-response.js +68 -0
  90. package/dist/strict-response.js.map +1 -0
  91. package/dist/usdc-amount.d.ts +7 -0
  92. package/dist/usdc-amount.d.ts.map +1 -0
  93. package/dist/usdc-amount.js +21 -0
  94. package/dist/usdc-amount.js.map +1 -0
  95. package/dist/webhooks.d.ts +352 -0
  96. package/dist/webhooks.d.ts.map +1 -0
  97. package/dist/webhooks.js +244 -0
  98. package/dist/webhooks.js.map +1 -0
  99. package/package.json +4 -3
@@ -0,0 +1,99 @@
1
+ import { type ItemTax } from "./item-tax.js";
2
+ import { type GenesisPayRequest } from "./resource.js";
3
+ export type CheckoutDocumentKind = "invoice" | "enhanced_receipt";
4
+ /** The commercial snapshot frozen before the buyer signs the hosted checkout. */
5
+ export type CheckoutDocumentSnapshot = {
6
+ version: number;
7
+ seller: {
8
+ userId: string;
9
+ legalName: string;
10
+ email: string | null;
11
+ addressLine1: string | null;
12
+ addressLine2: string | null;
13
+ city: string | null;
14
+ postalCode: string | null;
15
+ countryCode: string | null;
16
+ taxId: string | null;
17
+ profileVersion?: number;
18
+ taxRegistration?: CheckoutTaxRegistration;
19
+ };
20
+ buyer: {
21
+ legalName: string;
22
+ companyName: string | null;
23
+ addressLine1: string;
24
+ addressLine2: string | null;
25
+ city: string;
26
+ region: string | null;
27
+ postalCode: string;
28
+ countryCode: string;
29
+ taxId: string | null;
30
+ email: string;
31
+ };
32
+ lineItem: {
33
+ description: string;
34
+ };
35
+ lines?: Array<{
36
+ description: string;
37
+ quantity: number;
38
+ unitAmountMinor: string;
39
+ subtotalMinor: string;
40
+ discountMinor: string;
41
+ taxMinor: string;
42
+ totalMinor: string;
43
+ taxConfig: ItemTax;
44
+ }>;
45
+ invoice: {
46
+ prefix: string;
47
+ pricesIncludeTax: true;
48
+ };
49
+ tax: {
50
+ source: "seller_configured" | null;
51
+ status: "receipt_required" | "calculated";
52
+ reason: string | null;
53
+ taxRateBps: number | null;
54
+ zeroTaxNote: string | null;
55
+ rounding: "half_up_asset_minor_unit" | null;
56
+ settingsUpdatedAt: string | null;
57
+ itemConfig?: ItemTax;
58
+ };
59
+ };
60
+ export type CheckoutTaxRegistration = {
61
+ status: "not_registered";
62
+ reason: string;
63
+ } | {
64
+ status: "registered";
65
+ registrations: Array<{
66
+ type: "vat" | "gst" | "tax_id" | "business_number";
67
+ countryCode: string;
68
+ value: string;
69
+ }>;
70
+ };
71
+ /** A formal invoice or enhanced receipt issued for a hosted human checkout. */
72
+ export type CheckoutDocument = {
73
+ id: string;
74
+ publicId: string;
75
+ kind: CheckoutDocumentKind;
76
+ /** Present only when the seller's tax configuration supported a formal invoice. */
77
+ invoiceNumber: string | null;
78
+ asset: "USDC" | "EURC";
79
+ chainId: number;
80
+ subtotalMinor: string;
81
+ discountMinor: string;
82
+ taxMinor: string;
83
+ totalMinor: string;
84
+ txHash: string | null;
85
+ confirmedAt: string;
86
+ issuedAt: string;
87
+ retainUntil: string;
88
+ recipientEmail: string;
89
+ snapshot: CheckoutDocumentSnapshot;
90
+ };
91
+ export interface CheckoutDocumentsResource {
92
+ /** Lists the latest 100 immutable documents from hosted human checkout. */
93
+ list(): Promise<CheckoutDocument[]>;
94
+ /** Retrieves one seller-owned document by its public `doc_…` id. */
95
+ get(publicId: string): Promise<CheckoutDocument>;
96
+ }
97
+ export declare function createCheckoutDocumentsResource(request: GenesisPayRequest): CheckoutDocumentsResource;
98
+ export declare function toCheckoutDocument(raw: Record<string, unknown>): CheckoutDocument;
99
+ //# sourceMappingURL=checkout-documents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkout-documents.d.ts","sourceRoot":"","sources":["../src/checkout-documents.ts"],"names":[],"mappings":"AAOA,OAAO,EAAgB,KAAK,OAAO,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EAOL,KAAK,iBAAiB,EACvB,MAAM,eAAe,CAAC;AAEvB,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,kBAAkB,CAAC;A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AM,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,wBAAwB,CAAC;CACpC,CAAC;AAEF,MAAM,WAAW,yBAAyB;IACxC,2EAA2E;IAC3E,IAAI,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACpC,oEAAoE;IACpE,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAClD;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,iBAAiB,GACzB,yBAAyB,CAmC3B;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,gBAAgB,CAmBjF"}
@@ -0,0 +1,155 @@
1
+ // `genesispay.checkoutDocuments.*` — documents created after hosted human checkout.
2
+ //
3
+ // These are intentionally read-only. They are not the seller-authored invoice
4
+ // lifecycle (`genesispay.invoices.*`): a hosted checkout document is produced
5
+ // only after a confirmed, non-simulated payment and is immutable thereafter.
6
+ import { GenesisPayConfigError } from "./errors.js";
7
+ import { parseItemTax } from "./item-tax.js";
8
+ import { asRecord, oneOf, optionalString, requiredString, toAmountString, toCount, } from "./resource.js";
9
+ export function createCheckoutDocumentsResource(request) {
10
+ return {
11
+ list: async () => {
12
+ const body = await request({
13
+ path: "/api/v1/checkout-documents",
14
+ operation: "GET /api/v1/checkout-documents",
15
+ action: "list hosted checkout documents",
16
+ });
17
+ const rows = asRecord(body)?.documents;
18
+ if (!Array.isArray(rows)) {
19
+ throw new GenesisPayConfigError(`GenesisPay GET /api/v1/checkout-documents returned no documents array: ${JSON.stringify(body)}`);
20
+ }
21
+ return rows
22
+ .map(asRecord)
23
+ .filter((row) => Boolean(row?.publicId))
24
+ .map(toCheckoutDocument);
25
+ },
26
+ get: async (publicId) => {
27
+ const body = await request({
28
+ path: `/api/v1/checkout-documents/${encodeURIComponent(publicId)}`,
29
+ operation: "GET /api/v1/checkout-documents/:publicId",
30
+ notFoundMessage: `Checkout document ${publicId} was not found.`,
31
+ action: "retrieve a hosted checkout document",
32
+ });
33
+ const row = asRecord(asRecord(body)?.document);
34
+ if (!row) {
35
+ throw new GenesisPayConfigError(`GenesisPay GET /api/v1/checkout-documents/:publicId returned no document: ${JSON.stringify(body)}`);
36
+ }
37
+ return toCheckoutDocument(row);
38
+ },
39
+ };
40
+ }
41
+ export function toCheckoutDocument(raw) {
42
+ return {
43
+ id: requiredString(raw.id),
44
+ publicId: requiredString(raw.publicId),
45
+ kind: oneOf(raw.kind, ["invoice", "enhanced_receipt"], "enhanced_receipt"),
46
+ invoiceNumber: optionalString(raw.invoiceNumber),
47
+ asset: oneOf(raw.asset, ["USDC", "EURC"], "USDC"),
48
+ chainId: toCount(raw.chainId),
49
+ subtotalMinor: toAmountString(raw.subtotalMinor),
50
+ discountMinor: toAmountString(raw.discountMinor),
51
+ taxMinor: toAmountString(raw.taxMinor),
52
+ totalMinor: toAmountString(raw.totalMinor),
53
+ txHash: optionalString(raw.txHash),
54
+ confirmedAt: requiredString(raw.confirmedAt),
55
+ issuedAt: requiredString(raw.issuedAt),
56
+ retainUntil: requiredString(raw.retainUntil),
57
+ recipientEmail: requiredString(raw.recipientEmail),
58
+ snapshot: toCheckoutDocumentSnapshot(asRecord(raw.snapshot) ?? {}),
59
+ };
60
+ }
61
+ function toCheckoutDocumentSnapshot(raw) {
62
+ const seller = asRecord(raw.seller) ?? {};
63
+ const buyer = asRecord(raw.buyer) ?? {};
64
+ const lineItem = asRecord(raw.lineItem) ?? {};
65
+ const invoice = asRecord(raw.invoice) ?? {};
66
+ const tax = asRecord(raw.tax) ?? {};
67
+ const v2 = raw.version === 2;
68
+ return {
69
+ version: toCount(raw.version),
70
+ seller: {
71
+ userId: requiredString(seller.userId),
72
+ legalName: requiredString(seller.legalName),
73
+ email: optionalString(seller.email),
74
+ addressLine1: optionalString(seller.addressLine1),
75
+ addressLine2: optionalString(seller.addressLine2),
76
+ city: optionalString(seller.city),
77
+ postalCode: optionalString(seller.postalCode),
78
+ countryCode: optionalString(seller.countryCode),
79
+ taxId: optionalString(seller.taxId),
80
+ ...(v2 ? { profileVersion: toCount(seller.profileVersion), taxRegistration: parseCheckoutTaxRegistration(seller.taxRegistration) } : {}),
81
+ },
82
+ buyer: {
83
+ legalName: requiredString(buyer.legalName),
84
+ companyName: optionalString(buyer.companyName),
85
+ addressLine1: requiredString(buyer.addressLine1),
86
+ addressLine2: optionalString(buyer.addressLine2),
87
+ city: requiredString(buyer.city),
88
+ region: optionalString(buyer.region),
89
+ postalCode: requiredString(buyer.postalCode),
90
+ countryCode: requiredString(buyer.countryCode),
91
+ taxId: optionalString(buyer.taxId),
92
+ email: requiredString(buyer.email),
93
+ },
94
+ lineItem: {
95
+ description: requiredString(lineItem.description),
96
+ },
97
+ ...(v2 ? { lines: parseCheckoutLines(raw.lines) } : {}),
98
+ invoice: {
99
+ prefix: requiredString(invoice.prefix),
100
+ pricesIncludeTax: true,
101
+ },
102
+ tax: {
103
+ source: nullableOneOf(tax.source, ["seller_configured"]),
104
+ status: oneOf(tax.status, ["receipt_required", "calculated"], "receipt_required"),
105
+ reason: optionalString(tax.reason),
106
+ taxRateBps: optionalFiniteNumber(tax.taxRateBps),
107
+ zeroTaxNote: optionalString(tax.zeroTaxNote),
108
+ rounding: nullableOneOf(tax.rounding, ["half_up_asset_minor_unit"]),
109
+ settingsUpdatedAt: optionalString(tax.settingsUpdatedAt),
110
+ ...(v2 ? { itemConfig: requiredItemTax(tax.itemConfig) } : {}),
111
+ },
112
+ };
113
+ }
114
+ function requiredItemTax(raw) {
115
+ const tax = parseItemTax(raw);
116
+ if (!tax)
117
+ throw new GenesisPayConfigError("A v2 document requires explicit item tax.");
118
+ return tax;
119
+ }
120
+ function parseCheckoutLines(raw) {
121
+ if (!Array.isArray(raw) || raw.length === 0)
122
+ throw new GenesisPayConfigError("A v2 document requires line totals.");
123
+ return raw.map((value) => {
124
+ const line = asRecord(value) ?? {};
125
+ return { description: requiredString(line.description), quantity: toCount(line.quantity),
126
+ unitAmountMinor: toAmountString(line.unitAmountMinor), subtotalMinor: toAmountString(line.subtotalMinor),
127
+ discountMinor: toAmountString(line.discountMinor), taxMinor: toAmountString(line.taxMinor),
128
+ totalMinor: toAmountString(line.totalMinor), taxConfig: requiredItemTax(line.taxConfig) };
129
+ });
130
+ }
131
+ function parseCheckoutTaxRegistration(value) {
132
+ const tax = asRecord(value);
133
+ if (tax?.status === "not_registered" && typeof tax.reason === "string")
134
+ return { status: "not_registered", reason: tax.reason };
135
+ if (tax?.status !== "registered" || !Array.isArray(tax.registrations) || !tax.registrations.length)
136
+ throw new GenesisPayConfigError("A v2 document requires the issuer tax declaration.");
137
+ return { status: "registered", registrations: tax.registrations.map((value) => {
138
+ const entry = asRecord(value);
139
+ if (!entry || !["vat", "gst", "tax_id", "business_number"].includes(String(entry.type)) || typeof entry.countryCode !== "string" || typeof entry.value !== "string")
140
+ throw new GenesisPayConfigError("Invalid issuer tax declaration.");
141
+ return { type: entry.type, countryCode: entry.countryCode, value: entry.value };
142
+ }) };
143
+ }
144
+ function nullableOneOf(value, allowed) {
145
+ return typeof value === "string" && allowed.includes(value)
146
+ ? value
147
+ : null;
148
+ }
149
+ function optionalFiniteNumber(value) {
150
+ if (value === null || value === undefined || value === "")
151
+ return null;
152
+ const parsed = typeof value === "number" ? value : Number(value);
153
+ return Number.isFinite(parsed) ? parsed : null;
154
+ }
155
+ //# sourceMappingURL=checkout-documents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkout-documents.js","sourceRoot":"","sources":["../src/checkout-documents.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E;AAE7E,OAAO,EAAE,qBAAqB,EA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AAE,CAAC;QAClI,CAAC,CAAC,EAAE,CAAC;AACP,CAAC;AAED,SAAS,aAAa,CAAmB,KAAc,EAAE,OAAqB;IAC5E,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,OAA6B,CAAC,QAAQ,CAAC,KAAK,CAAC;QAChF,CAAC,CAAE,KAAW;QACd,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAc;IAC1C,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IACvE,MAAM,MAAM,GAAG,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjE,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CAAC"}
@@ -0,0 +1,41 @@
1
+ /** The `returnUrl` query parameter carrying the checkout link's `publicId`. */
2
+ export declare const CHECKOUT_RETURN_LINK_ID_PARAM = "genesispay_link_id";
3
+ /** The `returnUrl` query parameter carrying the checkout status. */
4
+ export declare const CHECKOUT_RETURN_STATUS_PARAM = "genesispay_status";
5
+ /**
6
+ * The result parameters GenesisPay appends to a merchant's `returnUrl`, as
7
+ * read back by {@link parseCheckoutReturnHint}.
8
+ *
9
+ * **This is a UI hint, not proof of payment.** The values are unsigned and a
10
+ * payer can open that URL without paying. Use the seller-authenticated strict
11
+ * `fulfillment.verify` authority path before fulfilment — never these fields.
12
+ */
13
+ export type CheckoutReturnHint = {
14
+ /** The checkout link's `publicId` — the value in `genesispay_link_id`. */
15
+ linkId: string;
16
+ /** Always `"paid"` — the parser returns nothing else. */
17
+ status: "paid";
18
+ };
19
+ /**
20
+ * Reads the return parameters off a `returnUrl`.
21
+ *
22
+ * Returns a hint only when the URL carries a non-empty `genesispay_link_id` and
23
+ * an exact `genesispay_status=paid`. A missing id, any other status, or an
24
+ * unparseable URL returns `null`. Accepts a string or an already-parsed `URL`.
25
+ *
26
+ * Performs **no verification**: it does not check that the link exists, that it
27
+ * was paid, or that the parameters came from GenesisPay. Call
28
+ * `fulfillment.verify({ locator: { linkId: hint.linkId }, expected })`
29
+ * (authenticated with your seller key) before acting on it. A link locator is
30
+ * suitable only for a single-use link; reusable links require an attempt ID.
31
+ */
32
+ export declare function parseCheckoutReturnHint(url: string | URL): CheckoutReturnHint | null;
33
+ /**
34
+ * The payer-facing redirect scheme allowlist for `returnUrl`/`cancelUrl`,
35
+ * mirroring the server. `https` is always accepted; `http` is accepted only for
36
+ * the exact loopback hostnames above — a `javascript:`/`data:` value, a remote
37
+ * `http` host, or a deceptive `localhost.example` name is rejected, because
38
+ * these values are rendered as links in the payer's browser.
39
+ */
40
+ export declare function isPayerRedirectUrl(rawUrl: string): boolean;
41
+ //# sourceMappingURL=checkout-return.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkout-return.d.ts","sourceRoot":"","sources":["../src/checkout-return.ts"],"names":[],"mappings":"AAYA,+EAA+E;AAC/E,eAAO,MAAM,6BAA6B,uBAAuB,CAAC;AAElE,oEAAoE;AACpE,eAAO,MAAM,4BAA4B,sBAAsB,CAAC;AAQhE;;;;;;;GAOG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,kBAAkB,GAAG,IAAI,CAgBpF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAa1D"}
@@ -0,0 +1,68 @@
1
+ // The query parameters GenesisPay appends to a merchant's `returnUrl` after a
2
+ // confirmed payment, and the helper that reads them back.
3
+ //
4
+ // These names are part of a cross-side contract: the server's hosted-checkout
5
+ // URL builder (`src/features/payments/checkout-return-url.ts`) writes them and
6
+ // this SDK reads them. A parity test lives on the server side (the only place
7
+ // that can import both) and fails if either side renames one without the other.
8
+ //
9
+ // The parser below performs **no verification**. The parameters are unsigned —
10
+ // anyone who knows a `publicId` can construct that URL without paying — so a
11
+ // hint it returns is a UI convenience, never proof of payment.
12
+ /** The `returnUrl` query parameter carrying the checkout link's `publicId`. */
13
+ export const CHECKOUT_RETURN_LINK_ID_PARAM = "genesispay_link_id";
14
+ /** The `returnUrl` query parameter carrying the checkout status. */
15
+ export const CHECKOUT_RETURN_STATUS_PARAM = "genesispay_status";
16
+ /** The only status the parser accepts — and the only status GenesisPay writes. */
17
+ const PAID_STATUS = "paid";
18
+ /** Hostnames for which `http` is accepted (local development only). */
19
+ const LOCAL_REDIRECT_HOSTNAMES = new Set(["localhost", "127.0.0.1"]);
20
+ /**
21
+ * Reads the return parameters off a `returnUrl`.
22
+ *
23
+ * Returns a hint only when the URL carries a non-empty `genesispay_link_id` and
24
+ * an exact `genesispay_status=paid`. A missing id, any other status, or an
25
+ * unparseable URL returns `null`. Accepts a string or an already-parsed `URL`.
26
+ *
27
+ * Performs **no verification**: it does not check that the link exists, that it
28
+ * was paid, or that the parameters came from GenesisPay. Call
29
+ * `fulfillment.verify({ locator: { linkId: hint.linkId }, expected })`
30
+ * (authenticated with your seller key) before acting on it. A link locator is
31
+ * suitable only for a single-use link; reusable links require an attempt ID.
32
+ */
33
+ export function parseCheckoutReturnHint(url) {
34
+ let parsed;
35
+ try {
36
+ parsed = typeof url === "string" ? new URL(url) : url;
37
+ }
38
+ catch {
39
+ return null;
40
+ }
41
+ const linkId = parsed.searchParams.get(CHECKOUT_RETURN_LINK_ID_PARAM);
42
+ const status = parsed.searchParams.get(CHECKOUT_RETURN_STATUS_PARAM);
43
+ if (!linkId || status !== PAID_STATUS) {
44
+ return null;
45
+ }
46
+ return { linkId, status: PAID_STATUS };
47
+ }
48
+ /**
49
+ * The payer-facing redirect scheme allowlist for `returnUrl`/`cancelUrl`,
50
+ * mirroring the server. `https` is always accepted; `http` is accepted only for
51
+ * the exact loopback hostnames above — a `javascript:`/`data:` value, a remote
52
+ * `http` host, or a deceptive `localhost.example` name is rejected, because
53
+ * these values are rendered as links in the payer's browser.
54
+ */
55
+ export function isPayerRedirectUrl(rawUrl) {
56
+ let parsed;
57
+ try {
58
+ parsed = new URL(rawUrl.trim());
59
+ }
60
+ catch {
61
+ return false;
62
+ }
63
+ if (parsed.protocol === "https:") {
64
+ return true;
65
+ }
66
+ return parsed.protocol === "http:" && LOCAL_REDIRECT_HOSTNAMES.has(parsed.hostname);
67
+ }
68
+ //# sourceMappingURL=checkout-return.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkout-return.js","sourceRoot":"","sources":["../src/checkout-return.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,0DAA0D;AAC1D,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,8EAA8E;AAC9E,gFAAgF;AAChF,EAAE;AACF,+EAA+E;AAC/E,6EAA6E;AAC7E,+DAA+D;AAE/D,+EAA+E;AAC/E,MAAM,CAAC,MAAM,6BAA6B,GAAG,oBAAoB,CAAC;AAElE,oEAAoE;AACpE,MAAM,CAAC,MAAM,4BAA4B,GAAG,mBAAmB,CAAC;AAEhE,kFAAkF;AAClF,MAAM,WAAW,GAAG,MAAM,CAAC;AAE3B,uEAAuE;AACvE,MAAM,wBAAwB,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;AAiBrE;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAiB;IACvD,IAAI,MAAW,CAAC;IAChB,IAAI,CAAC;QACH,MAAM,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CA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