@betterstore/react 0.3.76 → 0.3.77

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @betterstore/sdk
2
2
 
3
+ ## 0.3.77
4
+
5
+ ### Patch Changes
6
+
7
+ - payment bug fixes
8
+
3
9
  ## 0.3.76
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -35471,7 +35471,7 @@ function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl,
35471
35471
  !paymentSecretPromiseRef.current) {
35472
35472
  paymentSecretPromiseRef.current = generatePaymentSecret();
35473
35473
  }
35474
- }, [step, checkoutId, clientSecret, paymentSecret, onError]);
35474
+ }, [paymentSecret]);
35475
35475
  const renderStep = () => {
35476
35476
  if (step === "payment" && formData.customer && formData.shipping) {
35477
35477
  return (React.createElement(PaymentForm, { locale: locale, fonts: fonts, checkoutAppearance: checkoutAppearance, paymentSecret: paymentSecret, onSuccess: onSuccess, onError: onError, onBack: handleBack, onDoubleBack: handleDoubleBack, contactEmail: formData.customer.email, shippingAddress: formatAddress(formData.customer.address), shippingName: formData.shipping.name, shippingPrice: storeHelpers.formatPrice(formData.shipping.price, currency, exchangeRate), publicKey: publicKey }));
@@ -35806,7 +35806,9 @@ function CheckoutEmbedComponent({ checkoutId, config }) {
35806
35806
  });
35807
35807
  React.useEffect(() => {
35808
35808
  const interval = setTimeout(() => {
35809
- revalidateDiscounts();
35809
+ if (step !== "payment") {
35810
+ revalidateDiscounts();
35811
+ }
35810
35812
  }, 1000 * 5);
35811
35813
  return () => clearInterval(interval);
35812
35814
  }, []);
package/dist/index.mjs CHANGED
@@ -35451,7 +35451,7 @@ function CheckoutForm({ storeClient, checkoutId, onSuccess, onError, cancelUrl,
35451
35451
  !paymentSecretPromiseRef.current) {
35452
35452
  paymentSecretPromiseRef.current = generatePaymentSecret();
35453
35453
  }
35454
- }, [step, checkoutId, clientSecret, paymentSecret, onError]);
35454
+ }, [paymentSecret]);
35455
35455
  const renderStep = () => {
35456
35456
  if (step === "payment" && formData.customer && formData.shipping) {
35457
35457
  return (React__default.createElement(PaymentForm, { locale: locale, fonts: fonts, checkoutAppearance: checkoutAppearance, paymentSecret: paymentSecret, onSuccess: onSuccess, onError: onError, onBack: handleBack, onDoubleBack: handleDoubleBack, contactEmail: formData.customer.email, shippingAddress: formatAddress(formData.customer.address), shippingName: formData.shipping.name, shippingPrice: storeHelpers.formatPrice(formData.shipping.price, currency, exchangeRate), publicKey: publicKey }));
@@ -35786,7 +35786,9 @@ function CheckoutEmbedComponent({ checkoutId, config }) {
35786
35786
  });
35787
35787
  useEffect(() => {
35788
35788
  const interval = setTimeout(() => {
35789
- revalidateDiscounts();
35789
+ if (step !== "payment") {
35790
+ revalidateDiscounts();
35791
+ }
35790
35792
  }, 1000 * 5);
35791
35793
  return () => clearInterval(interval);
35792
35794
  }, []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterstore/react",
3
- "version": "0.3.76",
3
+ "version": "0.3.77",
4
4
  "description": "E-commerce for Developers",
5
5
  "private": false,
6
6
  "publishConfig": {