@pelcro/react-pelcro-js 4.0.0-alpha.98 → 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 +12 -10
- package/dist/index.esm.js +12 -10
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -30255,7 +30255,8 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
30255
30255
|
if (result.paymentMethod) {
|
|
30256
30256
|
window.Pelcro.paymentMethods.create({
|
|
30257
30257
|
auth_token: window.Pelcro.user.read().auth_token,
|
|
30258
|
-
token: result.paymentMethod.id
|
|
30258
|
+
token: result.paymentMethod.id,
|
|
30259
|
+
is_default: props !== null && props !== void 0 && props.hiddenSetAsDefault ? true : false
|
|
30259
30260
|
}, (err, res) => {
|
|
30260
30261
|
var _res$data2, _res$data2$setup_inte, _res$data3, _res$data3$setup_inte;
|
|
30261
30262
|
if (err) {
|
|
@@ -32637,7 +32638,7 @@ function PaymentMethodUpdateSetDefault(props) {
|
|
|
32637
32638
|
paymentMethodToEdit
|
|
32638
32639
|
} = usePelcro();
|
|
32639
32640
|
React.useEffect(() => {
|
|
32640
|
-
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) {
|
|
32641
32642
|
dispatch({
|
|
32642
32643
|
type: SET_IS_DEFAULT_PAYMENT_METHOD,
|
|
32643
32644
|
payload: {
|
|
@@ -32655,7 +32656,7 @@ function PaymentMethodUpdateSetDefault(props) {
|
|
|
32655
32656
|
}
|
|
32656
32657
|
});
|
|
32657
32658
|
};
|
|
32658
|
-
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, {
|
|
32659
32660
|
onChange: e => handleCheckboxChange(e),
|
|
32660
32661
|
id: props.id,
|
|
32661
32662
|
checked: isDefault,
|
|
@@ -32740,7 +32741,8 @@ function PaymentMethodView({
|
|
|
32740
32741
|
showSubscriptionButton,
|
|
32741
32742
|
showOrderButton,
|
|
32742
32743
|
showApplePayButton,
|
|
32743
|
-
order
|
|
32744
|
+
order,
|
|
32745
|
+
...props
|
|
32744
32746
|
}) {
|
|
32745
32747
|
var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3;
|
|
32746
32748
|
const {
|
|
@@ -32767,13 +32769,13 @@ function PaymentMethodView({
|
|
|
32767
32769
|
}, "Stripe"))), /*#__PURE__*/React__default['default'].createElement("form", {
|
|
32768
32770
|
action: "javascript:void(0);",
|
|
32769
32771
|
className: "plc-w-full plc-mt-2 plc-font-semibold plc-text-gray-600 pelcro-form"
|
|
32770
|
-
}, /*#__PURE__*/React__default['default'].createElement(PaymentMethodContainer, {
|
|
32772
|
+
}, /*#__PURE__*/React__default['default'].createElement(PaymentMethodContainer, Object.assign({
|
|
32771
32773
|
type: type,
|
|
32772
32774
|
onSuccess: onSuccess,
|
|
32773
32775
|
onGiftRenewalSuccess: onGiftRenewalSuccess,
|
|
32774
32776
|
onFailure: onFailure,
|
|
32775
32777
|
freeOrders: showOrderButton
|
|
32776
|
-
}, /*#__PURE__*/React__default['default'].createElement(AlertWithContext, {
|
|
32778
|
+
}, props), /*#__PURE__*/React__default['default'].createElement(AlertWithContext, {
|
|
32777
32779
|
className: "plc-mb-2"
|
|
32778
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, {
|
|
32779
32781
|
type: type
|
|
@@ -37227,7 +37229,7 @@ const PaymentMethodUpdateContainer = props => {
|
|
|
37227
37229
|
function PaymentMethodUpdateView(props) {
|
|
37228
37230
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
37229
37231
|
id: "pelcro-payment-method-update-view"
|
|
37230
|
-
}, /*#__PURE__*/React__default['default'].createElement(PaymentMethodView, {
|
|
37232
|
+
}, /*#__PURE__*/React__default['default'].createElement(PaymentMethodView, Object.assign({
|
|
37231
37233
|
type: "updatePaymentSource",
|
|
37232
37234
|
showCoupon: false,
|
|
37233
37235
|
showExternalPaymentMethods: false,
|
|
@@ -37235,7 +37237,7 @@ function PaymentMethodUpdateView(props) {
|
|
|
37235
37237
|
onDisplay: props.onDisplay,
|
|
37236
37238
|
onFailure: props.onFailure,
|
|
37237
37239
|
onSuccess: props.onSuccess
|
|
37238
|
-
}));
|
|
37240
|
+
}, props)));
|
|
37239
37241
|
}
|
|
37240
37242
|
|
|
37241
37243
|
const PaymentMethodUpdateModal = props => {
|
|
@@ -40660,7 +40662,7 @@ const PaymentMethodCreateContainer = props => {
|
|
|
40660
40662
|
function PaymentMethodCreateView(props) {
|
|
40661
40663
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
40662
40664
|
id: "pelcro-payment-method-create-view"
|
|
40663
|
-
}, /*#__PURE__*/React__default['default'].createElement(PaymentMethodView, {
|
|
40665
|
+
}, /*#__PURE__*/React__default['default'].createElement(PaymentMethodView, Object.assign({
|
|
40664
40666
|
type: "createPaymentSource",
|
|
40665
40667
|
showCoupon: false,
|
|
40666
40668
|
showExternalPaymentMethods: false,
|
|
@@ -40668,7 +40670,7 @@ function PaymentMethodCreateView(props) {
|
|
|
40668
40670
|
onDisplay: props.onDisplay,
|
|
40669
40671
|
onFailure: props.onFailure,
|
|
40670
40672
|
onSuccess: props.onSuccess
|
|
40671
|
-
}));
|
|
40673
|
+
}, props)));
|
|
40672
40674
|
}
|
|
40673
40675
|
|
|
40674
40676
|
const PaymentMethodCreateModal = props => {
|
package/dist/index.esm.js
CHANGED
|
@@ -30225,7 +30225,8 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
30225
30225
|
if (result.paymentMethod) {
|
|
30226
30226
|
window.Pelcro.paymentMethods.create({
|
|
30227
30227
|
auth_token: window.Pelcro.user.read().auth_token,
|
|
30228
|
-
token: result.paymentMethod.id
|
|
30228
|
+
token: result.paymentMethod.id,
|
|
30229
|
+
is_default: props !== null && props !== void 0 && props.hiddenSetAsDefault ? true : false
|
|
30229
30230
|
}, (err, res) => {
|
|
30230
30231
|
var _res$data2, _res$data2$setup_inte, _res$data3, _res$data3$setup_inte;
|
|
30231
30232
|
if (err) {
|
|
@@ -32607,7 +32608,7 @@ function PaymentMethodUpdateSetDefault(props) {
|
|
|
32607
32608
|
paymentMethodToEdit
|
|
32608
32609
|
} = usePelcro();
|
|
32609
32610
|
useEffect(() => {
|
|
32610
|
-
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) {
|
|
32611
32612
|
dispatch({
|
|
32612
32613
|
type: SET_IS_DEFAULT_PAYMENT_METHOD,
|
|
32613
32614
|
payload: {
|
|
@@ -32625,7 +32626,7 @@ function PaymentMethodUpdateSetDefault(props) {
|
|
|
32625
32626
|
}
|
|
32626
32627
|
});
|
|
32627
32628
|
};
|
|
32628
|
-
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, {
|
|
32629
32630
|
onChange: e => handleCheckboxChange(e),
|
|
32630
32631
|
id: props.id,
|
|
32631
32632
|
checked: isDefault,
|
|
@@ -32710,7 +32711,8 @@ function PaymentMethodView({
|
|
|
32710
32711
|
showSubscriptionButton,
|
|
32711
32712
|
showOrderButton,
|
|
32712
32713
|
showApplePayButton,
|
|
32713
|
-
order
|
|
32714
|
+
order,
|
|
32715
|
+
...props
|
|
32714
32716
|
}) {
|
|
32715
32717
|
var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3;
|
|
32716
32718
|
const {
|
|
@@ -32737,13 +32739,13 @@ function PaymentMethodView({
|
|
|
32737
32739
|
}, "Stripe"))), /*#__PURE__*/React__default.createElement("form", {
|
|
32738
32740
|
action: "javascript:void(0);",
|
|
32739
32741
|
className: "plc-w-full plc-mt-2 plc-font-semibold plc-text-gray-600 pelcro-form"
|
|
32740
|
-
}, /*#__PURE__*/React__default.createElement(PaymentMethodContainer, {
|
|
32742
|
+
}, /*#__PURE__*/React__default.createElement(PaymentMethodContainer, Object.assign({
|
|
32741
32743
|
type: type,
|
|
32742
32744
|
onSuccess: onSuccess,
|
|
32743
32745
|
onGiftRenewalSuccess: onGiftRenewalSuccess,
|
|
32744
32746
|
onFailure: onFailure,
|
|
32745
32747
|
freeOrders: showOrderButton
|
|
32746
|
-
}, /*#__PURE__*/React__default.createElement(AlertWithContext, {
|
|
32748
|
+
}, props), /*#__PURE__*/React__default.createElement(AlertWithContext, {
|
|
32747
32749
|
className: "plc-mb-2"
|
|
32748
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, {
|
|
32749
32751
|
type: type
|
|
@@ -37197,7 +37199,7 @@ const PaymentMethodUpdateContainer = props => {
|
|
|
37197
37199
|
function PaymentMethodUpdateView(props) {
|
|
37198
37200
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
37199
37201
|
id: "pelcro-payment-method-update-view"
|
|
37200
|
-
}, /*#__PURE__*/React__default.createElement(PaymentMethodView, {
|
|
37202
|
+
}, /*#__PURE__*/React__default.createElement(PaymentMethodView, Object.assign({
|
|
37201
37203
|
type: "updatePaymentSource",
|
|
37202
37204
|
showCoupon: false,
|
|
37203
37205
|
showExternalPaymentMethods: false,
|
|
@@ -37205,7 +37207,7 @@ function PaymentMethodUpdateView(props) {
|
|
|
37205
37207
|
onDisplay: props.onDisplay,
|
|
37206
37208
|
onFailure: props.onFailure,
|
|
37207
37209
|
onSuccess: props.onSuccess
|
|
37208
|
-
}));
|
|
37210
|
+
}, props)));
|
|
37209
37211
|
}
|
|
37210
37212
|
|
|
37211
37213
|
const PaymentMethodUpdateModal = props => {
|
|
@@ -40630,7 +40632,7 @@ const PaymentMethodCreateContainer = props => {
|
|
|
40630
40632
|
function PaymentMethodCreateView(props) {
|
|
40631
40633
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
40632
40634
|
id: "pelcro-payment-method-create-view"
|
|
40633
|
-
}, /*#__PURE__*/React__default.createElement(PaymentMethodView, {
|
|
40635
|
+
}, /*#__PURE__*/React__default.createElement(PaymentMethodView, Object.assign({
|
|
40634
40636
|
type: "createPaymentSource",
|
|
40635
40637
|
showCoupon: false,
|
|
40636
40638
|
showExternalPaymentMethods: false,
|
|
@@ -40638,7 +40640,7 @@ function PaymentMethodCreateView(props) {
|
|
|
40638
40640
|
onDisplay: props.onDisplay,
|
|
40639
40641
|
onFailure: props.onFailure,
|
|
40640
40642
|
onSuccess: props.onSuccess
|
|
40641
|
-
}));
|
|
40643
|
+
}, props)));
|
|
40642
40644
|
}
|
|
40643
40645
|
|
|
40644
40646
|
const PaymentMethodCreateModal = props => {
|