@pelcro/react-pelcro-js 4.0.0-alpha.96 → 4.0.0-alpha.98
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 +94 -45
- package/dist/index.esm.js +94 -45
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -29803,12 +29803,13 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
29803
29803
|
* @param {boolean} isSubCreate
|
|
29804
29804
|
* @return {*}
|
|
29805
29805
|
*/
|
|
29806
|
-
const confirmStripeCardPayment = (response, error, isSubCreate = false) => {
|
|
29807
|
-
|
|
29808
|
-
|
|
29809
|
-
|
|
29810
|
-
|
|
29811
|
-
|
|
29806
|
+
const confirmStripeCardPayment = async (response, error, isSubCreate = false) => {
|
|
29807
|
+
try {
|
|
29808
|
+
if (response) {
|
|
29809
|
+
var _response$data;
|
|
29810
|
+
const paymentIntent = (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.payment_intent;
|
|
29811
|
+
if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === "requires_action" && paymentIntent !== null && paymentIntent !== void 0 && paymentIntent.client_secret) {
|
|
29812
|
+
const res = await stripe.confirmCardPayment(paymentIntent.client_secret);
|
|
29812
29813
|
if (!isSubCreate) {
|
|
29813
29814
|
dispatch({
|
|
29814
29815
|
type: DISABLE_SUBMIT,
|
|
@@ -29820,6 +29821,21 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
29820
29821
|
payload: false
|
|
29821
29822
|
});
|
|
29822
29823
|
if (res.error) {
|
|
29824
|
+
notifyBugsnag(() => {
|
|
29825
|
+
// eslint-disable-next-line no-undef
|
|
29826
|
+
Bugsnag.notify(`Payment ${res.error}`, event => {
|
|
29827
|
+
var _error$response, _error$response$data, _error$response$data$, _window$Pelcro3, _window$Pelcro3$site, _window$Pelcro4, _window$Pelcro4$user, _window$Pelcro5;
|
|
29828
|
+
event.addMetadata("Stripe Error MetaData", {
|
|
29829
|
+
message: res.error.message,
|
|
29830
|
+
type: res.error.type,
|
|
29831
|
+
code: res.error.code,
|
|
29832
|
+
error_message: error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.error) === null || _error$response$data$ === void 0 ? void 0 : _error$response$data$.message,
|
|
29833
|
+
site: (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$site = _window$Pelcro3.site) === null || _window$Pelcro3$site === void 0 ? void 0 : _window$Pelcro3$site.read(),
|
|
29834
|
+
user: (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : (_window$Pelcro4$user = _window$Pelcro4.user) === null || _window$Pelcro4$user === void 0 ? void 0 : _window$Pelcro4$user.read(),
|
|
29835
|
+
environment: (_window$Pelcro5 = window.Pelcro) === null || _window$Pelcro5 === void 0 ? void 0 : _window$Pelcro5.environment
|
|
29836
|
+
});
|
|
29837
|
+
});
|
|
29838
|
+
});
|
|
29823
29839
|
onFailure(res.error);
|
|
29824
29840
|
return dispatch({
|
|
29825
29841
|
type: SHOW_ALERT,
|
|
@@ -29830,45 +29846,81 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
29830
29846
|
});
|
|
29831
29847
|
}
|
|
29832
29848
|
onSuccess(res);
|
|
29833
|
-
})
|
|
29834
|
-
|
|
29835
|
-
|
|
29849
|
+
} else if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === "requires_payment_method" && paymentIntent !== null && paymentIntent !== void 0 && paymentIntent.client_secret) {
|
|
29850
|
+
if (!isSubCreate) {
|
|
29851
|
+
dispatch({
|
|
29852
|
+
type: DISABLE_SUBMIT,
|
|
29853
|
+
payload: false
|
|
29854
|
+
});
|
|
29855
|
+
}
|
|
29836
29856
|
dispatch({
|
|
29837
|
-
type:
|
|
29857
|
+
type: LOADING,
|
|
29838
29858
|
payload: false
|
|
29839
29859
|
});
|
|
29860
|
+
onFailure(error);
|
|
29861
|
+
return dispatch({
|
|
29862
|
+
type: SHOW_ALERT,
|
|
29863
|
+
payload: {
|
|
29864
|
+
type: "error",
|
|
29865
|
+
content: isSubCreate ? t("messages.tryAgainFromInvoice") : t("messages.cardAuthFailed")
|
|
29866
|
+
}
|
|
29867
|
+
});
|
|
29868
|
+
} else {
|
|
29869
|
+
onSuccess(response);
|
|
29840
29870
|
}
|
|
29871
|
+
} else {
|
|
29841
29872
|
dispatch({
|
|
29842
|
-
type:
|
|
29873
|
+
type: DISABLE_SUBMIT,
|
|
29843
29874
|
payload: false
|
|
29844
29875
|
});
|
|
29845
|
-
onFailure(error);
|
|
29846
|
-
return dispatch({
|
|
29847
|
-
type: SHOW_ALERT,
|
|
29848
|
-
payload: {
|
|
29849
|
-
type: "error",
|
|
29850
|
-
content: isSubCreate ? t("messages.tryAgainFromInvoice") : t("messages.cardAuthFailed")
|
|
29851
|
-
}
|
|
29852
|
-
});
|
|
29853
|
-
} else if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === "processing" && paymentIntent !== null && paymentIntent !== void 0 && paymentIntent.client_secret) {
|
|
29854
|
-
if (!isSubCreate) {
|
|
29855
|
-
dispatch({
|
|
29856
|
-
type: DISABLE_SUBMIT,
|
|
29857
|
-
payload: false
|
|
29858
|
-
});
|
|
29859
|
-
}
|
|
29860
29876
|
dispatch({
|
|
29861
29877
|
type: LOADING,
|
|
29862
29878
|
payload: false
|
|
29863
29879
|
});
|
|
29864
|
-
|
|
29865
|
-
|
|
29866
|
-
|
|
29867
|
-
|
|
29868
|
-
|
|
29880
|
+
if (error) {
|
|
29881
|
+
notifyBugsnag(() => {
|
|
29882
|
+
// eslint-disable-next-line no-undef
|
|
29883
|
+
Bugsnag.notify(`Payment ${error}`, event => {
|
|
29884
|
+
var _error$response2, _error$response3, _error$response3$data, _error$response3$data2, _window$Pelcro6, _window$Pelcro6$site, _window$Pelcro7, _window$Pelcro7$user, _window$Pelcro8;
|
|
29885
|
+
event.addMetadata("MetaData", {
|
|
29886
|
+
name: error === null || error === void 0 ? void 0 : error.name,
|
|
29887
|
+
message: error === null || error === void 0 ? void 0 : error.message,
|
|
29888
|
+
type: error === null || error === void 0 ? void 0 : error.type,
|
|
29889
|
+
code: error === null || error === void 0 ? void 0 : error.code,
|
|
29890
|
+
status: error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.status,
|
|
29891
|
+
error_message: error === null || error === void 0 ? void 0 : (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : (_error$response3$data = _error$response3.data) === null || _error$response3$data === void 0 ? void 0 : (_error$response3$data2 = _error$response3$data.error) === null || _error$response3$data2 === void 0 ? void 0 : _error$response3$data2.message,
|
|
29892
|
+
site: (_window$Pelcro6 = window.Pelcro) === null || _window$Pelcro6 === void 0 ? void 0 : (_window$Pelcro6$site = _window$Pelcro6.site) === null || _window$Pelcro6$site === void 0 ? void 0 : _window$Pelcro6$site.read(),
|
|
29893
|
+
user: (_window$Pelcro7 = window.Pelcro) === null || _window$Pelcro7 === void 0 ? void 0 : (_window$Pelcro7$user = _window$Pelcro7.user) === null || _window$Pelcro7$user === void 0 ? void 0 : _window$Pelcro7$user.read(),
|
|
29894
|
+
environment: (_window$Pelcro8 = window.Pelcro) === null || _window$Pelcro8 === void 0 ? void 0 : _window$Pelcro8.environment
|
|
29895
|
+
});
|
|
29896
|
+
});
|
|
29897
|
+
});
|
|
29898
|
+
onFailure(error);
|
|
29899
|
+
return dispatch({
|
|
29900
|
+
type: SHOW_ALERT,
|
|
29901
|
+
payload: {
|
|
29902
|
+
type: "error",
|
|
29903
|
+
content: getErrorMessages(error)
|
|
29904
|
+
}
|
|
29905
|
+
});
|
|
29906
|
+
}
|
|
29869
29907
|
onSuccess(response);
|
|
29870
29908
|
}
|
|
29871
|
-
}
|
|
29909
|
+
} catch (error) {
|
|
29910
|
+
notifyBugsnag(() => {
|
|
29911
|
+
// eslint-disable-next-line no-undef
|
|
29912
|
+
Bugsnag.notify(`Payment ${error}`, event => {
|
|
29913
|
+
var _error$response4, _error$response4$data, _error$response4$data2, _window$Pelcro9, _window$Pelcro9$site, _window$Pelcro10, _window$Pelcro10$user, _window$Pelcro11;
|
|
29914
|
+
event.addMetadata("UnexpectedError", {
|
|
29915
|
+
message: error.message,
|
|
29916
|
+
stack: error.stack,
|
|
29917
|
+
error_message: error === null || error === void 0 ? void 0 : (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : (_error$response4$data = _error$response4.data) === null || _error$response4$data === void 0 ? void 0 : (_error$response4$data2 = _error$response4$data.error) === null || _error$response4$data2 === void 0 ? void 0 : _error$response4$data2.message,
|
|
29918
|
+
site: (_window$Pelcro9 = window.Pelcro) === null || _window$Pelcro9 === void 0 ? void 0 : (_window$Pelcro9$site = _window$Pelcro9.site) === null || _window$Pelcro9$site === void 0 ? void 0 : _window$Pelcro9$site.read(),
|
|
29919
|
+
user: (_window$Pelcro10 = window.Pelcro) === null || _window$Pelcro10 === void 0 ? void 0 : (_window$Pelcro10$user = _window$Pelcro10.user) === null || _window$Pelcro10$user === void 0 ? void 0 : _window$Pelcro10$user.read(),
|
|
29920
|
+
environment: (_window$Pelcro11 = window.Pelcro) === null || _window$Pelcro11 === void 0 ? void 0 : _window$Pelcro11.environment
|
|
29921
|
+
});
|
|
29922
|
+
});
|
|
29923
|
+
});
|
|
29872
29924
|
dispatch({
|
|
29873
29925
|
type: DISABLE_SUBMIT,
|
|
29874
29926
|
payload: false
|
|
@@ -29877,17 +29929,14 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
29877
29929
|
type: LOADING,
|
|
29878
29930
|
payload: false
|
|
29879
29931
|
});
|
|
29880
|
-
|
|
29881
|
-
|
|
29882
|
-
|
|
29883
|
-
|
|
29884
|
-
|
|
29885
|
-
|
|
29886
|
-
|
|
29887
|
-
|
|
29888
|
-
});
|
|
29889
|
-
}
|
|
29890
|
-
onSuccess(response);
|
|
29932
|
+
onFailure(error);
|
|
29933
|
+
return dispatch({
|
|
29934
|
+
type: SHOW_ALERT,
|
|
29935
|
+
payload: {
|
|
29936
|
+
type: "error",
|
|
29937
|
+
content: t("messages.unexpectedError")
|
|
29938
|
+
}
|
|
29939
|
+
});
|
|
29891
29940
|
}
|
|
29892
29941
|
};
|
|
29893
29942
|
const confirmStripeIntentSetup = (response, flow, paymentMethodId) => {
|
|
@@ -30118,7 +30167,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
30118
30167
|
addressId: selectedAddressId,
|
|
30119
30168
|
couponCode
|
|
30120
30169
|
}, (err, orderResponse) => {
|
|
30121
|
-
var _window$
|
|
30170
|
+
var _window$Pelcro12, _window$Pelcro12$user, _window$Pelcro12$user2;
|
|
30122
30171
|
if (err) {
|
|
30123
30172
|
toggleAuthenticationSuccessPendingView(false);
|
|
30124
30173
|
dispatch({
|
|
@@ -30149,7 +30198,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
30149
30198
|
});
|
|
30150
30199
|
}
|
|
30151
30200
|
window.Pelcro.user.refresh({
|
|
30152
|
-
auth_token: (_window$
|
|
30201
|
+
auth_token: (_window$Pelcro12 = window.Pelcro) === null || _window$Pelcro12 === void 0 ? void 0 : (_window$Pelcro12$user = _window$Pelcro12.user) === null || _window$Pelcro12$user === void 0 ? void 0 : (_window$Pelcro12$user2 = _window$Pelcro12$user.read()) === null || _window$Pelcro12$user2 === void 0 ? void 0 : _window$Pelcro12$user2.auth_token
|
|
30153
30202
|
}, (err, res) => {
|
|
30154
30203
|
dispatch({
|
|
30155
30204
|
type: DISABLE_SUBMIT,
|
package/dist/index.esm.js
CHANGED
|
@@ -29773,12 +29773,13 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
29773
29773
|
* @param {boolean} isSubCreate
|
|
29774
29774
|
* @return {*}
|
|
29775
29775
|
*/
|
|
29776
|
-
const confirmStripeCardPayment = (response, error, isSubCreate = false) => {
|
|
29777
|
-
|
|
29778
|
-
|
|
29779
|
-
|
|
29780
|
-
|
|
29781
|
-
|
|
29776
|
+
const confirmStripeCardPayment = async (response, error, isSubCreate = false) => {
|
|
29777
|
+
try {
|
|
29778
|
+
if (response) {
|
|
29779
|
+
var _response$data;
|
|
29780
|
+
const paymentIntent = (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.payment_intent;
|
|
29781
|
+
if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === "requires_action" && paymentIntent !== null && paymentIntent !== void 0 && paymentIntent.client_secret) {
|
|
29782
|
+
const res = await stripe.confirmCardPayment(paymentIntent.client_secret);
|
|
29782
29783
|
if (!isSubCreate) {
|
|
29783
29784
|
dispatch({
|
|
29784
29785
|
type: DISABLE_SUBMIT,
|
|
@@ -29790,6 +29791,21 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
29790
29791
|
payload: false
|
|
29791
29792
|
});
|
|
29792
29793
|
if (res.error) {
|
|
29794
|
+
notifyBugsnag(() => {
|
|
29795
|
+
// eslint-disable-next-line no-undef
|
|
29796
|
+
Bugsnag.notify(`Payment ${res.error}`, event => {
|
|
29797
|
+
var _error$response, _error$response$data, _error$response$data$, _window$Pelcro3, _window$Pelcro3$site, _window$Pelcro4, _window$Pelcro4$user, _window$Pelcro5;
|
|
29798
|
+
event.addMetadata("Stripe Error MetaData", {
|
|
29799
|
+
message: res.error.message,
|
|
29800
|
+
type: res.error.type,
|
|
29801
|
+
code: res.error.code,
|
|
29802
|
+
error_message: error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.error) === null || _error$response$data$ === void 0 ? void 0 : _error$response$data$.message,
|
|
29803
|
+
site: (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$site = _window$Pelcro3.site) === null || _window$Pelcro3$site === void 0 ? void 0 : _window$Pelcro3$site.read(),
|
|
29804
|
+
user: (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : (_window$Pelcro4$user = _window$Pelcro4.user) === null || _window$Pelcro4$user === void 0 ? void 0 : _window$Pelcro4$user.read(),
|
|
29805
|
+
environment: (_window$Pelcro5 = window.Pelcro) === null || _window$Pelcro5 === void 0 ? void 0 : _window$Pelcro5.environment
|
|
29806
|
+
});
|
|
29807
|
+
});
|
|
29808
|
+
});
|
|
29793
29809
|
onFailure(res.error);
|
|
29794
29810
|
return dispatch({
|
|
29795
29811
|
type: SHOW_ALERT,
|
|
@@ -29800,45 +29816,81 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
29800
29816
|
});
|
|
29801
29817
|
}
|
|
29802
29818
|
onSuccess(res);
|
|
29803
|
-
})
|
|
29804
|
-
|
|
29805
|
-
|
|
29819
|
+
} else if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === "requires_payment_method" && paymentIntent !== null && paymentIntent !== void 0 && paymentIntent.client_secret) {
|
|
29820
|
+
if (!isSubCreate) {
|
|
29821
|
+
dispatch({
|
|
29822
|
+
type: DISABLE_SUBMIT,
|
|
29823
|
+
payload: false
|
|
29824
|
+
});
|
|
29825
|
+
}
|
|
29806
29826
|
dispatch({
|
|
29807
|
-
type:
|
|
29827
|
+
type: LOADING,
|
|
29808
29828
|
payload: false
|
|
29809
29829
|
});
|
|
29830
|
+
onFailure(error);
|
|
29831
|
+
return dispatch({
|
|
29832
|
+
type: SHOW_ALERT,
|
|
29833
|
+
payload: {
|
|
29834
|
+
type: "error",
|
|
29835
|
+
content: isSubCreate ? t("messages.tryAgainFromInvoice") : t("messages.cardAuthFailed")
|
|
29836
|
+
}
|
|
29837
|
+
});
|
|
29838
|
+
} else {
|
|
29839
|
+
onSuccess(response);
|
|
29810
29840
|
}
|
|
29841
|
+
} else {
|
|
29811
29842
|
dispatch({
|
|
29812
|
-
type:
|
|
29843
|
+
type: DISABLE_SUBMIT,
|
|
29813
29844
|
payload: false
|
|
29814
29845
|
});
|
|
29815
|
-
onFailure(error);
|
|
29816
|
-
return dispatch({
|
|
29817
|
-
type: SHOW_ALERT,
|
|
29818
|
-
payload: {
|
|
29819
|
-
type: "error",
|
|
29820
|
-
content: isSubCreate ? t("messages.tryAgainFromInvoice") : t("messages.cardAuthFailed")
|
|
29821
|
-
}
|
|
29822
|
-
});
|
|
29823
|
-
} else if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === "processing" && paymentIntent !== null && paymentIntent !== void 0 && paymentIntent.client_secret) {
|
|
29824
|
-
if (!isSubCreate) {
|
|
29825
|
-
dispatch({
|
|
29826
|
-
type: DISABLE_SUBMIT,
|
|
29827
|
-
payload: false
|
|
29828
|
-
});
|
|
29829
|
-
}
|
|
29830
29846
|
dispatch({
|
|
29831
29847
|
type: LOADING,
|
|
29832
29848
|
payload: false
|
|
29833
29849
|
});
|
|
29834
|
-
|
|
29835
|
-
|
|
29836
|
-
|
|
29837
|
-
|
|
29838
|
-
|
|
29850
|
+
if (error) {
|
|
29851
|
+
notifyBugsnag(() => {
|
|
29852
|
+
// eslint-disable-next-line no-undef
|
|
29853
|
+
Bugsnag.notify(`Payment ${error}`, event => {
|
|
29854
|
+
var _error$response2, _error$response3, _error$response3$data, _error$response3$data2, _window$Pelcro6, _window$Pelcro6$site, _window$Pelcro7, _window$Pelcro7$user, _window$Pelcro8;
|
|
29855
|
+
event.addMetadata("MetaData", {
|
|
29856
|
+
name: error === null || error === void 0 ? void 0 : error.name,
|
|
29857
|
+
message: error === null || error === void 0 ? void 0 : error.message,
|
|
29858
|
+
type: error === null || error === void 0 ? void 0 : error.type,
|
|
29859
|
+
code: error === null || error === void 0 ? void 0 : error.code,
|
|
29860
|
+
status: error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.status,
|
|
29861
|
+
error_message: error === null || error === void 0 ? void 0 : (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : (_error$response3$data = _error$response3.data) === null || _error$response3$data === void 0 ? void 0 : (_error$response3$data2 = _error$response3$data.error) === null || _error$response3$data2 === void 0 ? void 0 : _error$response3$data2.message,
|
|
29862
|
+
site: (_window$Pelcro6 = window.Pelcro) === null || _window$Pelcro6 === void 0 ? void 0 : (_window$Pelcro6$site = _window$Pelcro6.site) === null || _window$Pelcro6$site === void 0 ? void 0 : _window$Pelcro6$site.read(),
|
|
29863
|
+
user: (_window$Pelcro7 = window.Pelcro) === null || _window$Pelcro7 === void 0 ? void 0 : (_window$Pelcro7$user = _window$Pelcro7.user) === null || _window$Pelcro7$user === void 0 ? void 0 : _window$Pelcro7$user.read(),
|
|
29864
|
+
environment: (_window$Pelcro8 = window.Pelcro) === null || _window$Pelcro8 === void 0 ? void 0 : _window$Pelcro8.environment
|
|
29865
|
+
});
|
|
29866
|
+
});
|
|
29867
|
+
});
|
|
29868
|
+
onFailure(error);
|
|
29869
|
+
return dispatch({
|
|
29870
|
+
type: SHOW_ALERT,
|
|
29871
|
+
payload: {
|
|
29872
|
+
type: "error",
|
|
29873
|
+
content: getErrorMessages(error)
|
|
29874
|
+
}
|
|
29875
|
+
});
|
|
29876
|
+
}
|
|
29839
29877
|
onSuccess(response);
|
|
29840
29878
|
}
|
|
29841
|
-
}
|
|
29879
|
+
} catch (error) {
|
|
29880
|
+
notifyBugsnag(() => {
|
|
29881
|
+
// eslint-disable-next-line no-undef
|
|
29882
|
+
Bugsnag.notify(`Payment ${error}`, event => {
|
|
29883
|
+
var _error$response4, _error$response4$data, _error$response4$data2, _window$Pelcro9, _window$Pelcro9$site, _window$Pelcro10, _window$Pelcro10$user, _window$Pelcro11;
|
|
29884
|
+
event.addMetadata("UnexpectedError", {
|
|
29885
|
+
message: error.message,
|
|
29886
|
+
stack: error.stack,
|
|
29887
|
+
error_message: error === null || error === void 0 ? void 0 : (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : (_error$response4$data = _error$response4.data) === null || _error$response4$data === void 0 ? void 0 : (_error$response4$data2 = _error$response4$data.error) === null || _error$response4$data2 === void 0 ? void 0 : _error$response4$data2.message,
|
|
29888
|
+
site: (_window$Pelcro9 = window.Pelcro) === null || _window$Pelcro9 === void 0 ? void 0 : (_window$Pelcro9$site = _window$Pelcro9.site) === null || _window$Pelcro9$site === void 0 ? void 0 : _window$Pelcro9$site.read(),
|
|
29889
|
+
user: (_window$Pelcro10 = window.Pelcro) === null || _window$Pelcro10 === void 0 ? void 0 : (_window$Pelcro10$user = _window$Pelcro10.user) === null || _window$Pelcro10$user === void 0 ? void 0 : _window$Pelcro10$user.read(),
|
|
29890
|
+
environment: (_window$Pelcro11 = window.Pelcro) === null || _window$Pelcro11 === void 0 ? void 0 : _window$Pelcro11.environment
|
|
29891
|
+
});
|
|
29892
|
+
});
|
|
29893
|
+
});
|
|
29842
29894
|
dispatch({
|
|
29843
29895
|
type: DISABLE_SUBMIT,
|
|
29844
29896
|
payload: false
|
|
@@ -29847,17 +29899,14 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
29847
29899
|
type: LOADING,
|
|
29848
29900
|
payload: false
|
|
29849
29901
|
});
|
|
29850
|
-
|
|
29851
|
-
|
|
29852
|
-
|
|
29853
|
-
|
|
29854
|
-
|
|
29855
|
-
|
|
29856
|
-
|
|
29857
|
-
|
|
29858
|
-
});
|
|
29859
|
-
}
|
|
29860
|
-
onSuccess(response);
|
|
29902
|
+
onFailure(error);
|
|
29903
|
+
return dispatch({
|
|
29904
|
+
type: SHOW_ALERT,
|
|
29905
|
+
payload: {
|
|
29906
|
+
type: "error",
|
|
29907
|
+
content: t("messages.unexpectedError")
|
|
29908
|
+
}
|
|
29909
|
+
});
|
|
29861
29910
|
}
|
|
29862
29911
|
};
|
|
29863
29912
|
const confirmStripeIntentSetup = (response, flow, paymentMethodId) => {
|
|
@@ -30088,7 +30137,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
30088
30137
|
addressId: selectedAddressId,
|
|
30089
30138
|
couponCode
|
|
30090
30139
|
}, (err, orderResponse) => {
|
|
30091
|
-
var _window$
|
|
30140
|
+
var _window$Pelcro12, _window$Pelcro12$user, _window$Pelcro12$user2;
|
|
30092
30141
|
if (err) {
|
|
30093
30142
|
toggleAuthenticationSuccessPendingView(false);
|
|
30094
30143
|
dispatch({
|
|
@@ -30119,7 +30168,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
30119
30168
|
});
|
|
30120
30169
|
}
|
|
30121
30170
|
window.Pelcro.user.refresh({
|
|
30122
|
-
auth_token: (_window$
|
|
30171
|
+
auth_token: (_window$Pelcro12 = window.Pelcro) === null || _window$Pelcro12 === void 0 ? void 0 : (_window$Pelcro12$user = _window$Pelcro12.user) === null || _window$Pelcro12$user === void 0 ? void 0 : (_window$Pelcro12$user2 = _window$Pelcro12$user.read()) === null || _window$Pelcro12$user2 === void 0 ? void 0 : _window$Pelcro12$user2.auth_token
|
|
30123
30172
|
}, (err, res) => {
|
|
30124
30173
|
dispatch({
|
|
30125
30174
|
type: DISABLE_SUBMIT,
|