@pelcro/react-pelcro-js 4.0.0-alpha.97 → 4.0.0-alpha.99
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 +29 -33
- package/dist/index.esm.js +29 -33
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -29824,12 +29824,15 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
29824
29824
|
notifyBugsnag(() => {
|
|
29825
29825
|
// eslint-disable-next-line no-undef
|
|
29826
29826
|
Bugsnag.notify(`Payment ${res.error}`, event => {
|
|
29827
|
-
var _error$response, _error$response$data, _error$response$data
|
|
29827
|
+
var _error$response, _error$response$data, _error$response$data$, _window$Pelcro3, _window$Pelcro3$site, _window$Pelcro4, _window$Pelcro4$user, _window$Pelcro5;
|
|
29828
29828
|
event.addMetadata("Stripe Error MetaData", {
|
|
29829
29829
|
message: res.error.message,
|
|
29830
29830
|
type: res.error.type,
|
|
29831
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
|
|
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
|
|
29833
29836
|
});
|
|
29834
29837
|
});
|
|
29835
29838
|
});
|
|
@@ -29862,21 +29865,6 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
29862
29865
|
content: isSubCreate ? t("messages.tryAgainFromInvoice") : t("messages.cardAuthFailed")
|
|
29863
29866
|
}
|
|
29864
29867
|
});
|
|
29865
|
-
} else if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === "processing" && paymentIntent !== null && paymentIntent !== void 0 && paymentIntent.client_secret) {
|
|
29866
|
-
if (!isSubCreate) {
|
|
29867
|
-
dispatch({
|
|
29868
|
-
type: DISABLE_SUBMIT,
|
|
29869
|
-
payload: false
|
|
29870
|
-
});
|
|
29871
|
-
}
|
|
29872
|
-
dispatch({
|
|
29873
|
-
type: LOADING,
|
|
29874
|
-
payload: false
|
|
29875
|
-
});
|
|
29876
|
-
set({
|
|
29877
|
-
isProcessingInvoice: true
|
|
29878
|
-
});
|
|
29879
|
-
onSuccess(response);
|
|
29880
29868
|
} else {
|
|
29881
29869
|
onSuccess(response);
|
|
29882
29870
|
}
|
|
@@ -29893,14 +29881,17 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
29893
29881
|
notifyBugsnag(() => {
|
|
29894
29882
|
// eslint-disable-next-line no-undef
|
|
29895
29883
|
Bugsnag.notify(`Payment ${error}`, event => {
|
|
29896
|
-
var _error$response2, _error$response3, _error$response3$data, _error$response3$data2;
|
|
29884
|
+
var _error$response2, _error$response3, _error$response3$data, _error$response3$data2, _window$Pelcro6, _window$Pelcro6$site, _window$Pelcro7, _window$Pelcro7$user, _window$Pelcro8;
|
|
29897
29885
|
event.addMetadata("MetaData", {
|
|
29898
29886
|
name: error === null || error === void 0 ? void 0 : error.name,
|
|
29899
29887
|
message: error === null || error === void 0 ? void 0 : error.message,
|
|
29900
29888
|
type: error === null || error === void 0 ? void 0 : error.type,
|
|
29901
29889
|
code: error === null || error === void 0 ? void 0 : error.code,
|
|
29902
29890
|
status: error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.status,
|
|
29903
|
-
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
|
|
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
|
|
29904
29895
|
});
|
|
29905
29896
|
});
|
|
29906
29897
|
});
|
|
@@ -29919,11 +29910,14 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
29919
29910
|
notifyBugsnag(() => {
|
|
29920
29911
|
// eslint-disable-next-line no-undef
|
|
29921
29912
|
Bugsnag.notify(`Payment ${error}`, event => {
|
|
29922
|
-
var _error$response4, _error$response4$data, _error$response4$data2;
|
|
29913
|
+
var _error$response4, _error$response4$data, _error$response4$data2, _window$Pelcro9, _window$Pelcro9$site, _window$Pelcro10, _window$Pelcro10$user, _window$Pelcro11;
|
|
29923
29914
|
event.addMetadata("UnexpectedError", {
|
|
29924
29915
|
message: error.message,
|
|
29925
29916
|
stack: error.stack,
|
|
29926
|
-
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
|
|
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
|
|
29927
29921
|
});
|
|
29928
29922
|
});
|
|
29929
29923
|
});
|
|
@@ -30173,7 +30167,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
30173
30167
|
addressId: selectedAddressId,
|
|
30174
30168
|
couponCode
|
|
30175
30169
|
}, (err, orderResponse) => {
|
|
30176
|
-
var _window$
|
|
30170
|
+
var _window$Pelcro12, _window$Pelcro12$user, _window$Pelcro12$user2;
|
|
30177
30171
|
if (err) {
|
|
30178
30172
|
toggleAuthenticationSuccessPendingView(false);
|
|
30179
30173
|
dispatch({
|
|
@@ -30204,7 +30198,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
30204
30198
|
});
|
|
30205
30199
|
}
|
|
30206
30200
|
window.Pelcro.user.refresh({
|
|
30207
|
-
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
|
|
30208
30202
|
}, (err, res) => {
|
|
30209
30203
|
dispatch({
|
|
30210
30204
|
type: DISABLE_SUBMIT,
|
|
@@ -30261,7 +30255,8 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
30261
30255
|
if (result.paymentMethod) {
|
|
30262
30256
|
window.Pelcro.paymentMethods.create({
|
|
30263
30257
|
auth_token: window.Pelcro.user.read().auth_token,
|
|
30264
|
-
token: result.paymentMethod.id
|
|
30258
|
+
token: result.paymentMethod.id,
|
|
30259
|
+
is_default: props !== null && props !== void 0 && props.hiddenSetAsDefault ? true : false
|
|
30265
30260
|
}, (err, res) => {
|
|
30266
30261
|
var _res$data2, _res$data2$setup_inte, _res$data3, _res$data3$setup_inte;
|
|
30267
30262
|
if (err) {
|
|
@@ -32643,7 +32638,7 @@ function PaymentMethodUpdateSetDefault(props) {
|
|
|
32643
32638
|
paymentMethodToEdit
|
|
32644
32639
|
} = usePelcro();
|
|
32645
32640
|
React.useEffect(() => {
|
|
32646
|
-
if (paymentMethodToEdit !== null && paymentMethodToEdit !== void 0 && paymentMethodToEdit.is_default) {
|
|
32641
|
+
if (paymentMethodToEdit !== null && paymentMethodToEdit !== void 0 && paymentMethodToEdit.is_default || props !== null && props !== void 0 && props.hiddenSetAsDefault) {
|
|
32647
32642
|
dispatch({
|
|
32648
32643
|
type: SET_IS_DEFAULT_PAYMENT_METHOD,
|
|
32649
32644
|
payload: {
|
|
@@ -32661,7 +32656,7 @@ function PaymentMethodUpdateSetDefault(props) {
|
|
|
32661
32656
|
}
|
|
32662
32657
|
});
|
|
32663
32658
|
};
|
|
32664
|
-
return /*#__PURE__*/React__default['default'].createElement(Checkbox, {
|
|
32659
|
+
return props !== null && props !== void 0 && props.hiddenSetAsDefault ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null) : /*#__PURE__*/React__default['default'].createElement(Checkbox, {
|
|
32665
32660
|
onChange: e => handleCheckboxChange(e),
|
|
32666
32661
|
id: props.id,
|
|
32667
32662
|
checked: isDefault,
|
|
@@ -32746,7 +32741,8 @@ function PaymentMethodView({
|
|
|
32746
32741
|
showSubscriptionButton,
|
|
32747
32742
|
showOrderButton,
|
|
32748
32743
|
showApplePayButton,
|
|
32749
|
-
order
|
|
32744
|
+
order,
|
|
32745
|
+
...props
|
|
32750
32746
|
}) {
|
|
32751
32747
|
var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3;
|
|
32752
32748
|
const {
|
|
@@ -32773,13 +32769,13 @@ function PaymentMethodView({
|
|
|
32773
32769
|
}, "Stripe"))), /*#__PURE__*/React__default['default'].createElement("form", {
|
|
32774
32770
|
action: "javascript:void(0);",
|
|
32775
32771
|
className: "plc-w-full plc-mt-2 plc-font-semibold plc-text-gray-600 pelcro-form"
|
|
32776
|
-
}, /*#__PURE__*/React__default['default'].createElement(PaymentMethodContainer, {
|
|
32772
|
+
}, /*#__PURE__*/React__default['default'].createElement(PaymentMethodContainer, Object.assign({
|
|
32777
32773
|
type: type,
|
|
32778
32774
|
onSuccess: onSuccess,
|
|
32779
32775
|
onGiftRenewalSuccess: onGiftRenewalSuccess,
|
|
32780
32776
|
onFailure: onFailure,
|
|
32781
32777
|
freeOrders: showOrderButton
|
|
32782
|
-
}, /*#__PURE__*/React__default['default'].createElement(AlertWithContext, {
|
|
32778
|
+
}, props), /*#__PURE__*/React__default['default'].createElement(AlertWithContext, {
|
|
32783
32779
|
className: "plc-mb-2"
|
|
32784
32780
|
}), showSubscriptionButton && /*#__PURE__*/React__default['default'].createElement(SubscriptionCreateFreePlanButton, null), showOrderButton && /*#__PURE__*/React__default['default'].createElement(OrderCreateFreeButton, null), !showSubscriptionButton && !showOrderButton && /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(BankRedirection, null), /*#__PURE__*/React__default['default'].createElement(BankAuthenticationSuccess, null), /*#__PURE__*/React__default['default'].createElement(SelectedAddress, {
|
|
32785
32781
|
type: type
|
|
@@ -37233,7 +37229,7 @@ const PaymentMethodUpdateContainer = props => {
|
|
|
37233
37229
|
function PaymentMethodUpdateView(props) {
|
|
37234
37230
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
37235
37231
|
id: "pelcro-payment-method-update-view"
|
|
37236
|
-
}, /*#__PURE__*/React__default['default'].createElement(PaymentMethodView, {
|
|
37232
|
+
}, /*#__PURE__*/React__default['default'].createElement(PaymentMethodView, Object.assign({
|
|
37237
37233
|
type: "updatePaymentSource",
|
|
37238
37234
|
showCoupon: false,
|
|
37239
37235
|
showExternalPaymentMethods: false,
|
|
@@ -37241,7 +37237,7 @@ function PaymentMethodUpdateView(props) {
|
|
|
37241
37237
|
onDisplay: props.onDisplay,
|
|
37242
37238
|
onFailure: props.onFailure,
|
|
37243
37239
|
onSuccess: props.onSuccess
|
|
37244
|
-
}));
|
|
37240
|
+
}, props)));
|
|
37245
37241
|
}
|
|
37246
37242
|
|
|
37247
37243
|
const PaymentMethodUpdateModal = props => {
|
|
@@ -40666,7 +40662,7 @@ const PaymentMethodCreateContainer = props => {
|
|
|
40666
40662
|
function PaymentMethodCreateView(props) {
|
|
40667
40663
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
40668
40664
|
id: "pelcro-payment-method-create-view"
|
|
40669
|
-
}, /*#__PURE__*/React__default['default'].createElement(PaymentMethodView, {
|
|
40665
|
+
}, /*#__PURE__*/React__default['default'].createElement(PaymentMethodView, Object.assign({
|
|
40670
40666
|
type: "createPaymentSource",
|
|
40671
40667
|
showCoupon: false,
|
|
40672
40668
|
showExternalPaymentMethods: false,
|
|
@@ -40674,7 +40670,7 @@ function PaymentMethodCreateView(props) {
|
|
|
40674
40670
|
onDisplay: props.onDisplay,
|
|
40675
40671
|
onFailure: props.onFailure,
|
|
40676
40672
|
onSuccess: props.onSuccess
|
|
40677
|
-
}));
|
|
40673
|
+
}, props)));
|
|
40678
40674
|
}
|
|
40679
40675
|
|
|
40680
40676
|
const PaymentMethodCreateModal = props => {
|
package/dist/index.esm.js
CHANGED
|
@@ -29794,12 +29794,15 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
29794
29794
|
notifyBugsnag(() => {
|
|
29795
29795
|
// eslint-disable-next-line no-undef
|
|
29796
29796
|
Bugsnag.notify(`Payment ${res.error}`, event => {
|
|
29797
|
-
var _error$response, _error$response$data, _error$response$data
|
|
29797
|
+
var _error$response, _error$response$data, _error$response$data$, _window$Pelcro3, _window$Pelcro3$site, _window$Pelcro4, _window$Pelcro4$user, _window$Pelcro5;
|
|
29798
29798
|
event.addMetadata("Stripe Error MetaData", {
|
|
29799
29799
|
message: res.error.message,
|
|
29800
29800
|
type: res.error.type,
|
|
29801
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
|
|
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
|
|
29803
29806
|
});
|
|
29804
29807
|
});
|
|
29805
29808
|
});
|
|
@@ -29832,21 +29835,6 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
29832
29835
|
content: isSubCreate ? t("messages.tryAgainFromInvoice") : t("messages.cardAuthFailed")
|
|
29833
29836
|
}
|
|
29834
29837
|
});
|
|
29835
|
-
} else if ((paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) === "processing" && paymentIntent !== null && paymentIntent !== void 0 && paymentIntent.client_secret) {
|
|
29836
|
-
if (!isSubCreate) {
|
|
29837
|
-
dispatch({
|
|
29838
|
-
type: DISABLE_SUBMIT,
|
|
29839
|
-
payload: false
|
|
29840
|
-
});
|
|
29841
|
-
}
|
|
29842
|
-
dispatch({
|
|
29843
|
-
type: LOADING,
|
|
29844
|
-
payload: false
|
|
29845
|
-
});
|
|
29846
|
-
set({
|
|
29847
|
-
isProcessingInvoice: true
|
|
29848
|
-
});
|
|
29849
|
-
onSuccess(response);
|
|
29850
29838
|
} else {
|
|
29851
29839
|
onSuccess(response);
|
|
29852
29840
|
}
|
|
@@ -29863,14 +29851,17 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
29863
29851
|
notifyBugsnag(() => {
|
|
29864
29852
|
// eslint-disable-next-line no-undef
|
|
29865
29853
|
Bugsnag.notify(`Payment ${error}`, event => {
|
|
29866
|
-
var _error$response2, _error$response3, _error$response3$data, _error$response3$data2;
|
|
29854
|
+
var _error$response2, _error$response3, _error$response3$data, _error$response3$data2, _window$Pelcro6, _window$Pelcro6$site, _window$Pelcro7, _window$Pelcro7$user, _window$Pelcro8;
|
|
29867
29855
|
event.addMetadata("MetaData", {
|
|
29868
29856
|
name: error === null || error === void 0 ? void 0 : error.name,
|
|
29869
29857
|
message: error === null || error === void 0 ? void 0 : error.message,
|
|
29870
29858
|
type: error === null || error === void 0 ? void 0 : error.type,
|
|
29871
29859
|
code: error === null || error === void 0 ? void 0 : error.code,
|
|
29872
29860
|
status: error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.status,
|
|
29873
|
-
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
|
|
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
|
|
29874
29865
|
});
|
|
29875
29866
|
});
|
|
29876
29867
|
});
|
|
@@ -29889,11 +29880,14 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
29889
29880
|
notifyBugsnag(() => {
|
|
29890
29881
|
// eslint-disable-next-line no-undef
|
|
29891
29882
|
Bugsnag.notify(`Payment ${error}`, event => {
|
|
29892
|
-
var _error$response4, _error$response4$data, _error$response4$data2;
|
|
29883
|
+
var _error$response4, _error$response4$data, _error$response4$data2, _window$Pelcro9, _window$Pelcro9$site, _window$Pelcro10, _window$Pelcro10$user, _window$Pelcro11;
|
|
29893
29884
|
event.addMetadata("UnexpectedError", {
|
|
29894
29885
|
message: error.message,
|
|
29895
29886
|
stack: error.stack,
|
|
29896
|
-
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
|
|
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
|
|
29897
29891
|
});
|
|
29898
29892
|
});
|
|
29899
29893
|
});
|
|
@@ -30143,7 +30137,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
30143
30137
|
addressId: selectedAddressId,
|
|
30144
30138
|
couponCode
|
|
30145
30139
|
}, (err, orderResponse) => {
|
|
30146
|
-
var _window$
|
|
30140
|
+
var _window$Pelcro12, _window$Pelcro12$user, _window$Pelcro12$user2;
|
|
30147
30141
|
if (err) {
|
|
30148
30142
|
toggleAuthenticationSuccessPendingView(false);
|
|
30149
30143
|
dispatch({
|
|
@@ -30174,7 +30168,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
30174
30168
|
});
|
|
30175
30169
|
}
|
|
30176
30170
|
window.Pelcro.user.refresh({
|
|
30177
|
-
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
|
|
30178
30172
|
}, (err, res) => {
|
|
30179
30173
|
dispatch({
|
|
30180
30174
|
type: DISABLE_SUBMIT,
|
|
@@ -30231,7 +30225,8 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
30231
30225
|
if (result.paymentMethod) {
|
|
30232
30226
|
window.Pelcro.paymentMethods.create({
|
|
30233
30227
|
auth_token: window.Pelcro.user.read().auth_token,
|
|
30234
|
-
token: result.paymentMethod.id
|
|
30228
|
+
token: result.paymentMethod.id,
|
|
30229
|
+
is_default: props !== null && props !== void 0 && props.hiddenSetAsDefault ? true : false
|
|
30235
30230
|
}, (err, res) => {
|
|
30236
30231
|
var _res$data2, _res$data2$setup_inte, _res$data3, _res$data3$setup_inte;
|
|
30237
30232
|
if (err) {
|
|
@@ -32613,7 +32608,7 @@ function PaymentMethodUpdateSetDefault(props) {
|
|
|
32613
32608
|
paymentMethodToEdit
|
|
32614
32609
|
} = usePelcro();
|
|
32615
32610
|
useEffect(() => {
|
|
32616
|
-
if (paymentMethodToEdit !== null && paymentMethodToEdit !== void 0 && paymentMethodToEdit.is_default) {
|
|
32611
|
+
if (paymentMethodToEdit !== null && paymentMethodToEdit !== void 0 && paymentMethodToEdit.is_default || props !== null && props !== void 0 && props.hiddenSetAsDefault) {
|
|
32617
32612
|
dispatch({
|
|
32618
32613
|
type: SET_IS_DEFAULT_PAYMENT_METHOD,
|
|
32619
32614
|
payload: {
|
|
@@ -32631,7 +32626,7 @@ function PaymentMethodUpdateSetDefault(props) {
|
|
|
32631
32626
|
}
|
|
32632
32627
|
});
|
|
32633
32628
|
};
|
|
32634
|
-
return /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
32629
|
+
return props !== null && props !== void 0 && props.hiddenSetAsDefault ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null) : /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
32635
32630
|
onChange: e => handleCheckboxChange(e),
|
|
32636
32631
|
id: props.id,
|
|
32637
32632
|
checked: isDefault,
|
|
@@ -32716,7 +32711,8 @@ function PaymentMethodView({
|
|
|
32716
32711
|
showSubscriptionButton,
|
|
32717
32712
|
showOrderButton,
|
|
32718
32713
|
showApplePayButton,
|
|
32719
|
-
order
|
|
32714
|
+
order,
|
|
32715
|
+
...props
|
|
32720
32716
|
}) {
|
|
32721
32717
|
var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3;
|
|
32722
32718
|
const {
|
|
@@ -32743,13 +32739,13 @@ function PaymentMethodView({
|
|
|
32743
32739
|
}, "Stripe"))), /*#__PURE__*/React__default.createElement("form", {
|
|
32744
32740
|
action: "javascript:void(0);",
|
|
32745
32741
|
className: "plc-w-full plc-mt-2 plc-font-semibold plc-text-gray-600 pelcro-form"
|
|
32746
|
-
}, /*#__PURE__*/React__default.createElement(PaymentMethodContainer, {
|
|
32742
|
+
}, /*#__PURE__*/React__default.createElement(PaymentMethodContainer, Object.assign({
|
|
32747
32743
|
type: type,
|
|
32748
32744
|
onSuccess: onSuccess,
|
|
32749
32745
|
onGiftRenewalSuccess: onGiftRenewalSuccess,
|
|
32750
32746
|
onFailure: onFailure,
|
|
32751
32747
|
freeOrders: showOrderButton
|
|
32752
|
-
}, /*#__PURE__*/React__default.createElement(AlertWithContext, {
|
|
32748
|
+
}, props), /*#__PURE__*/React__default.createElement(AlertWithContext, {
|
|
32753
32749
|
className: "plc-mb-2"
|
|
32754
32750
|
}), showSubscriptionButton && /*#__PURE__*/React__default.createElement(SubscriptionCreateFreePlanButton, null), showOrderButton && /*#__PURE__*/React__default.createElement(OrderCreateFreeButton, null), !showSubscriptionButton && !showOrderButton && /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(BankRedirection, null), /*#__PURE__*/React__default.createElement(BankAuthenticationSuccess, null), /*#__PURE__*/React__default.createElement(SelectedAddress, {
|
|
32755
32751
|
type: type
|
|
@@ -37203,7 +37199,7 @@ const PaymentMethodUpdateContainer = props => {
|
|
|
37203
37199
|
function PaymentMethodUpdateView(props) {
|
|
37204
37200
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
37205
37201
|
id: "pelcro-payment-method-update-view"
|
|
37206
|
-
}, /*#__PURE__*/React__default.createElement(PaymentMethodView, {
|
|
37202
|
+
}, /*#__PURE__*/React__default.createElement(PaymentMethodView, Object.assign({
|
|
37207
37203
|
type: "updatePaymentSource",
|
|
37208
37204
|
showCoupon: false,
|
|
37209
37205
|
showExternalPaymentMethods: false,
|
|
@@ -37211,7 +37207,7 @@ function PaymentMethodUpdateView(props) {
|
|
|
37211
37207
|
onDisplay: props.onDisplay,
|
|
37212
37208
|
onFailure: props.onFailure,
|
|
37213
37209
|
onSuccess: props.onSuccess
|
|
37214
|
-
}));
|
|
37210
|
+
}, props)));
|
|
37215
37211
|
}
|
|
37216
37212
|
|
|
37217
37213
|
const PaymentMethodUpdateModal = props => {
|
|
@@ -40636,7 +40632,7 @@ const PaymentMethodCreateContainer = props => {
|
|
|
40636
40632
|
function PaymentMethodCreateView(props) {
|
|
40637
40633
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
40638
40634
|
id: "pelcro-payment-method-create-view"
|
|
40639
|
-
}, /*#__PURE__*/React__default.createElement(PaymentMethodView, {
|
|
40635
|
+
}, /*#__PURE__*/React__default.createElement(PaymentMethodView, Object.assign({
|
|
40640
40636
|
type: "createPaymentSource",
|
|
40641
40637
|
showCoupon: false,
|
|
40642
40638
|
showExternalPaymentMethods: false,
|
|
@@ -40644,7 +40640,7 @@ function PaymentMethodCreateView(props) {
|
|
|
40644
40640
|
onDisplay: props.onDisplay,
|
|
40645
40641
|
onFailure: props.onFailure,
|
|
40646
40642
|
onSuccess: props.onSuccess
|
|
40647
|
-
}));
|
|
40643
|
+
}, props)));
|
|
40648
40644
|
}
|
|
40649
40645
|
|
|
40650
40646
|
const PaymentMethodCreateModal = props => {
|