@pelcro/react-pelcro-js 3.10.1-beta.3 → 3.10.1-beta.4
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 +10 -5
- package/dist/index.esm.js +10 -5
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -17084,12 +17084,17 @@ const UnwrappedForm = es_12(PaymentMethodContainerWithoutStripe);
|
|
|
17084
17084
|
|
|
17085
17085
|
const PaymentMethodContainer = props => {
|
|
17086
17086
|
const [isStripeLoaded, setIsStripeLoaded] = React.useState(Boolean(window.Stripe));
|
|
17087
|
+
const {
|
|
17088
|
+
whenUserReady
|
|
17089
|
+
} = usePelcro.getStore();
|
|
17087
17090
|
React.useEffect(() => {
|
|
17088
|
-
|
|
17089
|
-
|
|
17090
|
-
|
|
17091
|
-
|
|
17092
|
-
|
|
17091
|
+
whenUserReady(() => {
|
|
17092
|
+
if (!window.Stripe) {
|
|
17093
|
+
document.querySelector('script[src="https://js.stripe.com/v3"]').addEventListener("load", () => {
|
|
17094
|
+
setIsStripeLoaded(true);
|
|
17095
|
+
});
|
|
17096
|
+
}
|
|
17097
|
+
});
|
|
17093
17098
|
}, []);
|
|
17094
17099
|
|
|
17095
17100
|
if (isStripeLoaded) {
|
package/dist/index.esm.js
CHANGED
|
@@ -17054,12 +17054,17 @@ const UnwrappedForm = es_12(PaymentMethodContainerWithoutStripe);
|
|
|
17054
17054
|
|
|
17055
17055
|
const PaymentMethodContainer = props => {
|
|
17056
17056
|
const [isStripeLoaded, setIsStripeLoaded] = useState(Boolean(window.Stripe));
|
|
17057
|
+
const {
|
|
17058
|
+
whenUserReady
|
|
17059
|
+
} = usePelcro.getStore();
|
|
17057
17060
|
useEffect(() => {
|
|
17058
|
-
|
|
17059
|
-
|
|
17060
|
-
|
|
17061
|
-
|
|
17062
|
-
|
|
17061
|
+
whenUserReady(() => {
|
|
17062
|
+
if (!window.Stripe) {
|
|
17063
|
+
document.querySelector('script[src="https://js.stripe.com/v3"]').addEventListener("load", () => {
|
|
17064
|
+
setIsStripeLoaded(true);
|
|
17065
|
+
});
|
|
17066
|
+
}
|
|
17067
|
+
});
|
|
17063
17068
|
}, []);
|
|
17064
17069
|
|
|
17065
17070
|
if (isStripeLoaded) {
|