@pelcro/react-pelcro-js 3.6.0-beta.30 → 3.6.0-beta.31

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
@@ -4935,7 +4935,8 @@ var messages$h = {
4935
4935
  successfully: "avec succès.",
4936
4936
  sourceUpdated: "Vos informations de paiement ont été mises à jour",
4937
4937
  cardAuthFailed: "Nous ne parvenons pas à authentifier votre mode de paiement. Veuillez choisir un autre mode de paiement et essayer à nouveau.",
4938
- cardAuthNotSupported: "Votre carte ne peut être mise à jour puisqu'elle nécessite une authentification. Veuillez utiliser un autre mode de paiement ou contacter le service client."
4938
+ cardAuthNotSupported: "Votre carte ne peut être mise à jour puisqu'elle nécessite une authentification. Veuillez utiliser un autre mode de paiement ou contacter le service client.",
4939
+ tryAgainFromInvoice: "Nous n'avons pas pu authentifier votre paiement, mais votre abonnement a été créé. Veuillez essayer de payer la facture en utilisant un autre mode de paiement depuis le tableau de bord."
4939
4940
  };
4940
4941
  var errors$2 = {
4941
4942
  "": ""
@@ -4975,7 +4976,8 @@ var messages$g = {
4975
4976
  successfully: "successfully",
4976
4977
  sourceUpdated: "Your payment information has been updated",
4977
4978
  cardAuthFailed: "We are unable to authenticate your payment method. Please choose a different payment method and try again.",
4978
- cardAuthNotSupported: "Updating your payment method to one that requires authentication is currently not possible. Please use a different payment method or contact customer service."
4979
+ cardAuthNotSupported: "Updating your payment method to one that requires authentication is currently not possible. Please use a different payment method or contact customer service.",
4980
+ tryAgainFromInvoice: "We were unable to authenticate your payment, however your subscription was created. Please attempt to pay for the invoice using another payment method from the dashboard."
4979
4981
  };
4980
4982
  var errors$1 = {
4981
4983
  "": ""
@@ -5015,7 +5017,8 @@ var messages$f = {
5015
5017
  successfully: "님께 성공적으로 전송되었습니다.",
5016
5018
  sourceUpdated: "귀하의 결제 정보가 업데이트되었습니다.",
5017
5019
  cardAuthFailed: "해당 결제 수단은 인증할 수 없습니다. 다른 결제 수단을 선택하여 다시 시도해보시기 바랍니다.",
5018
- cardAuthNotSupported: "인증이 요구되는 결제 수단으로의 업데이트는 현재 지원되지 않습니다. 다른 결제 수단을 이용하거나 고객센터로 문의하시기 바랍니다."
5020
+ cardAuthNotSupported: "인증이 요구되는 결제 수단으로의 업데이트는 현재 지원되지 않습니다. 다른 결제 수단을 이용하거나 고객센터로 문의하시기 바랍니다.",
5021
+ tryAgainFromInvoice: "결제를 인증할 수 없지만 구독이 생성되었습니다. 대시보드에서 다른 결제 수단을 사용하여 인보이스 결제를 시도하세요."
5019
5022
  };
5020
5023
  var errors = {
5021
5024
  "": ""
@@ -16042,7 +16045,7 @@ const PaymentMethodContainerWithoutStripe = ({
16042
16045
  */
16043
16046
 
16044
16047
 
16045
- const confirmStripeCardPayment = (response, error) => {
16048
+ const confirmStripeCardPayment = (response, error, isSubCreate = false) => {
16046
16049
  if (response) {
16047
16050
  var _response$data;
16048
16051
 
@@ -16050,11 +16053,13 @@ const PaymentMethodContainerWithoutStripe = ({
16050
16053
 
16051
16054
  if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === "requires_action" && paymentIntent !== null && paymentIntent !== void 0 && paymentIntent.client_secret) {
16052
16055
  stripe.confirmCardPayment(paymentIntent.client_secret).then(res => {
16053
- console.log("The validation response", res);
16054
- dispatch({
16055
- type: DISABLE_SUBMIT,
16056
- payload: false
16057
- });
16056
+ if (!isSubCreate) {
16057
+ dispatch({
16058
+ type: DISABLE_SUBMIT,
16059
+ payload: false
16060
+ });
16061
+ }
16062
+
16058
16063
  dispatch({
16059
16064
  type: LOADING,
16060
16065
  payload: false
@@ -16066,7 +16071,7 @@ const PaymentMethodContainerWithoutStripe = ({
16066
16071
  type: SHOW_ALERT,
16067
16072
  payload: {
16068
16073
  type: "error",
16069
- content: getErrorMessages(res.error)
16074
+ content: isSubCreate ? t("messages.tryAgainFromInvoice") : getErrorMessages(res.error)
16070
16075
  }
16071
16076
  });
16072
16077
  }
@@ -16074,10 +16079,13 @@ const PaymentMethodContainerWithoutStripe = ({
16074
16079
  onSuccess(res);
16075
16080
  });
16076
16081
  } else if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === "requires_payment_method" && paymentIntent !== null && paymentIntent !== void 0 && paymentIntent.client_secret) {
16077
- dispatch({
16078
- type: DISABLE_SUBMIT,
16079
- payload: false
16080
- });
16082
+ if (!isSubCreate) {
16083
+ dispatch({
16084
+ type: DISABLE_SUBMIT,
16085
+ payload: false
16086
+ });
16087
+ }
16088
+
16081
16089
  dispatch({
16082
16090
  type: LOADING,
16083
16091
  payload: false
@@ -16086,7 +16094,7 @@ const PaymentMethodContainerWithoutStripe = ({
16086
16094
  type: SHOW_ALERT,
16087
16095
  payload: {
16088
16096
  type: "error",
16089
- content: t("messages.cardAuthFailed")
16097
+ content: isSubCreate ? t("messages.tryAgainFromInvoice") : t("messages.cardAuthFailed")
16090
16098
  }
16091
16099
  });
16092
16100
  } else {
@@ -16138,7 +16146,7 @@ const PaymentMethodContainerWithoutStripe = ({
16138
16146
  gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
16139
16147
  address_id: product.address_required ? selectedAddressId : null
16140
16148
  }, (err, res) => {
16141
- confirmStripeCardPayment(res, err);
16149
+ confirmStripeCardPayment(res, err, true);
16142
16150
  });
16143
16151
  } else {
16144
16152
  if (isRenewingGift) {
package/dist/index.esm.js CHANGED
@@ -4905,7 +4905,8 @@ var messages$h = {
4905
4905
  successfully: "avec succès.",
4906
4906
  sourceUpdated: "Vos informations de paiement ont été mises à jour",
4907
4907
  cardAuthFailed: "Nous ne parvenons pas à authentifier votre mode de paiement. Veuillez choisir un autre mode de paiement et essayer à nouveau.",
4908
- cardAuthNotSupported: "Votre carte ne peut être mise à jour puisqu'elle nécessite une authentification. Veuillez utiliser un autre mode de paiement ou contacter le service client."
4908
+ cardAuthNotSupported: "Votre carte ne peut être mise à jour puisqu'elle nécessite une authentification. Veuillez utiliser un autre mode de paiement ou contacter le service client.",
4909
+ tryAgainFromInvoice: "Nous n'avons pas pu authentifier votre paiement, mais votre abonnement a été créé. Veuillez essayer de payer la facture en utilisant un autre mode de paiement depuis le tableau de bord."
4909
4910
  };
4910
4911
  var errors$2 = {
4911
4912
  "": ""
@@ -4945,7 +4946,8 @@ var messages$g = {
4945
4946
  successfully: "successfully",
4946
4947
  sourceUpdated: "Your payment information has been updated",
4947
4948
  cardAuthFailed: "We are unable to authenticate your payment method. Please choose a different payment method and try again.",
4948
- cardAuthNotSupported: "Updating your payment method to one that requires authentication is currently not possible. Please use a different payment method or contact customer service."
4949
+ cardAuthNotSupported: "Updating your payment method to one that requires authentication is currently not possible. Please use a different payment method or contact customer service.",
4950
+ tryAgainFromInvoice: "We were unable to authenticate your payment, however your subscription was created. Please attempt to pay for the invoice using another payment method from the dashboard."
4949
4951
  };
4950
4952
  var errors$1 = {
4951
4953
  "": ""
@@ -4985,7 +4987,8 @@ var messages$f = {
4985
4987
  successfully: "님께 성공적으로 전송되었습니다.",
4986
4988
  sourceUpdated: "귀하의 결제 정보가 업데이트되었습니다.",
4987
4989
  cardAuthFailed: "해당 결제 수단은 인증할 수 없습니다. 다른 결제 수단을 선택하여 다시 시도해보시기 바랍니다.",
4988
- cardAuthNotSupported: "인증이 요구되는 결제 수단으로의 업데이트는 현재 지원되지 않습니다. 다른 결제 수단을 이용하거나 고객센터로 문의하시기 바랍니다."
4990
+ cardAuthNotSupported: "인증이 요구되는 결제 수단으로의 업데이트는 현재 지원되지 않습니다. 다른 결제 수단을 이용하거나 고객센터로 문의하시기 바랍니다.",
4991
+ tryAgainFromInvoice: "결제를 인증할 수 없지만 구독이 생성되었습니다. 대시보드에서 다른 결제 수단을 사용하여 인보이스 결제를 시도하세요."
4989
4992
  };
4990
4993
  var errors = {
4991
4994
  "": ""
@@ -16012,7 +16015,7 @@ const PaymentMethodContainerWithoutStripe = ({
16012
16015
  */
16013
16016
 
16014
16017
 
16015
- const confirmStripeCardPayment = (response, error) => {
16018
+ const confirmStripeCardPayment = (response, error, isSubCreate = false) => {
16016
16019
  if (response) {
16017
16020
  var _response$data;
16018
16021
 
@@ -16020,11 +16023,13 @@ const PaymentMethodContainerWithoutStripe = ({
16020
16023
 
16021
16024
  if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === "requires_action" && paymentIntent !== null && paymentIntent !== void 0 && paymentIntent.client_secret) {
16022
16025
  stripe.confirmCardPayment(paymentIntent.client_secret).then(res => {
16023
- console.log("The validation response", res);
16024
- dispatch({
16025
- type: DISABLE_SUBMIT,
16026
- payload: false
16027
- });
16026
+ if (!isSubCreate) {
16027
+ dispatch({
16028
+ type: DISABLE_SUBMIT,
16029
+ payload: false
16030
+ });
16031
+ }
16032
+
16028
16033
  dispatch({
16029
16034
  type: LOADING,
16030
16035
  payload: false
@@ -16036,7 +16041,7 @@ const PaymentMethodContainerWithoutStripe = ({
16036
16041
  type: SHOW_ALERT,
16037
16042
  payload: {
16038
16043
  type: "error",
16039
- content: getErrorMessages(res.error)
16044
+ content: isSubCreate ? t("messages.tryAgainFromInvoice") : getErrorMessages(res.error)
16040
16045
  }
16041
16046
  });
16042
16047
  }
@@ -16044,10 +16049,13 @@ const PaymentMethodContainerWithoutStripe = ({
16044
16049
  onSuccess(res);
16045
16050
  });
16046
16051
  } else if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === "requires_payment_method" && paymentIntent !== null && paymentIntent !== void 0 && paymentIntent.client_secret) {
16047
- dispatch({
16048
- type: DISABLE_SUBMIT,
16049
- payload: false
16050
- });
16052
+ if (!isSubCreate) {
16053
+ dispatch({
16054
+ type: DISABLE_SUBMIT,
16055
+ payload: false
16056
+ });
16057
+ }
16058
+
16051
16059
  dispatch({
16052
16060
  type: LOADING,
16053
16061
  payload: false
@@ -16056,7 +16064,7 @@ const PaymentMethodContainerWithoutStripe = ({
16056
16064
  type: SHOW_ALERT,
16057
16065
  payload: {
16058
16066
  type: "error",
16059
- content: t("messages.cardAuthFailed")
16067
+ content: isSubCreate ? t("messages.tryAgainFromInvoice") : t("messages.cardAuthFailed")
16060
16068
  }
16061
16069
  });
16062
16070
  } else {
@@ -16108,7 +16116,7 @@ const PaymentMethodContainerWithoutStripe = ({
16108
16116
  gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
16109
16117
  address_id: product.address_required ? selectedAddressId : null
16110
16118
  }, (err, res) => {
16111
- confirmStripeCardPayment(res, err);
16119
+ confirmStripeCardPayment(res, err, true);
16112
16120
  });
16113
16121
  } else {
16114
16122
  if (isRenewingGift) {
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": "3.6.0-beta.30",
4
+ "version": "3.6.0-beta.31",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",