@pelcro/react-pelcro-js 4.0.0-alpha.73 → 4.0.0-alpha.75

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 CHANGED
@@ -3427,7 +3427,8 @@ var messages$16 = {
3427
3427
  },
3428
3428
  invoicePayment: {
3429
3429
  title: "Invoice paid successfully",
3430
- content: "Please contact us if you have any questions or concerns."
3430
+ content: "Please contact us if you have any questions or concerns.",
3431
+ paymentProcessing: "Invoice payment is currently being processed"
3431
3432
  }
3432
3433
  };
3433
3434
  var errors$j = {
@@ -23862,13 +23863,10 @@ const PaymentMethodContainerWithoutStripe = ({
23862
23863
  type: LOADING,
23863
23864
  payload: false
23864
23865
  });
23865
- return dispatch({
23866
- type: SHOW_ALERT,
23867
- payload: {
23868
- type: "success",
23869
- content: t("messages.paymentProcessing")
23870
- }
23866
+ set({
23867
+ isProcessingInvoice: true
23871
23868
  });
23869
+ return onSuccess(response);
23872
23870
  } else {
23873
23871
  onSuccess(response);
23874
23872
  }
@@ -25262,7 +25260,8 @@ const PaymentMethodContainer = props => {
25262
25260
 
25263
25261
  const [isStripeLoaded, setIsStripeLoaded] = React.useState(Boolean(window.Stripe));
25264
25262
  const {
25265
- whenUserReady
25263
+ whenUserReady,
25264
+ selectedPaymentMethodId
25266
25265
  } = usePelcro.getStore();
25267
25266
  const cardProcessor = getSiteCardProcessor(); // Create the Stripe object
25268
25267
 
@@ -25284,7 +25283,7 @@ const PaymentMethodContainer = props => {
25284
25283
  loader: "always"
25285
25284
  };
25286
25285
  React.useEffect(() => {
25287
- if (isStripeLoaded) {
25286
+ if (isStripeLoaded && !selectedPaymentMethodId) {
25288
25287
  window.Pelcro.user.createSetupIntent({
25289
25288
  auth_token: window.Pelcro.user.read().auth_token
25290
25289
  }, (err, res) => {
@@ -25310,7 +25309,7 @@ const PaymentMethodContainer = props => {
25310
25309
  }, []); // eslint-disable-line react-hooks/exhaustive-deps
25311
25310
 
25312
25311
  if (isStripeLoaded) {
25313
- return /*#__PURE__*/React__default['default'].createElement("div", null, clientSecret ? /*#__PURE__*/React__default['default'].createElement(Elements, {
25312
+ return /*#__PURE__*/React__default['default'].createElement("div", null, clientSecret || selectedPaymentMethodId ? /*#__PURE__*/React__default['default'].createElement(Elements, {
25314
25313
  options: options,
25315
25314
  stripe: stripePromise
25316
25315
  }, /*#__PURE__*/React__default['default'].createElement(PaymentMethodContainerWithoutStripe, Object.assign({
@@ -27782,7 +27781,8 @@ const getSuccessContent = i18n => {
27782
27781
 
27783
27782
  const flow = getCurrentFlow();
27784
27783
  const {
27785
- product
27784
+ product,
27785
+ isProcessingInvoice
27786
27786
  } = usePelcro.getStore();
27787
27787
  const wordingDictionary = {
27788
27788
  subscriptionSuccess: {
@@ -27810,7 +27810,7 @@ const getSuccessContent = i18n => {
27810
27810
  successIcon: /*#__PURE__*/React__default['default'].createElement(SvgCheckSolid, {
27811
27811
  className: "plc-w-32 plc-my-4 plc-text-green-500"
27812
27812
  }),
27813
- successTitle: i18n("messages.invoicePayment.title"),
27813
+ successTitle: isProcessingInvoice ? i18n("messages.invoicePayment.paymentProcessing") : i18n("messages.invoicePayment.title"),
27814
27814
  successContent: i18n("messages.invoicePayment.content")
27815
27815
  }
27816
27816
  };
@@ -27840,7 +27840,9 @@ function PaymentSuccessModal({
27840
27840
  id: "pelcro-subscription-success-modal",
27841
27841
  onDisplay: onDisplay,
27842
27842
  onClose: onClose
27843
- }, /*#__PURE__*/React__default['default'].createElement(ModalBody, null, /*#__PURE__*/React__default['default'].createElement(PaymentSuccessView, {
27843
+ }, /*#__PURE__*/React__default['default'].createElement(ModalBody, {
27844
+ className: "plc-rounded-t-lg"
27845
+ }, /*#__PURE__*/React__default['default'].createElement(PaymentSuccessView, {
27844
27846
  onClose: onClose
27845
27847
  })), /*#__PURE__*/React__default['default'].createElement(ModalFooter, null));
27846
27848
  }
package/dist/index.esm.js CHANGED
@@ -3397,7 +3397,8 @@ var messages$16 = {
3397
3397
  },
3398
3398
  invoicePayment: {
3399
3399
  title: "Invoice paid successfully",
3400
- content: "Please contact us if you have any questions or concerns."
3400
+ content: "Please contact us if you have any questions or concerns.",
3401
+ paymentProcessing: "Invoice payment is currently being processed"
3401
3402
  }
3402
3403
  };
3403
3404
  var errors$j = {
@@ -23832,13 +23833,10 @@ const PaymentMethodContainerWithoutStripe = ({
23832
23833
  type: LOADING,
23833
23834
  payload: false
23834
23835
  });
23835
- return dispatch({
23836
- type: SHOW_ALERT,
23837
- payload: {
23838
- type: "success",
23839
- content: t("messages.paymentProcessing")
23840
- }
23836
+ set({
23837
+ isProcessingInvoice: true
23841
23838
  });
23839
+ return onSuccess(response);
23842
23840
  } else {
23843
23841
  onSuccess(response);
23844
23842
  }
@@ -25232,7 +25230,8 @@ const PaymentMethodContainer = props => {
25232
25230
 
25233
25231
  const [isStripeLoaded, setIsStripeLoaded] = useState(Boolean(window.Stripe));
25234
25232
  const {
25235
- whenUserReady
25233
+ whenUserReady,
25234
+ selectedPaymentMethodId
25236
25235
  } = usePelcro.getStore();
25237
25236
  const cardProcessor = getSiteCardProcessor(); // Create the Stripe object
25238
25237
 
@@ -25254,7 +25253,7 @@ const PaymentMethodContainer = props => {
25254
25253
  loader: "always"
25255
25254
  };
25256
25255
  useEffect(() => {
25257
- if (isStripeLoaded) {
25256
+ if (isStripeLoaded && !selectedPaymentMethodId) {
25258
25257
  window.Pelcro.user.createSetupIntent({
25259
25258
  auth_token: window.Pelcro.user.read().auth_token
25260
25259
  }, (err, res) => {
@@ -25280,7 +25279,7 @@ const PaymentMethodContainer = props => {
25280
25279
  }, []); // eslint-disable-line react-hooks/exhaustive-deps
25281
25280
 
25282
25281
  if (isStripeLoaded) {
25283
- return /*#__PURE__*/React__default.createElement("div", null, clientSecret ? /*#__PURE__*/React__default.createElement(Elements, {
25282
+ return /*#__PURE__*/React__default.createElement("div", null, clientSecret || selectedPaymentMethodId ? /*#__PURE__*/React__default.createElement(Elements, {
25284
25283
  options: options,
25285
25284
  stripe: stripePromise
25286
25285
  }, /*#__PURE__*/React__default.createElement(PaymentMethodContainerWithoutStripe, Object.assign({
@@ -27752,7 +27751,8 @@ const getSuccessContent = i18n => {
27752
27751
 
27753
27752
  const flow = getCurrentFlow();
27754
27753
  const {
27755
- product
27754
+ product,
27755
+ isProcessingInvoice
27756
27756
  } = usePelcro.getStore();
27757
27757
  const wordingDictionary = {
27758
27758
  subscriptionSuccess: {
@@ -27780,7 +27780,7 @@ const getSuccessContent = i18n => {
27780
27780
  successIcon: /*#__PURE__*/React__default.createElement(SvgCheckSolid, {
27781
27781
  className: "plc-w-32 plc-my-4 plc-text-green-500"
27782
27782
  }),
27783
- successTitle: i18n("messages.invoicePayment.title"),
27783
+ successTitle: isProcessingInvoice ? i18n("messages.invoicePayment.paymentProcessing") : i18n("messages.invoicePayment.title"),
27784
27784
  successContent: i18n("messages.invoicePayment.content")
27785
27785
  }
27786
27786
  };
@@ -27810,7 +27810,9 @@ function PaymentSuccessModal({
27810
27810
  id: "pelcro-subscription-success-modal",
27811
27811
  onDisplay: onDisplay,
27812
27812
  onClose: onClose
27813
- }, /*#__PURE__*/React__default.createElement(ModalBody, null, /*#__PURE__*/React__default.createElement(PaymentSuccessView, {
27813
+ }, /*#__PURE__*/React__default.createElement(ModalBody, {
27814
+ className: "plc-rounded-t-lg"
27815
+ }, /*#__PURE__*/React__default.createElement(PaymentSuccessView, {
27814
27816
  onClose: onClose
27815
27817
  })), /*#__PURE__*/React__default.createElement(ModalFooter, null));
27816
27818
  }
package/dist/pelcro.css CHANGED
@@ -2911,6 +2911,11 @@ apple-pay-button {
2911
2911
  border-radius: 9999px;
2912
2912
  }
2913
2913
 
2914
+ .pelcro-root .plc-rounded-t-lg{
2915
+ border-top-left-radius: 0.5rem;
2916
+ border-top-right-radius: 0.5rem;
2917
+ }
2918
+
2914
2919
  .pelcro-root .plc-rounded-b-sm{
2915
2920
  border-bottom-right-radius: 0.125rem;
2916
2921
  border-bottom-left-radius: 0.125rem;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "4.0.0-alpha.73",
4
+ "version": "4.0.0-alpha.75",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",