@sazito/checkout 0.4.4 → 0.4.6
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.
- package/dist/chunks/{labels-DxIkDijU.js → labels-Cyryfqd7.js} +16 -30
- package/dist/chunks/labels-Cyryfqd7.js.map +1 -0
- package/dist/chunks/{labels-DlZCs2z3.cjs → labels-DCruUx_W.cjs} +16 -30
- package/dist/chunks/labels-DCruUx_W.cjs.map +1 -0
- package/dist/chunks/{use-checkout-BPcxdj0A.cjs → use-checkout-Bv1EWwHX.cjs} +2 -2
- package/dist/chunks/{use-checkout-BPcxdj0A.cjs.map → use-checkout-Bv1EWwHX.cjs.map} +1 -1
- package/dist/chunks/{use-checkout-tQfM_-7X.js → use-checkout-CNJcOUIZ.js} +2 -2
- package/dist/chunks/{use-checkout-tQfM_-7X.js.map → use-checkout-CNJcOUIZ.js.map} +1 -1
- package/dist/core/index.cjs +2 -1
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +9 -4
- package/dist/core/index.d.ts +9 -4
- package/dist/core/index.js +2 -2
- package/dist/next/index.cjs +5 -3
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.js +6 -4
- package/dist/next/index.js.map +1 -1
- package/dist/next/payment-return.cjs +22 -4
- package/dist/next/payment-return.cjs.map +1 -1
- package/dist/next/payment-return.d.cts +9 -4
- package/dist/next/payment-return.d.ts +9 -4
- package/dist/next/payment-return.js +22 -5
- package/dist/next/payment-return.js.map +1 -1
- package/dist/react/index.cjs +2 -2
- package/dist/react/index.js +2 -2
- package/dist/styles.css +130 -12
- package/package.json +1 -1
- package/dist/chunks/labels-DlZCs2z3.cjs.map +0 -1
- package/dist/chunks/labels-DxIkDijU.js.map +0 -1
|
@@ -1,15 +1,32 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const SAZITO_PAYMENT_RESULT_MARKERS = [
|
|
4
|
+
'mellatpaymentresult', 'pecpaymentresult', 'uppaymentresult',
|
|
5
|
+
'seppaymentresult', 'vandarpaymentresult', 'yourgatepaymentresult',
|
|
6
|
+
'bazarpaymentresult', 'zifypaymentresult', 'zibalpaymentresult',
|
|
7
|
+
'snapppaypaymentresult', 'torobpaypaymentresult', 'ghestapaypaymentresult',
|
|
8
|
+
'azkipaymentresult', 'digipaypaymentresult', 'greenpaypaymentresult',
|
|
9
|
+
'novapaypaymentresult', 'zarinpluspaymentresult', 'tomanpaymentresult',
|
|
10
|
+
'tarapaymentresult', 'ozonpaymentresult', 'millipaypaymentresult',
|
|
11
|
+
'ayriapaymentresult', 'sadadpaymentresult', 'freepaymentresult',
|
|
12
|
+
'paymentinplaceresult', 'cardtocardpaymentresult', 'zarinpalpaymentresult',
|
|
13
|
+
'directpayresult', 'paypingpaymentresult', 'podpaymentresult',
|
|
14
|
+
'sabinpaymentresult', 'firoozepaymentresult', 'technopaypaymentresult',
|
|
15
|
+
'buywithdigikalaresult'
|
|
16
|
+
];
|
|
3
17
|
/**
|
|
4
18
|
* Parse Sazito's nested payment callback path into checkout-ready data.
|
|
5
19
|
* Returns undefined for ordinary checkout URLs and malformed callbacks.
|
|
6
20
|
*/
|
|
7
|
-
function parsePaymentReturn(segments, searchParams = {}) {
|
|
21
|
+
function parsePaymentReturn(segments, searchParams = {}, options = {}) {
|
|
8
22
|
const [resultRoute, paymentSegment, rawPaymentId, identifierSegment, rawIdentifier] = segments ?? [];
|
|
9
23
|
const paymentId = Number(rawPaymentId);
|
|
10
24
|
const identifier = rawIdentifier?.trim();
|
|
25
|
+
const allowedMarkers = new Set((options.gatewayResultMarkers ?? SAZITO_PAYMENT_RESULT_MARKERS)
|
|
26
|
+
.map((marker) => marker.toLowerCase()));
|
|
11
27
|
if (segments?.length !== 5 ||
|
|
12
|
-
!resultRoute
|
|
28
|
+
!resultRoute ||
|
|
29
|
+
!allowedMarkers.has(resultRoute.toLowerCase()) ||
|
|
13
30
|
paymentSegment?.toLowerCase() !== 'payment' ||
|
|
14
31
|
identifierSegment?.toLowerCase() !== 'identifier' ||
|
|
15
32
|
!Number.isSafeInteger(paymentId) ||
|
|
@@ -30,7 +47,7 @@ function parsePaymentReturn(segments, searchParams = {}) {
|
|
|
30
47
|
* The callback may be mounted below any checkout base path; only its final
|
|
31
48
|
* five path segments are significant.
|
|
32
49
|
*/
|
|
33
|
-
function parsePaymentReturnUrl(url) {
|
|
50
|
+
function parsePaymentReturnUrl(url, options = {}) {
|
|
34
51
|
let parsedUrl;
|
|
35
52
|
try {
|
|
36
53
|
parsedUrl = typeof url === 'string'
|
|
@@ -54,7 +71,7 @@ function parsePaymentReturnUrl(url) {
|
|
|
54
71
|
searchParams[key] = value;
|
|
55
72
|
}
|
|
56
73
|
}
|
|
57
|
-
return parsePaymentReturn(segments.slice(-5), searchParams);
|
|
74
|
+
return parsePaymentReturn(segments.slice(-5), searchParams, options);
|
|
58
75
|
}
|
|
59
76
|
function decodePathSegment(segment) {
|
|
60
77
|
try {
|
|
@@ -75,6 +92,7 @@ function normalizeSearchParams(searchParams) {
|
|
|
75
92
|
return normalized;
|
|
76
93
|
}
|
|
77
94
|
|
|
95
|
+
exports.SAZITO_PAYMENT_RESULT_MARKERS = SAZITO_PAYMENT_RESULT_MARKERS;
|
|
78
96
|
exports.parsePaymentReturn = parsePaymentReturn;
|
|
79
97
|
exports.parsePaymentReturnUrl = parsePaymentReturnUrl;
|
|
80
98
|
//# sourceMappingURL=payment-return.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-return.cjs","sources":["../../src/core/payment-return.ts"],"sourcesContent":["import type {\n CheckoutPaymentReturn,\n PaymentReturnSearchParams\n} from './types';\n\n/**\n * Parse Sazito's nested payment callback path into checkout-ready data.\n * Returns undefined for ordinary checkout URLs and malformed callbacks.\n */\nexport function parsePaymentReturn(\n segments: readonly string[] | undefined,\n searchParams: PaymentReturnSearchParams = {}\n): CheckoutPaymentReturn | undefined {\n const [resultRoute, paymentSegment, rawPaymentId, identifierSegment, rawIdentifier] =\n segments ?? [];\n const paymentId = Number(rawPaymentId);\n const identifier = rawIdentifier?.trim();\n\n if (\n segments?.length !== 5 ||\n !resultRoute
|
|
1
|
+
{"version":3,"file":"payment-return.cjs","sources":["../../src/core/payment-return.ts"],"sourcesContent":["import type {\n CheckoutPaymentReturn,\n PaymentReturnParserOptions,\n PaymentReturnSearchParams\n} from './types';\n\nexport const SAZITO_PAYMENT_RESULT_MARKERS = [\n 'mellatpaymentresult', 'pecpaymentresult', 'uppaymentresult',\n 'seppaymentresult', 'vandarpaymentresult', 'yourgatepaymentresult',\n 'bazarpaymentresult', 'zifypaymentresult', 'zibalpaymentresult',\n 'snapppaypaymentresult', 'torobpaypaymentresult', 'ghestapaypaymentresult',\n 'azkipaymentresult', 'digipaypaymentresult', 'greenpaypaymentresult',\n 'novapaypaymentresult', 'zarinpluspaymentresult', 'tomanpaymentresult',\n 'tarapaymentresult', 'ozonpaymentresult', 'millipaypaymentresult',\n 'ayriapaymentresult', 'sadadpaymentresult', 'freepaymentresult',\n 'paymentinplaceresult', 'cardtocardpaymentresult', 'zarinpalpaymentresult',\n 'directpayresult', 'paypingpaymentresult', 'podpaymentresult',\n 'sabinpaymentresult', 'firoozepaymentresult', 'technopaypaymentresult',\n 'buywithdigikalaresult'\n] as const;\n\n/**\n * Parse Sazito's nested payment callback path into checkout-ready data.\n * Returns undefined for ordinary checkout URLs and malformed callbacks.\n */\nexport function parsePaymentReturn(\n segments: readonly string[] | undefined,\n searchParams: PaymentReturnSearchParams = {},\n options: PaymentReturnParserOptions = {}\n): CheckoutPaymentReturn | undefined {\n const [resultRoute, paymentSegment, rawPaymentId, identifierSegment, rawIdentifier] =\n segments ?? [];\n const paymentId = Number(rawPaymentId);\n const identifier = rawIdentifier?.trim();\n const allowedMarkers = new Set(\n (options.gatewayResultMarkers ?? SAZITO_PAYMENT_RESULT_MARKERS)\n .map((marker) => marker.toLowerCase())\n );\n\n if (\n segments?.length !== 5 ||\n !resultRoute ||\n !allowedMarkers.has(resultRoute.toLowerCase()) ||\n paymentSegment?.toLowerCase() !== 'payment' ||\n identifierSegment?.toLowerCase() !== 'identifier' ||\n !Number.isSafeInteger(paymentId) ||\n paymentId <= 0 ||\n !identifier\n ) {\n return undefined;\n }\n\n const params = normalizeSearchParams(searchParams);\n params.id = String(paymentId);\n params.paymentIdentifier = identifier;\n\n return {\n payment: { id: paymentId, identifier },\n params\n };\n}\n\n/**\n * Parse a complete checkout URL containing Sazito's nested payment callback.\n * The callback may be mounted below any checkout base path; only its final\n * five path segments are significant.\n */\nexport function parsePaymentReturnUrl(\n url: string | URL,\n options: PaymentReturnParserOptions = {}\n): CheckoutPaymentReturn | undefined {\n let parsedUrl: URL;\n\n try {\n parsedUrl = typeof url === 'string'\n ? new URL(url, 'https://checkout.sazito.invalid')\n : url;\n } catch {\n return undefined;\n }\n\n const segments = parsedUrl.pathname\n .split('/')\n .filter(Boolean)\n .map(decodePathSegment);\n\n if (segments.length < 5) {\n return undefined;\n }\n\n const searchParams: Record<string, string> = {};\n for (const [key, value] of parsedUrl.searchParams) {\n // Match Next.js search-param normalization: preserve the first value.\n if (searchParams[key] === undefined) {\n searchParams[key] = value;\n }\n }\n\n return parsePaymentReturn(segments.slice(-5), searchParams, options);\n}\n\nfunction decodePathSegment(segment: string): string {\n try {\n return decodeURIComponent(segment);\n } catch {\n return segment;\n }\n}\n\nfunction normalizeSearchParams(\n searchParams: PaymentReturnSearchParams\n): Record<string, string> {\n const normalized: Record<string, string> = {};\n\n for (const [key, value] of Object.entries(searchParams)) {\n const firstValue = Array.isArray(value) ? value[0] : value;\n if (firstValue !== undefined) {\n normalized[key] = firstValue;\n }\n }\n\n return normalized;\n}\n"],"names":[],"mappings":";;AAMO,MAAM,6BAA6B,GAAG;IAC3C,qBAAqB,EAAE,kBAAkB,EAAE,iBAAiB;IAC5D,kBAAkB,EAAE,qBAAqB,EAAE,uBAAuB;IAClE,oBAAoB,EAAE,mBAAmB,EAAE,oBAAoB;IAC/D,uBAAu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AuC,EAAA;IAEvC,MAAM,UAAU,GAA2B,EAAE;AAE7C,IAAA,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;AACvD,QAAA,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK;AAC1D,QAAA,IAAI,UAAU,KAAK,SAAS,EAAE;AAC5B,YAAA,UAAU,CAAC,GAAG,CAAC,GAAG,UAAU;QAC9B;IACF;AAEA,IAAA,OAAO,UAAU;AACnB;;;;;;"}
|
|
@@ -15,18 +15,23 @@ interface CheckoutPaymentReturn {
|
|
|
15
15
|
}
|
|
16
16
|
/** Search-param shape exposed by current Next.js App Router pages. */
|
|
17
17
|
type PaymentReturnSearchParams = Record<string, string | string[] | undefined>;
|
|
18
|
+
interface PaymentReturnParserOptions {
|
|
19
|
+
/** Replace the built-in Sazito gateway-result marker allowlist. */
|
|
20
|
+
gatewayResultMarkers?: readonly string[];
|
|
21
|
+
}
|
|
18
22
|
|
|
23
|
+
declare const SAZITO_PAYMENT_RESULT_MARKERS: readonly ["mellatpaymentresult", "pecpaymentresult", "uppaymentresult", "seppaymentresult", "vandarpaymentresult", "yourgatepaymentresult", "bazarpaymentresult", "zifypaymentresult", "zibalpaymentresult", "snapppaypaymentresult", "torobpaypaymentresult", "ghestapaypaymentresult", "azkipaymentresult", "digipaypaymentresult", "greenpaypaymentresult", "novapaypaymentresult", "zarinpluspaymentresult", "tomanpaymentresult", "tarapaymentresult", "ozonpaymentresult", "millipaypaymentresult", "ayriapaymentresult", "sadadpaymentresult", "freepaymentresult", "paymentinplaceresult", "cardtocardpaymentresult", "zarinpalpaymentresult", "directpayresult", "paypingpaymentresult", "podpaymentresult", "sabinpaymentresult", "firoozepaymentresult", "technopaypaymentresult", "buywithdigikalaresult"];
|
|
19
24
|
/**
|
|
20
25
|
* Parse Sazito's nested payment callback path into checkout-ready data.
|
|
21
26
|
* Returns undefined for ordinary checkout URLs and malformed callbacks.
|
|
22
27
|
*/
|
|
23
|
-
declare function parsePaymentReturn(segments: readonly string[] | undefined, searchParams?: PaymentReturnSearchParams): CheckoutPaymentReturn | undefined;
|
|
28
|
+
declare function parsePaymentReturn(segments: readonly string[] | undefined, searchParams?: PaymentReturnSearchParams, options?: PaymentReturnParserOptions): CheckoutPaymentReturn | undefined;
|
|
24
29
|
/**
|
|
25
30
|
* Parse a complete checkout URL containing Sazito's nested payment callback.
|
|
26
31
|
* The callback may be mounted below any checkout base path; only its final
|
|
27
32
|
* five path segments are significant.
|
|
28
33
|
*/
|
|
29
|
-
declare function parsePaymentReturnUrl(url: string | URL): CheckoutPaymentReturn | undefined;
|
|
34
|
+
declare function parsePaymentReturnUrl(url: string | URL, options?: PaymentReturnParserOptions): CheckoutPaymentReturn | undefined;
|
|
30
35
|
|
|
31
|
-
export { parsePaymentReturn, parsePaymentReturnUrl };
|
|
32
|
-
export type { CheckoutPaymentReturn, PaymentReturnSearchParams };
|
|
36
|
+
export { SAZITO_PAYMENT_RESULT_MARKERS, parsePaymentReturn, parsePaymentReturnUrl };
|
|
37
|
+
export type { CheckoutPaymentReturn, PaymentReturnParserOptions, PaymentReturnSearchParams };
|
|
@@ -15,18 +15,23 @@ interface CheckoutPaymentReturn {
|
|
|
15
15
|
}
|
|
16
16
|
/** Search-param shape exposed by current Next.js App Router pages. */
|
|
17
17
|
type PaymentReturnSearchParams = Record<string, string | string[] | undefined>;
|
|
18
|
+
interface PaymentReturnParserOptions {
|
|
19
|
+
/** Replace the built-in Sazito gateway-result marker allowlist. */
|
|
20
|
+
gatewayResultMarkers?: readonly string[];
|
|
21
|
+
}
|
|
18
22
|
|
|
23
|
+
declare const SAZITO_PAYMENT_RESULT_MARKERS: readonly ["mellatpaymentresult", "pecpaymentresult", "uppaymentresult", "seppaymentresult", "vandarpaymentresult", "yourgatepaymentresult", "bazarpaymentresult", "zifypaymentresult", "zibalpaymentresult", "snapppaypaymentresult", "torobpaypaymentresult", "ghestapaypaymentresult", "azkipaymentresult", "digipaypaymentresult", "greenpaypaymentresult", "novapaypaymentresult", "zarinpluspaymentresult", "tomanpaymentresult", "tarapaymentresult", "ozonpaymentresult", "millipaypaymentresult", "ayriapaymentresult", "sadadpaymentresult", "freepaymentresult", "paymentinplaceresult", "cardtocardpaymentresult", "zarinpalpaymentresult", "directpayresult", "paypingpaymentresult", "podpaymentresult", "sabinpaymentresult", "firoozepaymentresult", "technopaypaymentresult", "buywithdigikalaresult"];
|
|
19
24
|
/**
|
|
20
25
|
* Parse Sazito's nested payment callback path into checkout-ready data.
|
|
21
26
|
* Returns undefined for ordinary checkout URLs and malformed callbacks.
|
|
22
27
|
*/
|
|
23
|
-
declare function parsePaymentReturn(segments: readonly string[] | undefined, searchParams?: PaymentReturnSearchParams): CheckoutPaymentReturn | undefined;
|
|
28
|
+
declare function parsePaymentReturn(segments: readonly string[] | undefined, searchParams?: PaymentReturnSearchParams, options?: PaymentReturnParserOptions): CheckoutPaymentReturn | undefined;
|
|
24
29
|
/**
|
|
25
30
|
* Parse a complete checkout URL containing Sazito's nested payment callback.
|
|
26
31
|
* The callback may be mounted below any checkout base path; only its final
|
|
27
32
|
* five path segments are significant.
|
|
28
33
|
*/
|
|
29
|
-
declare function parsePaymentReturnUrl(url: string | URL): CheckoutPaymentReturn | undefined;
|
|
34
|
+
declare function parsePaymentReturnUrl(url: string | URL, options?: PaymentReturnParserOptions): CheckoutPaymentReturn | undefined;
|
|
30
35
|
|
|
31
|
-
export { parsePaymentReturn, parsePaymentReturnUrl };
|
|
32
|
-
export type { CheckoutPaymentReturn, PaymentReturnSearchParams };
|
|
36
|
+
export { SAZITO_PAYMENT_RESULT_MARKERS, parsePaymentReturn, parsePaymentReturnUrl };
|
|
37
|
+
export type { CheckoutPaymentReturn, PaymentReturnParserOptions, PaymentReturnSearchParams };
|
|
@@ -1,13 +1,30 @@
|
|
|
1
|
+
const SAZITO_PAYMENT_RESULT_MARKERS = [
|
|
2
|
+
'mellatpaymentresult', 'pecpaymentresult', 'uppaymentresult',
|
|
3
|
+
'seppaymentresult', 'vandarpaymentresult', 'yourgatepaymentresult',
|
|
4
|
+
'bazarpaymentresult', 'zifypaymentresult', 'zibalpaymentresult',
|
|
5
|
+
'snapppaypaymentresult', 'torobpaypaymentresult', 'ghestapaypaymentresult',
|
|
6
|
+
'azkipaymentresult', 'digipaypaymentresult', 'greenpaypaymentresult',
|
|
7
|
+
'novapaypaymentresult', 'zarinpluspaymentresult', 'tomanpaymentresult',
|
|
8
|
+
'tarapaymentresult', 'ozonpaymentresult', 'millipaypaymentresult',
|
|
9
|
+
'ayriapaymentresult', 'sadadpaymentresult', 'freepaymentresult',
|
|
10
|
+
'paymentinplaceresult', 'cardtocardpaymentresult', 'zarinpalpaymentresult',
|
|
11
|
+
'directpayresult', 'paypingpaymentresult', 'podpaymentresult',
|
|
12
|
+
'sabinpaymentresult', 'firoozepaymentresult', 'technopaypaymentresult',
|
|
13
|
+
'buywithdigikalaresult'
|
|
14
|
+
];
|
|
1
15
|
/**
|
|
2
16
|
* Parse Sazito's nested payment callback path into checkout-ready data.
|
|
3
17
|
* Returns undefined for ordinary checkout URLs and malformed callbacks.
|
|
4
18
|
*/
|
|
5
|
-
function parsePaymentReturn(segments, searchParams = {}) {
|
|
19
|
+
function parsePaymentReturn(segments, searchParams = {}, options = {}) {
|
|
6
20
|
const [resultRoute, paymentSegment, rawPaymentId, identifierSegment, rawIdentifier] = segments ?? [];
|
|
7
21
|
const paymentId = Number(rawPaymentId);
|
|
8
22
|
const identifier = rawIdentifier?.trim();
|
|
23
|
+
const allowedMarkers = new Set((options.gatewayResultMarkers ?? SAZITO_PAYMENT_RESULT_MARKERS)
|
|
24
|
+
.map((marker) => marker.toLowerCase()));
|
|
9
25
|
if (segments?.length !== 5 ||
|
|
10
|
-
!resultRoute
|
|
26
|
+
!resultRoute ||
|
|
27
|
+
!allowedMarkers.has(resultRoute.toLowerCase()) ||
|
|
11
28
|
paymentSegment?.toLowerCase() !== 'payment' ||
|
|
12
29
|
identifierSegment?.toLowerCase() !== 'identifier' ||
|
|
13
30
|
!Number.isSafeInteger(paymentId) ||
|
|
@@ -28,7 +45,7 @@ function parsePaymentReturn(segments, searchParams = {}) {
|
|
|
28
45
|
* The callback may be mounted below any checkout base path; only its final
|
|
29
46
|
* five path segments are significant.
|
|
30
47
|
*/
|
|
31
|
-
function parsePaymentReturnUrl(url) {
|
|
48
|
+
function parsePaymentReturnUrl(url, options = {}) {
|
|
32
49
|
let parsedUrl;
|
|
33
50
|
try {
|
|
34
51
|
parsedUrl = typeof url === 'string'
|
|
@@ -52,7 +69,7 @@ function parsePaymentReturnUrl(url) {
|
|
|
52
69
|
searchParams[key] = value;
|
|
53
70
|
}
|
|
54
71
|
}
|
|
55
|
-
return parsePaymentReturn(segments.slice(-5), searchParams);
|
|
72
|
+
return parsePaymentReturn(segments.slice(-5), searchParams, options);
|
|
56
73
|
}
|
|
57
74
|
function decodePathSegment(segment) {
|
|
58
75
|
try {
|
|
@@ -73,5 +90,5 @@ function normalizeSearchParams(searchParams) {
|
|
|
73
90
|
return normalized;
|
|
74
91
|
}
|
|
75
92
|
|
|
76
|
-
export { parsePaymentReturn, parsePaymentReturnUrl };
|
|
93
|
+
export { SAZITO_PAYMENT_RESULT_MARKERS, parsePaymentReturn, parsePaymentReturnUrl };
|
|
77
94
|
//# sourceMappingURL=payment-return.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-return.js","sources":["../../src/core/payment-return.ts"],"sourcesContent":["import type {\n CheckoutPaymentReturn,\n PaymentReturnSearchParams\n} from './types';\n\n/**\n * Parse Sazito's nested payment callback path into checkout-ready data.\n * Returns undefined for ordinary checkout URLs and malformed callbacks.\n */\nexport function parsePaymentReturn(\n segments: readonly string[] | undefined,\n searchParams: PaymentReturnSearchParams = {}\n): CheckoutPaymentReturn | undefined {\n const [resultRoute, paymentSegment, rawPaymentId, identifierSegment, rawIdentifier] =\n segments ?? [];\n const paymentId = Number(rawPaymentId);\n const identifier = rawIdentifier?.trim();\n\n if (\n segments?.length !== 5 ||\n !resultRoute
|
|
1
|
+
{"version":3,"file":"payment-return.js","sources":["../../src/core/payment-return.ts"],"sourcesContent":["import type {\n CheckoutPaymentReturn,\n PaymentReturnParserOptions,\n PaymentReturnSearchParams\n} from './types';\n\nexport const SAZITO_PAYMENT_RESULT_MARKERS = [\n 'mellatpaymentresult', 'pecpaymentresult', 'uppaymentresult',\n 'seppaymentresult', 'vandarpaymentresult', 'yourgatepaymentresult',\n 'bazarpaymentresult', 'zifypaymentresult', 'zibalpaymentresult',\n 'snapppaypaymentresult', 'torobpaypaymentresult', 'ghestapaypaymentresult',\n 'azkipaymentresult', 'digipaypaymentresult', 'greenpaypaymentresult',\n 'novapaypaymentresult', 'zarinpluspaymentresult', 'tomanpaymentresult',\n 'tarapaymentresult', 'ozonpaymentresult', 'millipaypaymentresult',\n 'ayriapaymentresult', 'sadadpaymentresult', 'freepaymentresult',\n 'paymentinplaceresult', 'cardtocardpaymentresult', 'zarinpalpaymentresult',\n 'directpayresult', 'paypingpaymentresult', 'podpaymentresult',\n 'sabinpaymentresult', 'firoozepaymentresult', 'technopaypaymentresult',\n 'buywithdigikalaresult'\n] as const;\n\n/**\n * Parse Sazito's nested payment callback path into checkout-ready data.\n * Returns undefined for ordinary checkout URLs and malformed callbacks.\n */\nexport function parsePaymentReturn(\n segments: readonly string[] | undefined,\n searchParams: PaymentReturnSearchParams = {},\n options: PaymentReturnParserOptions = {}\n): CheckoutPaymentReturn | undefined {\n const [resultRoute, paymentSegment, rawPaymentId, identifierSegment, rawIdentifier] =\n segments ?? [];\n const paymentId = Number(rawPaymentId);\n const identifier = rawIdentifier?.trim();\n const allowedMarkers = new Set(\n (options.gatewayResultMarkers ?? SAZITO_PAYMENT_RESULT_MARKERS)\n .map((marker) => marker.toLowerCase())\n );\n\n if (\n segments?.length !== 5 ||\n !resultRoute ||\n !allowedMarkers.has(resultRoute.toLowerCase()) ||\n paymentSegment?.toLowerCase() !== 'payment' ||\n identifierSegment?.toLowerCase() !== 'identifier' ||\n !Number.isSafeInteger(paymentId) ||\n paymentId <= 0 ||\n !identifier\n ) {\n return undefined;\n }\n\n const params = normalizeSearchParams(searchParams);\n params.id = String(paymentId);\n params.paymentIdentifier = identifier;\n\n return {\n payment: { id: paymentId, identifier },\n params\n };\n}\n\n/**\n * Parse a complete checkout URL containing Sazito's nested payment callback.\n * The callback may be mounted below any checkout base path; only its final\n * five path segments are significant.\n */\nexport function parsePaymentReturnUrl(\n url: string | URL,\n options: PaymentReturnParserOptions = {}\n): CheckoutPaymentReturn | undefined {\n let parsedUrl: URL;\n\n try {\n parsedUrl = typeof url === 'string'\n ? new URL(url, 'https://checkout.sazito.invalid')\n : url;\n } catch {\n return undefined;\n }\n\n const segments = parsedUrl.pathname\n .split('/')\n .filter(Boolean)\n .map(decodePathSegment);\n\n if (segments.length < 5) {\n return undefined;\n }\n\n const searchParams: Record<string, string> = {};\n for (const [key, value] of parsedUrl.searchParams) {\n // Match Next.js search-param normalization: preserve the first value.\n if (searchParams[key] === undefined) {\n searchParams[key] = value;\n }\n }\n\n return parsePaymentReturn(segments.slice(-5), searchParams, options);\n}\n\nfunction decodePathSegment(segment: string): string {\n try {\n return decodeURIComponent(segment);\n } catch {\n return segment;\n }\n}\n\nfunction normalizeSearchParams(\n searchParams: PaymentReturnSearchParams\n): Record<string, string> {\n const normalized: Record<string, string> = {};\n\n for (const [key, value] of Object.entries(searchParams)) {\n const firstValue = Array.isArray(value) ? value[0] : value;\n if (firstValue !== undefined) {\n normalized[key] = firstValue;\n }\n }\n\n return normalized;\n}\n"],"names":[],"mappings":"AAMO,MAAM,6BAA6B,GAAG;IAC3C,qBAAqB,EAAE,kBAAkB,EAAE,iBAAiB;IAC5D,kBAAkB,EAAE,qBAAqB,EAAE,uBAAuB;IAClE,oBAAoB,EAAE,mBAAmB,EAAE,oBAAoB;IAC/D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C5B,YAAuC,EAAA;IAEvC,MAAM,UAAU,GAA2B,EAAE;AAE7C,IAAA,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;AACvD,QAAA,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK;AAC1D,QAAA,IAAI,UAAU,KAAK,SAAS,EAAE;AAC5B,YAAA,UAAU,CAAC,GAAG,CAAC,GAAG,UAAU;QAC9B;IACF;AAEA,IAAA,OAAO,UAAU;AACnB;;;;"}
|
package/dist/react/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var useCheckout = require('../chunks/use-checkout-
|
|
4
|
+
var useCheckout = require('../chunks/use-checkout-Bv1EWwHX.cjs');
|
|
5
5
|
require('react/jsx-runtime');
|
|
6
6
|
require('react');
|
|
7
7
|
require('../next/payment-return.cjs');
|
|
8
|
-
require('../chunks/labels-
|
|
8
|
+
require('../chunks/labels-DCruUx_W.cjs');
|
|
9
9
|
require('@sazito/client-sdk');
|
|
10
10
|
|
|
11
11
|
|
package/dist/react/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { C as CheckoutProvider, S as SazitoProvider, u as useCheckout, a as useCheckoutEngine, b as useSazitoClient } from '../chunks/use-checkout-
|
|
2
|
+
export { C as CheckoutProvider, S as SazitoProvider, u as useCheckout, a as useCheckoutEngine, b as useSazitoClient } from '../chunks/use-checkout-CNJcOUIZ.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '../next/payment-return.js';
|
|
6
|
-
import '../chunks/labels-
|
|
6
|
+
import '../chunks/labels-Cyryfqd7.js';
|
|
7
7
|
import '@sazito/client-sdk';
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/dist/styles.css
CHANGED
|
@@ -1661,7 +1661,7 @@
|
|
|
1661
1661
|
|
|
1662
1662
|
/* ---- result --------------------------------------------------------- */
|
|
1663
1663
|
.szc-result-wrap {
|
|
1664
|
-
padding:
|
|
1664
|
+
padding: clamp(28px, 5vw, 72px) 24px 56px;
|
|
1665
1665
|
display: flex;
|
|
1666
1666
|
justify-content: center;
|
|
1667
1667
|
}
|
|
@@ -1672,37 +1672,113 @@
|
|
|
1672
1672
|
flex-direction: column;
|
|
1673
1673
|
gap: 24px;
|
|
1674
1674
|
}
|
|
1675
|
+
.szc-result--compact {
|
|
1676
|
+
max-width: 620px;
|
|
1677
|
+
}
|
|
1675
1678
|
.szc-result__hero {
|
|
1679
|
+
position: relative;
|
|
1680
|
+
overflow: hidden;
|
|
1676
1681
|
text-align: center;
|
|
1677
1682
|
display: flex;
|
|
1678
1683
|
flex-direction: column;
|
|
1679
1684
|
align-items: center;
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
border:
|
|
1683
|
-
border-radius: calc(var(--szc-radius) * 1.2);
|
|
1685
|
+
padding: clamp(36px, 6vw, 56px) clamp(22px, 5vw, 52px) clamp(32px, 5vw, 48px);
|
|
1686
|
+
border: 1px solid color-mix(in srgb, var(--szc-border) 78%, transparent);
|
|
1687
|
+
border-radius: calc(var(--szc-radius) * 1.35);
|
|
1684
1688
|
background: var(--szc-card);
|
|
1689
|
+
box-shadow: 0 24px 64px color-mix(in srgb, var(--szc-fg) 7%, transparent);
|
|
1690
|
+
}
|
|
1691
|
+
.szc-result__hero::before {
|
|
1692
|
+
content: '';
|
|
1693
|
+
position: absolute;
|
|
1694
|
+
inset-block-start: 0;
|
|
1695
|
+
inset-inline: clamp(36px, 10vw, 92px);
|
|
1696
|
+
height: 3px;
|
|
1697
|
+
border-radius: 0 0 999px 999px;
|
|
1698
|
+
background: var(--szc-result-color, var(--szc-accent));
|
|
1699
|
+
}
|
|
1700
|
+
.szc-result__icon {
|
|
1701
|
+
--szc-result-color: var(--szc-accent);
|
|
1702
|
+
width: 72px;
|
|
1703
|
+
height: 72px;
|
|
1704
|
+
display: inline-flex;
|
|
1705
|
+
align-items: center;
|
|
1706
|
+
justify-content: center;
|
|
1707
|
+
border-radius: calc(var(--szc-radius) * 1.15);
|
|
1708
|
+
color: var(--szc-result-color);
|
|
1709
|
+
background: color-mix(in srgb, var(--szc-result-color) 10%, var(--szc-card));
|
|
1710
|
+
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--szc-result-color) 16%, transparent);
|
|
1711
|
+
}
|
|
1712
|
+
.szc-result__icon-mark {
|
|
1713
|
+
display: inline-flex;
|
|
1714
|
+
align-items: center;
|
|
1715
|
+
justify-content: center;
|
|
1716
|
+
}
|
|
1717
|
+
.szc-result__icon svg {
|
|
1718
|
+
width: 40px;
|
|
1719
|
+
height: 40px;
|
|
1720
|
+
}
|
|
1721
|
+
.szc-result__icon .szc-spinner {
|
|
1722
|
+
width: 28px;
|
|
1723
|
+
height: 28px;
|
|
1724
|
+
border-width: 2.5px;
|
|
1685
1725
|
}
|
|
1686
1726
|
.szc-result--success .szc-result__icon {
|
|
1727
|
+
--szc-result-color: var(--szc-success);
|
|
1687
1728
|
color: var(--szc-success);
|
|
1688
1729
|
}
|
|
1689
1730
|
.szc-result--failed .szc-result__icon,
|
|
1690
1731
|
.szc-result--stock_violated .szc-result__icon {
|
|
1732
|
+
--szc-result-color: var(--szc-danger);
|
|
1691
1733
|
color: var(--szc-danger);
|
|
1692
1734
|
}
|
|
1693
1735
|
.szc-result--pending .szc-result__icon {
|
|
1736
|
+
--szc-result-color: var(--szc-accent);
|
|
1694
1737
|
color: var(--szc-accent);
|
|
1695
1738
|
}
|
|
1739
|
+
.szc-result--success .szc-result__hero {
|
|
1740
|
+
--szc-result-color: var(--szc-success);
|
|
1741
|
+
}
|
|
1742
|
+
.szc-result--failed .szc-result__hero,
|
|
1743
|
+
.szc-result--stock_violated .szc-result__hero {
|
|
1744
|
+
--szc-result-color: var(--szc-danger);
|
|
1745
|
+
}
|
|
1746
|
+
.szc-result__copy {
|
|
1747
|
+
width: min(100%, 540px);
|
|
1748
|
+
display: flex;
|
|
1749
|
+
flex-direction: column;
|
|
1750
|
+
align-items: center;
|
|
1751
|
+
gap: 9px;
|
|
1752
|
+
margin-top: 20px;
|
|
1753
|
+
}
|
|
1696
1754
|
.szc-result__title {
|
|
1697
|
-
margin:
|
|
1698
|
-
|
|
1755
|
+
margin: 0;
|
|
1756
|
+
color: var(--szc-fg);
|
|
1757
|
+
font-size: clamp(20px, 2.4vw, 24px);
|
|
1758
|
+
font-weight: 800;
|
|
1759
|
+
line-height: 1.55;
|
|
1760
|
+
letter-spacing: -0.018em;
|
|
1761
|
+
text-wrap: balance;
|
|
1699
1762
|
}
|
|
1700
1763
|
.szc-result__hint {
|
|
1701
1764
|
max-width: 560px;
|
|
1702
1765
|
margin: 0;
|
|
1703
1766
|
color: var(--szc-muted-fg);
|
|
1704
|
-
font-size:
|
|
1705
|
-
line-height: 1.
|
|
1767
|
+
font-size: 14px;
|
|
1768
|
+
line-height: 1.9;
|
|
1769
|
+
text-wrap: pretty;
|
|
1770
|
+
}
|
|
1771
|
+
.szc-result__message {
|
|
1772
|
+
width: fit-content;
|
|
1773
|
+
max-width: 100%;
|
|
1774
|
+
margin: 3px 0 0;
|
|
1775
|
+
padding: 8px 12px;
|
|
1776
|
+
border-radius: calc(var(--szc-radius) * 0.55);
|
|
1777
|
+
color: color-mix(in srgb, var(--szc-result-color, var(--szc-muted-fg)) 72%, var(--szc-fg));
|
|
1778
|
+
background: color-mix(in srgb, var(--szc-result-color, var(--szc-muted-fg)) 7%, var(--szc-card));
|
|
1779
|
+
font-size: 13px;
|
|
1780
|
+
line-height: 1.65;
|
|
1781
|
+
overflow-wrap: anywhere;
|
|
1706
1782
|
}
|
|
1707
1783
|
.szc-result__reference {
|
|
1708
1784
|
width: min(100%, 540px);
|
|
@@ -1738,12 +1814,37 @@
|
|
|
1738
1814
|
letter-spacing: 0.02em;
|
|
1739
1815
|
}
|
|
1740
1816
|
.szc-result__actions {
|
|
1817
|
+
width: min(100%, 440px);
|
|
1741
1818
|
display: flex;
|
|
1742
1819
|
gap: 10px;
|
|
1743
|
-
margin-top:
|
|
1820
|
+
margin-top: 26px;
|
|
1744
1821
|
flex-wrap: wrap;
|
|
1745
1822
|
justify-content: center;
|
|
1746
1823
|
}
|
|
1824
|
+
.szc-result__actions .szc-btn {
|
|
1825
|
+
min-width: 168px;
|
|
1826
|
+
min-height: 48px;
|
|
1827
|
+
flex: 1;
|
|
1828
|
+
transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease,
|
|
1829
|
+
transform 0.18s ease, box-shadow 0.18s ease;
|
|
1830
|
+
}
|
|
1831
|
+
.szc-result__actions .szc-btn--primary:not(:disabled):hover {
|
|
1832
|
+
box-shadow: 0 8px 18px color-mix(in srgb, var(--szc-accent) 18%, transparent);
|
|
1833
|
+
transform: translateY(-1px);
|
|
1834
|
+
}
|
|
1835
|
+
.szc-result__actions .szc-btn--outline:not(:disabled):hover {
|
|
1836
|
+
border-color: color-mix(in srgb, var(--szc-accent) 36%, var(--szc-border));
|
|
1837
|
+
background: var(--szc-accent-soft);
|
|
1838
|
+
color: var(--szc-accent);
|
|
1839
|
+
transform: translateY(-1px);
|
|
1840
|
+
}
|
|
1841
|
+
.szc-result__actions .szc-btn:not(:disabled):active {
|
|
1842
|
+
transform: translateY(1px) scale(0.985);
|
|
1843
|
+
}
|
|
1844
|
+
.szc-result__actions .szc-btn:focus-visible {
|
|
1845
|
+
outline: 3px solid color-mix(in srgb, var(--szc-accent) 28%, transparent);
|
|
1846
|
+
outline-offset: 3px;
|
|
1847
|
+
}
|
|
1747
1848
|
.szc-result__details {
|
|
1748
1849
|
display: flex;
|
|
1749
1850
|
flex-direction: column;
|
|
@@ -1918,10 +2019,27 @@
|
|
|
1918
2019
|
}
|
|
1919
2020
|
@media (max-width: 640px) {
|
|
1920
2021
|
.szc-result-wrap {
|
|
1921
|
-
padding: 24px 16px
|
|
2022
|
+
padding: 24px 16px 36px;
|
|
1922
2023
|
}
|
|
1923
2024
|
.szc-result__hero {
|
|
1924
|
-
padding:
|
|
2025
|
+
padding: 34px 18px 24px;
|
|
2026
|
+
border-radius: var(--szc-radius);
|
|
2027
|
+
box-shadow: 0 16px 40px color-mix(in srgb, var(--szc-fg) 6%, transparent);
|
|
2028
|
+
}
|
|
2029
|
+
.szc-result__icon {
|
|
2030
|
+
width: 64px;
|
|
2031
|
+
height: 64px;
|
|
2032
|
+
}
|
|
2033
|
+
.szc-result__copy {
|
|
2034
|
+
margin-top: 17px;
|
|
2035
|
+
}
|
|
2036
|
+
.szc-result__actions {
|
|
2037
|
+
flex-direction: column;
|
|
2038
|
+
margin-top: 22px;
|
|
2039
|
+
}
|
|
2040
|
+
.szc-result__actions .szc-btn {
|
|
2041
|
+
width: 100%;
|
|
2042
|
+
min-width: 0;
|
|
1925
2043
|
}
|
|
1926
2044
|
.szc-result__reference {
|
|
1927
2045
|
grid-template-columns: 1fr;
|