@flash-pay/react 2.0.0 → 2.0.1
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/index.cjs.js +7 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.es.js +7 -1
- package/dist/index.es.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -36,6 +36,9 @@ function FlashpayCheckout({
|
|
|
36
36
|
showTitle = true,
|
|
37
37
|
showDescription = true,
|
|
38
38
|
showAmount = true,
|
|
39
|
+
showLogo = true,
|
|
40
|
+
showTerms = true,
|
|
41
|
+
qrEnabled = true,
|
|
39
42
|
style,
|
|
40
43
|
origin
|
|
41
44
|
}) {
|
|
@@ -61,11 +64,14 @@ function FlashpayCheckout({
|
|
|
61
64
|
showTitle,
|
|
62
65
|
showDescription,
|
|
63
66
|
showAmount,
|
|
67
|
+
showLogo,
|
|
68
|
+
showTerms,
|
|
69
|
+
qrEnabled,
|
|
64
70
|
style: styleRef.current,
|
|
65
71
|
origin
|
|
66
72
|
});
|
|
67
73
|
return () => instance.destroy();
|
|
68
|
-
}, [transactionId, showTitle, showDescription, showAmount, origin]);
|
|
74
|
+
}, [transactionId, showTitle, showDescription, showAmount, showLogo, showTerms, qrEnabled, origin]);
|
|
69
75
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: containerRef });
|
|
70
76
|
}
|
|
71
77
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/FlashpayCheckout.tsx"],"sourcesContent":["export { FlashpayCheckout } from \"./FlashpayCheckout\";\nexport type { FlashpayCheckoutProps, PaymentEventData, PaymentData } from \"./FlashpayCheckout\";\n","import { checkout } from \"@flash-pay/browser-sdk\";\nimport type { PaymentEventData, PaymentData } from \"@flash-pay/browser-sdk\";\nimport { useEffect, useRef } from \"react\";\n\nexport type { PaymentEventData, PaymentData };\n\nexport interface FlashpayCheckoutProps {\n transactionId: string;\n onSuccess?: (data: PaymentEventData) => void;\n onFailure?: (data: PaymentEventData) => void;\n onClose?: (data: PaymentEventData) => void;\n showTitle?: boolean;\n showDescription?: boolean;\n showAmount?: boolean;\n style?: Partial<CSSStyleDeclaration>;\n origin?: string;\n}\n\nexport function FlashpayCheckout({\n transactionId,\n onSuccess,\n onFailure,\n onClose,\n showTitle = true,\n showDescription = true,\n showAmount = true,\n style,\n origin,\n}: FlashpayCheckoutProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Stable refs so callback / style identity changes don't re-initialize the SDK\n const onSuccessRef = useRef(onSuccess);\n const onFailureRef = useRef(onFailure);\n const onCloseRef = useRef(onClose);\n const styleRef = useRef(style);\n useEffect(() => {\n onSuccessRef.current = onSuccess;\n onFailureRef.current = onFailure;\n onCloseRef.current = onClose;\n styleRef.current = style;\n });\n\n useEffect(() => {\n if (!containerRef.current) return;\n const instance = checkout({\n transactionId,\n container: containerRef.current,\n onSuccess: (data) => onSuccessRef.current?.(data),\n onFailure: (data) => onFailureRef.current?.(data),\n onClose: (data) => onCloseRef.current?.(data),\n showTitle,\n showDescription,\n showAmount,\n style: styleRef.current,\n origin,\n });\n return () => instance.destroy();\n }, [transactionId, showTitle, showDescription, showAmount, origin]);\n\n return <div ref={containerRef} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,yBAAyB;AAEzB,mBAAkC;
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/FlashpayCheckout.tsx"],"sourcesContent":["export { FlashpayCheckout } from \"./FlashpayCheckout\";\nexport type { FlashpayCheckoutProps, PaymentEventData, PaymentData } from \"./FlashpayCheckout\";\n","import { checkout } from \"@flash-pay/browser-sdk\";\nimport type { PaymentEventData, PaymentData } from \"@flash-pay/browser-sdk\";\nimport { useEffect, useRef } from \"react\";\n\nexport type { PaymentEventData, PaymentData };\n\nexport interface FlashpayCheckoutProps {\n transactionId: string;\n onSuccess?: (data: PaymentEventData) => void;\n onFailure?: (data: PaymentEventData) => void;\n onClose?: (data: PaymentEventData) => void;\n showTitle?: boolean;\n showDescription?: boolean;\n showAmount?: boolean;\n showLogo?: boolean;\n showTerms?: boolean;\n qrEnabled?: boolean;\n style?: Partial<CSSStyleDeclaration>;\n origin?: string;\n}\n\nexport function FlashpayCheckout({\n transactionId,\n onSuccess,\n onFailure,\n onClose,\n showTitle = true,\n showDescription = true,\n showAmount = true,\n showLogo = true,\n showTerms = true,\n qrEnabled = true,\n style,\n origin,\n}: FlashpayCheckoutProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Stable refs so callback / style identity changes don't re-initialize the SDK\n const onSuccessRef = useRef(onSuccess);\n const onFailureRef = useRef(onFailure);\n const onCloseRef = useRef(onClose);\n const styleRef = useRef(style);\n useEffect(() => {\n onSuccessRef.current = onSuccess;\n onFailureRef.current = onFailure;\n onCloseRef.current = onClose;\n styleRef.current = style;\n });\n\n useEffect(() => {\n if (!containerRef.current) return;\n const instance = checkout({\n transactionId,\n container: containerRef.current,\n onSuccess: (data) => onSuccessRef.current?.(data),\n onFailure: (data) => onFailureRef.current?.(data),\n onClose: (data) => onCloseRef.current?.(data),\n showTitle,\n showDescription,\n showAmount,\n showLogo,\n showTerms,\n qrEnabled,\n style: styleRef.current,\n origin,\n });\n return () => instance.destroy();\n }, [transactionId, showTitle, showDescription, showAmount, showLogo, showTerms, qrEnabled, origin]);\n\n return <div ref={containerRef} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,yBAAyB;AAEzB,mBAAkC;AAmEzB;AAhDF,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ;AAAA,EACA;AACF,GAA0B;AACxB,QAAM,mBAAe,qBAAuB,IAAI;AAGhD,QAAM,mBAAe,qBAAO,SAAS;AACrC,QAAM,mBAAe,qBAAO,SAAS;AACrC,QAAM,iBAAa,qBAAO,OAAO;AACjC,QAAM,eAAW,qBAAO,KAAK;AAC7B,8BAAU,MAAM;AACd,iBAAa,UAAU;AACvB,iBAAa,UAAU;AACvB,eAAW,UAAU;AACrB,aAAS,UAAU;AAAA,EACrB,CAAC;AAED,8BAAU,MAAM;AACd,QAAI,CAAC,aAAa,QAAS;AAC3B,UAAM,eAAW,6BAAS;AAAA,MACxB;AAAA,MACA,WAAW,aAAa;AAAA,MACxB,WAAW,CAAC,SAAS,aAAa,UAAU,IAAI;AAAA,MAChD,WAAW,CAAC,SAAS,aAAa,UAAU,IAAI;AAAA,MAChD,SAAS,CAAC,SAAS,WAAW,UAAU,IAAI;AAAA,MAC5C;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO,SAAS;AAAA,MAChB;AAAA,IACF,CAAC;AACD,WAAO,MAAM,SAAS,QAAQ;AAAA,EAChC,GAAG,CAAC,eAAe,WAAW,iBAAiB,YAAY,UAAU,WAAW,WAAW,MAAM,CAAC;AAElG,SAAO,4CAAC,SAAI,KAAK,cAAc;AACjC;","names":[]}
|
package/dist/index.d.mts
CHANGED
|
@@ -10,9 +10,12 @@ interface FlashpayCheckoutProps {
|
|
|
10
10
|
showTitle?: boolean;
|
|
11
11
|
showDescription?: boolean;
|
|
12
12
|
showAmount?: boolean;
|
|
13
|
+
showLogo?: boolean;
|
|
14
|
+
showTerms?: boolean;
|
|
15
|
+
qrEnabled?: boolean;
|
|
13
16
|
style?: Partial<CSSStyleDeclaration>;
|
|
14
17
|
origin?: string;
|
|
15
18
|
}
|
|
16
|
-
declare function FlashpayCheckout({ transactionId, onSuccess, onFailure, onClose, showTitle, showDescription, showAmount, style, origin, }: FlashpayCheckoutProps): react_jsx_runtime.JSX.Element;
|
|
19
|
+
declare function FlashpayCheckout({ transactionId, onSuccess, onFailure, onClose, showTitle, showDescription, showAmount, showLogo, showTerms, qrEnabled, style, origin, }: FlashpayCheckoutProps): react_jsx_runtime.JSX.Element;
|
|
17
20
|
|
|
18
21
|
export { FlashpayCheckout, type FlashpayCheckoutProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -10,9 +10,12 @@ interface FlashpayCheckoutProps {
|
|
|
10
10
|
showTitle?: boolean;
|
|
11
11
|
showDescription?: boolean;
|
|
12
12
|
showAmount?: boolean;
|
|
13
|
+
showLogo?: boolean;
|
|
14
|
+
showTerms?: boolean;
|
|
15
|
+
qrEnabled?: boolean;
|
|
13
16
|
style?: Partial<CSSStyleDeclaration>;
|
|
14
17
|
origin?: string;
|
|
15
18
|
}
|
|
16
|
-
declare function FlashpayCheckout({ transactionId, onSuccess, onFailure, onClose, showTitle, showDescription, showAmount, style, origin, }: FlashpayCheckoutProps): react_jsx_runtime.JSX.Element;
|
|
19
|
+
declare function FlashpayCheckout({ transactionId, onSuccess, onFailure, onClose, showTitle, showDescription, showAmount, showLogo, showTerms, qrEnabled, style, origin, }: FlashpayCheckoutProps): react_jsx_runtime.JSX.Element;
|
|
17
20
|
|
|
18
21
|
export { FlashpayCheckout, type FlashpayCheckoutProps };
|
package/dist/index.es.js
CHANGED
|
@@ -10,6 +10,9 @@ function FlashpayCheckout({
|
|
|
10
10
|
showTitle = true,
|
|
11
11
|
showDescription = true,
|
|
12
12
|
showAmount = true,
|
|
13
|
+
showLogo = true,
|
|
14
|
+
showTerms = true,
|
|
15
|
+
qrEnabled = true,
|
|
13
16
|
style,
|
|
14
17
|
origin
|
|
15
18
|
}) {
|
|
@@ -35,11 +38,14 @@ function FlashpayCheckout({
|
|
|
35
38
|
showTitle,
|
|
36
39
|
showDescription,
|
|
37
40
|
showAmount,
|
|
41
|
+
showLogo,
|
|
42
|
+
showTerms,
|
|
43
|
+
qrEnabled,
|
|
38
44
|
style: styleRef.current,
|
|
39
45
|
origin
|
|
40
46
|
});
|
|
41
47
|
return () => instance.destroy();
|
|
42
|
-
}, [transactionId, showTitle, showDescription, showAmount, origin]);
|
|
48
|
+
}, [transactionId, showTitle, showDescription, showAmount, showLogo, showTerms, qrEnabled, origin]);
|
|
43
49
|
return /* @__PURE__ */ jsx("div", { ref: containerRef });
|
|
44
50
|
}
|
|
45
51
|
export {
|
package/dist/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/FlashpayCheckout.tsx"],"sourcesContent":["import { checkout } from \"@flash-pay/browser-sdk\";\nimport type { PaymentEventData, PaymentData } from \"@flash-pay/browser-sdk\";\nimport { useEffect, useRef } from \"react\";\n\nexport type { PaymentEventData, PaymentData };\n\nexport interface FlashpayCheckoutProps {\n transactionId: string;\n onSuccess?: (data: PaymentEventData) => void;\n onFailure?: (data: PaymentEventData) => void;\n onClose?: (data: PaymentEventData) => void;\n showTitle?: boolean;\n showDescription?: boolean;\n showAmount?: boolean;\n style?: Partial<CSSStyleDeclaration>;\n origin?: string;\n}\n\nexport function FlashpayCheckout({\n transactionId,\n onSuccess,\n onFailure,\n onClose,\n showTitle = true,\n showDescription = true,\n showAmount = true,\n style,\n origin,\n}: FlashpayCheckoutProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Stable refs so callback / style identity changes don't re-initialize the SDK\n const onSuccessRef = useRef(onSuccess);\n const onFailureRef = useRef(onFailure);\n const onCloseRef = useRef(onClose);\n const styleRef = useRef(style);\n useEffect(() => {\n onSuccessRef.current = onSuccess;\n onFailureRef.current = onFailure;\n onCloseRef.current = onClose;\n styleRef.current = style;\n });\n\n useEffect(() => {\n if (!containerRef.current) return;\n const instance = checkout({\n transactionId,\n container: containerRef.current,\n onSuccess: (data) => onSuccessRef.current?.(data),\n onFailure: (data) => onFailureRef.current?.(data),\n onClose: (data) => onCloseRef.current?.(data),\n showTitle,\n showDescription,\n showAmount,\n style: styleRef.current,\n origin,\n });\n return () => instance.destroy();\n }, [transactionId, showTitle, showDescription, showAmount, origin]);\n\n return <div ref={containerRef} />;\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AAEzB,SAAS,WAAW,cAAc;
|
|
1
|
+
{"version":3,"sources":["../src/FlashpayCheckout.tsx"],"sourcesContent":["import { checkout } from \"@flash-pay/browser-sdk\";\nimport type { PaymentEventData, PaymentData } from \"@flash-pay/browser-sdk\";\nimport { useEffect, useRef } from \"react\";\n\nexport type { PaymentEventData, PaymentData };\n\nexport interface FlashpayCheckoutProps {\n transactionId: string;\n onSuccess?: (data: PaymentEventData) => void;\n onFailure?: (data: PaymentEventData) => void;\n onClose?: (data: PaymentEventData) => void;\n showTitle?: boolean;\n showDescription?: boolean;\n showAmount?: boolean;\n showLogo?: boolean;\n showTerms?: boolean;\n qrEnabled?: boolean;\n style?: Partial<CSSStyleDeclaration>;\n origin?: string;\n}\n\nexport function FlashpayCheckout({\n transactionId,\n onSuccess,\n onFailure,\n onClose,\n showTitle = true,\n showDescription = true,\n showAmount = true,\n showLogo = true,\n showTerms = true,\n qrEnabled = true,\n style,\n origin,\n}: FlashpayCheckoutProps) {\n const containerRef = useRef<HTMLDivElement>(null);\n\n // Stable refs so callback / style identity changes don't re-initialize the SDK\n const onSuccessRef = useRef(onSuccess);\n const onFailureRef = useRef(onFailure);\n const onCloseRef = useRef(onClose);\n const styleRef = useRef(style);\n useEffect(() => {\n onSuccessRef.current = onSuccess;\n onFailureRef.current = onFailure;\n onCloseRef.current = onClose;\n styleRef.current = style;\n });\n\n useEffect(() => {\n if (!containerRef.current) return;\n const instance = checkout({\n transactionId,\n container: containerRef.current,\n onSuccess: (data) => onSuccessRef.current?.(data),\n onFailure: (data) => onFailureRef.current?.(data),\n onClose: (data) => onCloseRef.current?.(data),\n showTitle,\n showDescription,\n showAmount,\n showLogo,\n showTerms,\n qrEnabled,\n style: styleRef.current,\n origin,\n });\n return () => instance.destroy();\n }, [transactionId, showTitle, showDescription, showAmount, showLogo, showTerms, qrEnabled, origin]);\n\n return <div ref={containerRef} />;\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AAEzB,SAAS,WAAW,cAAc;AAmEzB;AAhDF,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ;AAAA,EACA;AACF,GAA0B;AACxB,QAAM,eAAe,OAAuB,IAAI;AAGhD,QAAM,eAAe,OAAO,SAAS;AACrC,QAAM,eAAe,OAAO,SAAS;AACrC,QAAM,aAAa,OAAO,OAAO;AACjC,QAAM,WAAW,OAAO,KAAK;AAC7B,YAAU,MAAM;AACd,iBAAa,UAAU;AACvB,iBAAa,UAAU;AACvB,eAAW,UAAU;AACrB,aAAS,UAAU;AAAA,EACrB,CAAC;AAED,YAAU,MAAM;AACd,QAAI,CAAC,aAAa,QAAS;AAC3B,UAAM,WAAW,SAAS;AAAA,MACxB;AAAA,MACA,WAAW,aAAa;AAAA,MACxB,WAAW,CAAC,SAAS,aAAa,UAAU,IAAI;AAAA,MAChD,WAAW,CAAC,SAAS,aAAa,UAAU,IAAI;AAAA,MAChD,SAAS,CAAC,SAAS,WAAW,UAAU,IAAI;AAAA,MAC5C;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO,SAAS;AAAA,MAChB;AAAA,IACF,CAAC;AACD,WAAO,MAAM,SAAS,QAAQ;AAAA,EAChC,GAAG,CAAC,eAAe,WAAW,iBAAiB,YAAY,UAAU,WAAW,WAAW,MAAM,CAAC;AAElG,SAAO,oBAAC,SAAI,KAAK,cAAc;AACjC;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flash-pay/react",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Flashpay React component wrapper",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"test:watch": "vitest"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@flash-pay/browser-sdk": ">=2.0.
|
|
26
|
+
"@flash-pay/browser-sdk": ">=2.0.1",
|
|
27
27
|
"react": ">=18.0.0",
|
|
28
28
|
"react-dom": ">=18.0.0"
|
|
29
29
|
},
|