@pelcro/react-pelcro-js 3.36.0 → 3.37.0
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 +258 -175
- package/dist/index.esm.js +259 -175
- package/dist/pelcro.css +13 -13
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3363,12 +3363,19 @@ var paymentMethod_en = {
|
|
|
3363
3363
|
select: select$6,
|
|
3364
3364
|
"delete": {
|
|
3365
3365
|
title: "Delete payment method",
|
|
3366
|
-
subtitle: "
|
|
3366
|
+
subtitle: "Are you sure you want to delete the selected payment method?",
|
|
3367
|
+
details: "Payment method details",
|
|
3368
|
+
message: "This action is irreversible and will permanently remove the payment method from the system. Please ensure that there are no pending transactions or subscriptions associated with this payment method.",
|
|
3369
|
+
buttons: {
|
|
3370
|
+
"delete": "Delete payment method",
|
|
3371
|
+
back: "Go back"
|
|
3372
|
+
},
|
|
3367
3373
|
options: {
|
|
3368
|
-
select: "Select
|
|
3374
|
+
select: "Select a payment method to be the default",
|
|
3369
3375
|
add: "Add a new payment method"
|
|
3370
3376
|
},
|
|
3371
|
-
paymentMethodReplaced: "Payment Method Successfully Deleted and Replaced"
|
|
3377
|
+
paymentMethodReplaced: "Payment Method Successfully Deleted and Replaced",
|
|
3378
|
+
deletedSuccessfully: "Payment Method Successfully Deleted"
|
|
3372
3379
|
},
|
|
3373
3380
|
create: create$5
|
|
3374
3381
|
};
|
|
@@ -9589,6 +9596,17 @@ const getPaymentCardIcon$1 = name => {
|
|
|
9589
9596
|
}), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
9590
9597
|
fill: "#FFF",
|
|
9591
9598
|
d: "M22.255 20l-2.113 4.683L18.039 20h-2.695v6.726L12.341 20h-2.274L7 26.981h1.815l.671-1.558h3.432l.682 1.558h3.465v-5.185l2.299 5.185h1.563l2.351-5.095v5.095H25V20H22.255zM10.135 23.915l1.026-2.44 1.066 2.44H10.135zM37.883 23.413L41 20.018h-2.217l-1.994 2.164L34.86 20H28v6.982h6.635l2.092-2.311L38.767 27h2.21L37.883 23.413zM33.728 25.516h-4.011v-1.381h3.838v-1.323h-3.838v-1.308l4.234.012 1.693 1.897L33.728 25.516z"
|
|
9599
|
+
})),
|
|
9600
|
+
amex: /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
9601
|
+
className: "plc-w-16",
|
|
9602
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9603
|
+
viewBox: "0 0 48 48"
|
|
9604
|
+
}, /*#__PURE__*/React__default['default'].createElement("path", {
|
|
9605
|
+
fill: "#1976D2",
|
|
9606
|
+
d: "M45,35c0,2.209-1.791,4-4,4H7c-2.209,0-4-1.791-4-4V13c0-2.209,1.791-4,4-4h34c2.209,0,4,1.791,4,4V35z"
|
|
9607
|
+
}), /*#__PURE__*/React__default['default'].createElement("path", {
|
|
9608
|
+
fill: "#FFF",
|
|
9609
|
+
d: "M22.255 20l-2.113 4.683L18.039 20h-2.695v6.726L12.341 20h-2.274L7 26.981h1.815l.671-1.558h3.432l.682 1.558h3.465v-5.185l2.299 5.185h1.563l2.351-5.095v5.095H25V20H22.255zM10.135 23.915l1.026-2.44 1.066 2.44H10.135zM37.883 23.413L41 20.018h-2.217l-1.994 2.164L34.86 20H28v6.982h6.635l2.092-2.311L38.767 27h2.21L37.883 23.413zM33.728 25.516h-4.011v-1.381h3.838v-1.323h-3.838v-1.308l4.234.012 1.693 1.897L33.728 25.516z"
|
|
9592
9610
|
}))
|
|
9593
9611
|
};
|
|
9594
9612
|
return name ? icons[name.toLowerCase()] : /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
@@ -9640,6 +9658,19 @@ function notifyBugsnag(callback, startOptions) {
|
|
|
9640
9658
|
}
|
|
9641
9659
|
callback();
|
|
9642
9660
|
}
|
|
9661
|
+
const refreshUser = () => {
|
|
9662
|
+
var _window$Pelcro6, _window$Pelcro6$user, _window$Pelcro6$user$;
|
|
9663
|
+
window.Pelcro.user.refresh({
|
|
9664
|
+
auth_token: (_window$Pelcro6 = window.Pelcro) === null || _window$Pelcro6 === void 0 ? void 0 : (_window$Pelcro6$user = _window$Pelcro6.user) === null || _window$Pelcro6$user === void 0 ? void 0 : (_window$Pelcro6$user$ = _window$Pelcro6$user.read()) === null || _window$Pelcro6$user$ === void 0 ? void 0 : _window$Pelcro6$user$.auth_token
|
|
9665
|
+
}, (err, res) => {
|
|
9666
|
+
if (err) {
|
|
9667
|
+
console.error(err);
|
|
9668
|
+
}
|
|
9669
|
+
if (res) {
|
|
9670
|
+
return res.data;
|
|
9671
|
+
}
|
|
9672
|
+
});
|
|
9673
|
+
};
|
|
9643
9674
|
|
|
9644
9675
|
const resources = {
|
|
9645
9676
|
en: {
|
|
@@ -12610,8 +12641,8 @@ const SET_CANCEL_SUBSCRIPTION_REASON = "SET_CANCEL_SUBSCRIPTION_REASON";
|
|
|
12610
12641
|
const SET_CANCEL_SUBSCRIPTION_OPTION = "SET_CANCEL_SUBSCRIPTION_OPTION";
|
|
12611
12642
|
const HANDLE_CHECKBOX_CHANGE = "HANDLE_CHECKBOX_CHANGE";
|
|
12612
12643
|
const SET_IS_DEFAULT_PAYMENT_METHOD = "SET_IS_DEFAULT_PAYMENT_METHOD";
|
|
12613
|
-
const SET_DELETE_PAYMENT_METHOD_OPTION = "SET_DELETE_PAYMENT_METHOD_OPTION";
|
|
12614
12644
|
const SET_PAYMENT_METHODS = "SET_PAYMENT_METHODS";
|
|
12645
|
+
const SHOW_PAYMENT_METHOD_SELECT = "SHOW_PAYMENT_METHOD_SELECT";
|
|
12615
12646
|
const SET_SUBSCRIPTION_SUSPEND_DATE = "SET_SUBSCRIPTION_SUSPEND_DATE";
|
|
12616
12647
|
const SET_EMAILS = "SET_EMAILS";
|
|
12617
12648
|
const SET_EMAILS_ERROR = "SET_EMAILS_ERROR";
|
|
@@ -18125,6 +18156,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
18125
18156
|
content: t("messages.sourceCreated")
|
|
18126
18157
|
}
|
|
18127
18158
|
});
|
|
18159
|
+
refreshUser();
|
|
18128
18160
|
onSuccess(res);
|
|
18129
18161
|
});
|
|
18130
18162
|
}
|
|
@@ -18179,6 +18211,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
18179
18211
|
}
|
|
18180
18212
|
});
|
|
18181
18213
|
}
|
|
18214
|
+
refreshUser();
|
|
18182
18215
|
onSuccess(res);
|
|
18183
18216
|
});
|
|
18184
18217
|
}, 2000);
|
|
@@ -18240,6 +18273,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
18240
18273
|
content: t("messages.sourceUpdated")
|
|
18241
18274
|
}
|
|
18242
18275
|
});
|
|
18276
|
+
refreshUser();
|
|
18243
18277
|
onSuccess(res);
|
|
18244
18278
|
});
|
|
18245
18279
|
}
|
|
@@ -18798,6 +18832,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
18798
18832
|
type: LOADING,
|
|
18799
18833
|
payload: false
|
|
18800
18834
|
});
|
|
18835
|
+
refreshUser();
|
|
18801
18836
|
onSuccess(res);
|
|
18802
18837
|
return;
|
|
18803
18838
|
}
|
|
@@ -18813,6 +18848,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
18813
18848
|
content: t("messages.sourceCreated")
|
|
18814
18849
|
}
|
|
18815
18850
|
});
|
|
18851
|
+
refreshUser();
|
|
18816
18852
|
onSuccess(res);
|
|
18817
18853
|
return;
|
|
18818
18854
|
}
|
|
@@ -18832,6 +18868,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
18832
18868
|
content: t("messages.sourceUpdated")
|
|
18833
18869
|
}
|
|
18834
18870
|
});
|
|
18871
|
+
refreshUser();
|
|
18835
18872
|
onSuccess(res);
|
|
18836
18873
|
return;
|
|
18837
18874
|
}
|
|
@@ -18859,6 +18896,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
18859
18896
|
}
|
|
18860
18897
|
});
|
|
18861
18898
|
}
|
|
18899
|
+
refreshUser();
|
|
18862
18900
|
onSuccess(res);
|
|
18863
18901
|
});
|
|
18864
18902
|
}, 2000);
|
|
@@ -18890,7 +18928,8 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
18890
18928
|
gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
|
|
18891
18929
|
address_id: product.address_required ? selectedAddressId : null
|
|
18892
18930
|
}, (err, res) => {
|
|
18893
|
-
|
|
18931
|
+
var _res$data;
|
|
18932
|
+
if (res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && _res$data.setup_intent) {
|
|
18894
18933
|
return confirmStripeIntentSetup(res, "subCreate");
|
|
18895
18934
|
}
|
|
18896
18935
|
confirmStripeCardPayment(res, err, true);
|
|
@@ -19156,7 +19195,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
19156
19195
|
auth_token: window.Pelcro.user.read().auth_token,
|
|
19157
19196
|
token: source.id
|
|
19158
19197
|
}, (err, res) => {
|
|
19159
|
-
var _res$
|
|
19198
|
+
var _res$data2, _res$data2$setup_inte, _res$data3, _res$data3$setup_inte;
|
|
19160
19199
|
if (err) {
|
|
19161
19200
|
dispatch({
|
|
19162
19201
|
type: DISABLE_SUBMIT,
|
|
@@ -19175,7 +19214,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
19175
19214
|
}
|
|
19176
19215
|
});
|
|
19177
19216
|
}
|
|
19178
|
-
if (((_res$
|
|
19217
|
+
if (((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : (_res$data2$setup_inte = _res$data2.setup_intent) === null || _res$data2$setup_inte === void 0 ? void 0 : _res$data2$setup_inte.status) === "requires_action" || ((_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : (_res$data3$setup_inte = _res$data3.setup_intent) === null || _res$data3$setup_inte === void 0 ? void 0 : _res$data3$setup_inte.status) === "requires_confirmation") {
|
|
19179
19218
|
confirmStripeIntentSetup(res, "create");
|
|
19180
19219
|
} else {
|
|
19181
19220
|
dispatch({
|
|
@@ -19189,6 +19228,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
19189
19228
|
content: t("messages.sourceCreated")
|
|
19190
19229
|
}
|
|
19191
19230
|
});
|
|
19231
|
+
refreshUser();
|
|
19192
19232
|
onSuccess(res);
|
|
19193
19233
|
}
|
|
19194
19234
|
});
|
|
@@ -19211,7 +19251,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
19211
19251
|
exp_year: year,
|
|
19212
19252
|
is_default: isDefault
|
|
19213
19253
|
}, (err, res) => {
|
|
19214
|
-
var _res$
|
|
19254
|
+
var _res$data4, _res$data4$setup_inte, _res$data5, _res$data5$setup_inte;
|
|
19215
19255
|
dispatch({
|
|
19216
19256
|
type: DISABLE_SUBMIT,
|
|
19217
19257
|
payload: false
|
|
@@ -19230,7 +19270,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
19230
19270
|
}
|
|
19231
19271
|
});
|
|
19232
19272
|
}
|
|
19233
|
-
if (((_res$
|
|
19273
|
+
if (((_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : (_res$data4$setup_inte = _res$data4.setup_intent) === null || _res$data4$setup_inte === void 0 ? void 0 : _res$data4$setup_inte.status) === "requires_action" || ((_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : (_res$data5$setup_inte = _res$data5.setup_intent) === null || _res$data5$setup_inte === void 0 ? void 0 : _res$data5$setup_inte.status) === "requires_confirmation") {
|
|
19234
19274
|
confirmStripeIntentSetup(res, "update");
|
|
19235
19275
|
} else {
|
|
19236
19276
|
dispatch({
|
|
@@ -19240,6 +19280,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
19240
19280
|
content: t("messages.sourceUpdated")
|
|
19241
19281
|
}
|
|
19242
19282
|
});
|
|
19283
|
+
refreshUser();
|
|
19243
19284
|
onSuccess(res);
|
|
19244
19285
|
}
|
|
19245
19286
|
});
|
|
@@ -19272,7 +19313,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
19272
19313
|
auth_token: window.Pelcro.user.read().auth_token,
|
|
19273
19314
|
token: source.id
|
|
19274
19315
|
}, (err, res) => {
|
|
19275
|
-
var _res$
|
|
19316
|
+
var _res$data6, _res$data6$setup_inte, _res$data7, _res$data7$setup_inte;
|
|
19276
19317
|
if (err) {
|
|
19277
19318
|
onFailure(err);
|
|
19278
19319
|
return dispatch({
|
|
@@ -19283,7 +19324,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
19283
19324
|
}
|
|
19284
19325
|
});
|
|
19285
19326
|
}
|
|
19286
|
-
if (((_res$
|
|
19327
|
+
if (((_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : (_res$data6$setup_inte = _res$data6.setup_intent) === null || _res$data6$setup_inte === void 0 ? void 0 : _res$data6$setup_inte.status) === "requires_action" || ((_res$data7 = res.data) === null || _res$data7 === void 0 ? void 0 : (_res$data7$setup_inte = _res$data7.setup_intent) === null || _res$data7$setup_inte === void 0 ? void 0 : _res$data7$setup_inte.status) === "requires_confirmation") {
|
|
19287
19328
|
confirmStripeIntentSetup(res, "replace", paymentMethodId);
|
|
19288
19329
|
} else {
|
|
19289
19330
|
setTimeout(() => {
|
|
@@ -19309,6 +19350,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
19309
19350
|
}
|
|
19310
19351
|
});
|
|
19311
19352
|
}
|
|
19353
|
+
refreshUser();
|
|
19312
19354
|
onSuccess(res);
|
|
19313
19355
|
});
|
|
19314
19356
|
}, 2000);
|
|
@@ -19404,12 +19446,12 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
19404
19446
|
coupon_code: state === null || state === void 0 ? void 0 : state.couponCode,
|
|
19405
19447
|
address_id: selectedAddressId
|
|
19406
19448
|
}, (error, res) => {
|
|
19407
|
-
var _res$
|
|
19449
|
+
var _res$data8, _res$data9;
|
|
19408
19450
|
if (error) {
|
|
19409
19451
|
return reject(error);
|
|
19410
19452
|
}
|
|
19411
|
-
const taxAmount = (_res$
|
|
19412
|
-
const totalAmountWithTax = (_res$
|
|
19453
|
+
const taxAmount = (_res$data8 = res.data) === null || _res$data8 === void 0 ? void 0 : _res$data8.taxes;
|
|
19454
|
+
const totalAmountWithTax = (_res$data9 = res.data) === null || _res$data9 === void 0 ? void 0 : _res$data9.total;
|
|
19413
19455
|
resolve({
|
|
19414
19456
|
totalAmountWithTax,
|
|
19415
19457
|
taxAmount
|
|
@@ -25335,7 +25377,8 @@ const PasswordResetContainer = _ref => {
|
|
|
25335
25377
|
email,
|
|
25336
25378
|
password,
|
|
25337
25379
|
password_confirmation: confirmPassword,
|
|
25338
|
-
token
|
|
25380
|
+
token,
|
|
25381
|
+
referer: window.location.origin
|
|
25339
25382
|
}, (err, res) => {
|
|
25340
25383
|
dispatch({
|
|
25341
25384
|
type: DISABLE_SUBMIT,
|
|
@@ -25567,7 +25610,8 @@ const PasswordForgotContainer = _ref => {
|
|
|
25567
25610
|
email
|
|
25568
25611
|
} = _ref2;
|
|
25569
25612
|
window.Pelcro.password.forgot({
|
|
25570
|
-
email
|
|
25613
|
+
email,
|
|
25614
|
+
referer: window.location.origin
|
|
25571
25615
|
}, (err, res) => {
|
|
25572
25616
|
dispatch({
|
|
25573
25617
|
type: DISABLE_SUBMIT,
|
|
@@ -27692,17 +27736,21 @@ const AddressSelectModal = _ref => {
|
|
|
27692
27736
|
AddressSelectModal.viewId = "address-select";
|
|
27693
27737
|
|
|
27694
27738
|
const moveDefaultPaymentMethodToStart = paymentMethods => {
|
|
27695
|
-
|
|
27696
|
-
const defaultPaymentMethod = (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.source;
|
|
27739
|
+
const defaultPaymentMethod = getDefaultPaymentMethod(paymentMethods);
|
|
27697
27740
|
const paymentMethodsWithoutDefault = paymentMethods.filter(paymentMethod => paymentMethod.id !== defaultPaymentMethod.id);
|
|
27698
27741
|
if (defaultPaymentMethod.status !== "chargeable") {
|
|
27699
27742
|
return paymentMethodsWithoutDefault;
|
|
27700
27743
|
}
|
|
27701
27744
|
return [defaultPaymentMethod, ...paymentMethodsWithoutDefault];
|
|
27702
27745
|
};
|
|
27746
|
+
const getDefaultPaymentMethod = paymentMethods => {
|
|
27747
|
+
const defaultPaymentMethod = paymentMethods.find(paymentMethod => paymentMethod.is_default);
|
|
27748
|
+
return defaultPaymentMethod;
|
|
27749
|
+
};
|
|
27703
27750
|
const initialState$5 = {
|
|
27704
27751
|
paymentMethods: [],
|
|
27705
27752
|
selectedPaymentMethodId: null,
|
|
27753
|
+
skeletonLoader: true,
|
|
27706
27754
|
isSubmitting: false,
|
|
27707
27755
|
alert: {
|
|
27708
27756
|
type: "error",
|
|
@@ -27733,12 +27781,11 @@ const PaymentMethodSelectContainer = _ref => {
|
|
|
27733
27781
|
});
|
|
27734
27782
|
return onSuccess(selectedPaymentMethodId);
|
|
27735
27783
|
};
|
|
27736
|
-
const getInitialSelectedMethodId =
|
|
27737
|
-
var _window$Pelcro$user$r2;
|
|
27784
|
+
const getInitialSelectedMethodId = paymentMethods => {
|
|
27738
27785
|
if (selectedPaymentMethodIdFromStore) {
|
|
27739
27786
|
return selectedPaymentMethodIdFromStore;
|
|
27740
27787
|
}
|
|
27741
|
-
const defaultMethod = (
|
|
27788
|
+
const defaultMethod = getDefaultPaymentMethod(paymentMethods);
|
|
27742
27789
|
if (defaultMethod && defaultMethod.status === "chargeable") {
|
|
27743
27790
|
return String(defaultMethod.id);
|
|
27744
27791
|
}
|
|
@@ -27755,7 +27802,12 @@ const PaymentMethodSelectContainer = _ref => {
|
|
|
27755
27802
|
return lib_7({
|
|
27756
27803
|
...state,
|
|
27757
27804
|
paymentMethods: moveDefaultPaymentMethodToStart(action.payload),
|
|
27758
|
-
selectedPaymentMethodId: getInitialSelectedMethodId()
|
|
27805
|
+
selectedPaymentMethodId: getInitialSelectedMethodId(action.payload)
|
|
27806
|
+
});
|
|
27807
|
+
case SKELETON_LOADER:
|
|
27808
|
+
return lib_7({
|
|
27809
|
+
...state,
|
|
27810
|
+
skeletonLoader: action.payload
|
|
27759
27811
|
});
|
|
27760
27812
|
case HANDLE_SUBMIT:
|
|
27761
27813
|
return lib_5({
|
|
@@ -27767,10 +27819,23 @@ const PaymentMethodSelectContainer = _ref => {
|
|
|
27767
27819
|
}
|
|
27768
27820
|
}, initialState$5);
|
|
27769
27821
|
React.useEffect(() => {
|
|
27770
|
-
|
|
27771
|
-
|
|
27772
|
-
|
|
27773
|
-
|
|
27822
|
+
window.Pelcro.paymentMethods.list({
|
|
27823
|
+
auth_token: window.Pelcro.user.read().auth_token
|
|
27824
|
+
}, (err, res) => {
|
|
27825
|
+
if (err) {
|
|
27826
|
+
return console.error(err);
|
|
27827
|
+
}
|
|
27828
|
+
if (res) {
|
|
27829
|
+
var _res$data;
|
|
27830
|
+
dispatch({
|
|
27831
|
+
type: LOAD_PAYMENT_METHODS,
|
|
27832
|
+
payload: (_res$data = res.data) !== null && _res$data !== void 0 ? _res$data : []
|
|
27833
|
+
});
|
|
27834
|
+
dispatch({
|
|
27835
|
+
type: SKELETON_LOADER,
|
|
27836
|
+
payload: false
|
|
27837
|
+
});
|
|
27838
|
+
}
|
|
27774
27839
|
});
|
|
27775
27840
|
}, []);
|
|
27776
27841
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -27799,7 +27864,8 @@ const PaymentMethodSelectList = () => {
|
|
|
27799
27864
|
dispatch,
|
|
27800
27865
|
state: {
|
|
27801
27866
|
paymentMethods,
|
|
27802
|
-
selectedPaymentMethodId
|
|
27867
|
+
selectedPaymentMethodId,
|
|
27868
|
+
skeletonLoader
|
|
27803
27869
|
}
|
|
27804
27870
|
} = React.useContext(store$5);
|
|
27805
27871
|
const handlePaymentMethodSelect = event => {
|
|
@@ -27808,7 +27874,9 @@ const PaymentMethodSelectList = () => {
|
|
|
27808
27874
|
payload: event.target.value
|
|
27809
27875
|
});
|
|
27810
27876
|
};
|
|
27811
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
27877
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, skeletonLoader ? /*#__PURE__*/React__default['default'].createElement("div", {
|
|
27878
|
+
className: "plc-w-full plc-h-20 plc-bg-gray-300 plc-rounded-md plc-animate-pulse"
|
|
27879
|
+
}) : /*#__PURE__*/React__default['default'].createElement("div", {
|
|
27812
27880
|
className: "plc-px-3 plc-py-2 plc-space-y-4 plc-overflow-y-scroll plc-max-h-80 pelcro-payment-method-select-wrapper"
|
|
27813
27881
|
}, paymentMethods.map(paymentMethod => {
|
|
27814
27882
|
var _paymentMethod$proper, _paymentMethod$proper2, _paymentMethod$proper3, _paymentMethod$proper4;
|
|
@@ -27831,7 +27899,7 @@ const PaymentMethodSelectList = () => {
|
|
|
27831
27899
|
}, "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 ", (_paymentMethod$proper2 = paymentMethod.properties) === null || _paymentMethod$proper2 === void 0 ? void 0 : _paymentMethod$proper2.last4), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
27832
27900
|
className: "plc-text-sm plc-text-gray-500"
|
|
27833
27901
|
}, t("select.expires"), " ", (_paymentMethod$proper3 = paymentMethod.properties) === null || _paymentMethod$proper3 === void 0 ? void 0 : _paymentMethod$proper3.exp_month, "/", (_paymentMethod$proper4 = paymentMethod.properties) === null || _paymentMethod$proper4 === void 0 ? void 0 : _paymentMethod$proper4.exp_year))));
|
|
27834
|
-
}));
|
|
27902
|
+
})));
|
|
27835
27903
|
};
|
|
27836
27904
|
|
|
27837
27905
|
const PaymentMethodSelectSubmit = _ref => {
|
|
@@ -27933,10 +28001,10 @@ const initialState$4 = {
|
|
|
27933
28001
|
paymentMethods: [],
|
|
27934
28002
|
selectedPaymentMethodId: null,
|
|
27935
28003
|
isSubmitting: false,
|
|
27936
|
-
|
|
27937
|
-
disableSubmit: false,
|
|
28004
|
+
disableSubmit: true,
|
|
27938
28005
|
isLoading: false,
|
|
27939
28006
|
skeletonLoader: true,
|
|
28007
|
+
showPaymentMethodSelect: false,
|
|
27940
28008
|
alert: {
|
|
27941
28009
|
type: "error",
|
|
27942
28010
|
content: ""
|
|
@@ -27973,20 +28041,19 @@ const PaymentMethodDeleteContainer = _ref => {
|
|
|
27973
28041
|
type: SKELETON_LOADER,
|
|
27974
28042
|
payload: false
|
|
27975
28043
|
});
|
|
27976
|
-
if (res.data.length !== 1) {
|
|
27977
|
-
dispatch({
|
|
27978
|
-
type: SET_DELETE_PAYMENT_METHOD_OPTION,
|
|
27979
|
-
payload: "select"
|
|
27980
|
-
});
|
|
27981
|
-
} else {
|
|
28044
|
+
if (res.data.length !== 1 && paymentMethodToDelete.is_default && paymentMethodToDelete.deletable) {
|
|
27982
28045
|
dispatch({
|
|
27983
|
-
type:
|
|
27984
|
-
payload:
|
|
28046
|
+
type: SHOW_PAYMENT_METHOD_SELECT,
|
|
28047
|
+
payload: true
|
|
27985
28048
|
});
|
|
27986
28049
|
}
|
|
28050
|
+
dispatch({
|
|
28051
|
+
type: DISABLE_SUBMIT,
|
|
28052
|
+
payload: false
|
|
28053
|
+
});
|
|
27987
28054
|
}
|
|
27988
28055
|
});
|
|
27989
|
-
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
28056
|
+
}, [paymentMethodToDelete]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
27990
28057
|
|
|
27991
28058
|
const setDefaultPaymentMethod = () => {
|
|
27992
28059
|
const {
|
|
@@ -27998,6 +28065,15 @@ const PaymentMethodDeleteContainer = _ref => {
|
|
|
27998
28065
|
is_default: true
|
|
27999
28066
|
}, (err, res) => {
|
|
28000
28067
|
if (err) {
|
|
28068
|
+
dispatch({
|
|
28069
|
+
type: DISABLE_SUBMIT,
|
|
28070
|
+
payload: false
|
|
28071
|
+
});
|
|
28072
|
+
dispatch({
|
|
28073
|
+
type: LOADING,
|
|
28074
|
+
payload: false
|
|
28075
|
+
});
|
|
28076
|
+
console.log(err);
|
|
28001
28077
|
onFailure(err);
|
|
28002
28078
|
return dispatch({
|
|
28003
28079
|
type: SHOW_ALERT,
|
|
@@ -28020,6 +28096,14 @@ const PaymentMethodDeleteContainer = _ref => {
|
|
|
28020
28096
|
auth_token: window.Pelcro.user.read().auth_token,
|
|
28021
28097
|
payment_method_id: paymentMethodId
|
|
28022
28098
|
}, (err, res) => {
|
|
28099
|
+
dispatch({
|
|
28100
|
+
type: DISABLE_SUBMIT,
|
|
28101
|
+
payload: false
|
|
28102
|
+
});
|
|
28103
|
+
dispatch({
|
|
28104
|
+
type: LOADING,
|
|
28105
|
+
payload: false
|
|
28106
|
+
});
|
|
28023
28107
|
if (err) {
|
|
28024
28108
|
onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
28025
28109
|
return dispatch({
|
|
@@ -28030,14 +28114,6 @@ const PaymentMethodDeleteContainer = _ref => {
|
|
|
28030
28114
|
}
|
|
28031
28115
|
});
|
|
28032
28116
|
}
|
|
28033
|
-
dispatch({
|
|
28034
|
-
type: DISABLE_SUBMIT,
|
|
28035
|
-
payload: false
|
|
28036
|
-
});
|
|
28037
|
-
dispatch({
|
|
28038
|
-
type: LOADING,
|
|
28039
|
-
payload: false
|
|
28040
|
-
});
|
|
28041
28117
|
onSuccess(res);
|
|
28042
28118
|
});
|
|
28043
28119
|
};
|
|
@@ -28053,11 +28129,12 @@ const PaymentMethodDeleteContainer = _ref => {
|
|
|
28053
28129
|
...state,
|
|
28054
28130
|
disableSubmit: true,
|
|
28055
28131
|
isLoading: true
|
|
28056
|
-
}, (state, dispatch) =>
|
|
28057
|
-
|
|
28058
|
-
|
|
28059
|
-
|
|
28060
|
-
|
|
28132
|
+
}, (state, dispatch) => {
|
|
28133
|
+
if (state.showPaymentMethodSelect) {
|
|
28134
|
+
setDefaultPaymentMethod();
|
|
28135
|
+
} else {
|
|
28136
|
+
deletePaymentMethod();
|
|
28137
|
+
}
|
|
28061
28138
|
});
|
|
28062
28139
|
case SET_PAYMENT_METHODS:
|
|
28063
28140
|
return lib_7({
|
|
@@ -28084,6 +28161,11 @@ const PaymentMethodDeleteContainer = _ref => {
|
|
|
28084
28161
|
...state,
|
|
28085
28162
|
skeletonLoader: action.payload
|
|
28086
28163
|
});
|
|
28164
|
+
case SHOW_PAYMENT_METHOD_SELECT:
|
|
28165
|
+
return lib_7({
|
|
28166
|
+
...state,
|
|
28167
|
+
showPaymentMethodSelect: action.payload
|
|
28168
|
+
});
|
|
28087
28169
|
default:
|
|
28088
28170
|
return state;
|
|
28089
28171
|
}
|
|
@@ -28106,6 +28188,91 @@ const PaymentMethodDeleteContainer = _ref => {
|
|
|
28106
28188
|
})));
|
|
28107
28189
|
};
|
|
28108
28190
|
|
|
28191
|
+
const PaymentMethodDeleteList = props => {
|
|
28192
|
+
const {
|
|
28193
|
+
t
|
|
28194
|
+
} = useTranslation("paymentMethod");
|
|
28195
|
+
const {
|
|
28196
|
+
dispatch,
|
|
28197
|
+
state: {
|
|
28198
|
+
selectedPaymentMethodId,
|
|
28199
|
+
paymentMethods,
|
|
28200
|
+
skeletonLoader,
|
|
28201
|
+
showPaymentMethodSelect
|
|
28202
|
+
}
|
|
28203
|
+
} = React.useContext(store$4);
|
|
28204
|
+
const {
|
|
28205
|
+
paymentMethodToDelete
|
|
28206
|
+
} = usePelcro();
|
|
28207
|
+
const createPaymentMethodItems = () => {
|
|
28208
|
+
if (paymentMethods.length) {
|
|
28209
|
+
return paymentMethods.filter(paymentMethod => (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id) !== (paymentMethodToDelete === null || paymentMethodToDelete === void 0 ? void 0 : paymentMethodToDelete.id)).map(paymentMethod => /*#__PURE__*/React__default['default'].createElement("option", {
|
|
28210
|
+
key: paymentMethod.id,
|
|
28211
|
+
value: paymentMethod.id
|
|
28212
|
+
}, paymentMethod.properties.brand, " -", " ", paymentMethod.properties.last4, " -", " ", paymentMethod.properties.exp_month, " /", paymentMethod.properties.exp_year));
|
|
28213
|
+
}
|
|
28214
|
+
};
|
|
28215
|
+
const handlePaymentMethodSelect = event => {
|
|
28216
|
+
dispatch({
|
|
28217
|
+
type: SELECT_PAYMENT_METHOD,
|
|
28218
|
+
payload: event.target.value
|
|
28219
|
+
});
|
|
28220
|
+
};
|
|
28221
|
+
if (showPaymentMethodSelect) {
|
|
28222
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, skeletonLoader ? /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28223
|
+
className: "plc-w-full plc-h-8 plc-bg-gray-300 plc-rounded-md plc-animate-pulse"
|
|
28224
|
+
}) : /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, paymentMethods && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28225
|
+
className: "plc-mt-4"
|
|
28226
|
+
}, /*#__PURE__*/React__default['default'].createElement(Select, {
|
|
28227
|
+
label: t("delete.options.select"),
|
|
28228
|
+
name: "default-payment-method",
|
|
28229
|
+
onChange: handlePaymentMethodSelect,
|
|
28230
|
+
value: selectedPaymentMethodId
|
|
28231
|
+
}, /*#__PURE__*/React__default['default'].createElement("option", {
|
|
28232
|
+
value: "",
|
|
28233
|
+
disabled: true,
|
|
28234
|
+
selected: true
|
|
28235
|
+
}), createPaymentMethodItems()))));
|
|
28236
|
+
} else {
|
|
28237
|
+
return null;
|
|
28238
|
+
}
|
|
28239
|
+
};
|
|
28240
|
+
|
|
28241
|
+
const PaymentMethodDetails = () => {
|
|
28242
|
+
var _paymentMethodToDelet, _paymentMethodToDelet2, _paymentMethodToDelet3, _paymentMethodToDelet4;
|
|
28243
|
+
const {
|
|
28244
|
+
state: {
|
|
28245
|
+
skeletonLoader
|
|
28246
|
+
}
|
|
28247
|
+
} = React.useContext(store$4);
|
|
28248
|
+
const {
|
|
28249
|
+
t
|
|
28250
|
+
} = useTranslation("paymentMethod");
|
|
28251
|
+
const {
|
|
28252
|
+
paymentMethodToDelete
|
|
28253
|
+
} = usePelcro();
|
|
28254
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28255
|
+
className: "plc-text-left plc-mr-auto plc-mb-6"
|
|
28256
|
+
}, /*#__PURE__*/React__default['default'].createElement("h4", {
|
|
28257
|
+
className: "plc-mb-2"
|
|
28258
|
+
}, t("delete.details")), skeletonLoader ? /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28259
|
+
className: "plc-w-full plc-h-16 plc-bg-gray-300 plc-rounded-md plc-animate-pulse"
|
|
28260
|
+
}) : /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, paymentMethodToDelete && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28261
|
+
key: paymentMethodToDelete === null || paymentMethodToDelete === void 0 ? void 0 : paymentMethodToDelete.id,
|
|
28262
|
+
className: `plc-p-2 plc-pl-4 plc-shadow-md_dark plc-text-gray-900 plc-rounded pelcro-payment-method-wrapper`
|
|
28263
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28264
|
+
className: "plc-flex plc-items-center plc-space-x-2 plc-w-full pelcro-select-payment-method-radio",
|
|
28265
|
+
id: `pelcro-payment-method-select-${paymentMethodToDelete === null || paymentMethodToDelete === void 0 ? void 0 : paymentMethodToDelete.id}`,
|
|
28266
|
+
name: "paymentMethod"
|
|
28267
|
+
}, getPaymentCardIcon$1((_paymentMethodToDelet = paymentMethodToDelete.properties) === null || _paymentMethodToDelet === void 0 ? void 0 : _paymentMethodToDelet.brand), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28268
|
+
className: "plc-flex plc-flex-col plc-text-lg pelcro-payment-method-details"
|
|
28269
|
+
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
28270
|
+
className: "plc-font-semibold"
|
|
28271
|
+
}, "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022", " ", (_paymentMethodToDelet2 = paymentMethodToDelete.properties) === null || _paymentMethodToDelet2 === void 0 ? void 0 : _paymentMethodToDelet2.last4), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
28272
|
+
className: "plc-text-sm plc-text-gray-500"
|
|
28273
|
+
}, t("select.expires"), " ", (_paymentMethodToDelet3 = paymentMethodToDelete.properties) === null || _paymentMethodToDelet3 === void 0 ? void 0 : _paymentMethodToDelet3.exp_month, "/", (_paymentMethodToDelet4 = paymentMethodToDelete.properties) === null || _paymentMethodToDelet4 === void 0 ? void 0 : _paymentMethodToDelet4.exp_year))))));
|
|
28274
|
+
};
|
|
28275
|
+
|
|
28109
28276
|
const PaymentMethodDeleteSubmit = _ref => {
|
|
28110
28277
|
let {
|
|
28111
28278
|
name,
|
|
@@ -28119,7 +28286,9 @@ const PaymentMethodDeleteSubmit = _ref => {
|
|
|
28119
28286
|
dispatch,
|
|
28120
28287
|
state: {
|
|
28121
28288
|
isLoading,
|
|
28122
|
-
|
|
28289
|
+
disableSubmit,
|
|
28290
|
+
showPaymentMethodSelect,
|
|
28291
|
+
selectedPaymentMethodId
|
|
28123
28292
|
}
|
|
28124
28293
|
} = React.useContext(store$4);
|
|
28125
28294
|
return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
|
|
@@ -28129,116 +28298,38 @@ const PaymentMethodDeleteSubmit = _ref => {
|
|
|
28129
28298
|
});
|
|
28130
28299
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
28131
28300
|
},
|
|
28132
|
-
disabled:
|
|
28301
|
+
disabled: showPaymentMethodSelect ? !selectedPaymentMethodId : disableSubmit,
|
|
28133
28302
|
isLoading: isLoading,
|
|
28134
28303
|
className: "plc-w-full"
|
|
28135
|
-
}, otherProps), name !== null && name !== void 0 ? name : t("
|
|
28304
|
+
}, otherProps), name !== null && name !== void 0 ? name : t("delete.buttons.delete"));
|
|
28136
28305
|
};
|
|
28137
28306
|
|
|
28138
|
-
const
|
|
28307
|
+
const PaymentMethodDeleteBack = _ref => {
|
|
28308
|
+
let {
|
|
28309
|
+
name,
|
|
28310
|
+
onClick,
|
|
28311
|
+
...otherProps
|
|
28312
|
+
} = _ref;
|
|
28139
28313
|
const {
|
|
28140
28314
|
t
|
|
28141
28315
|
} = useTranslation("paymentMethod");
|
|
28142
28316
|
const {
|
|
28143
|
-
|
|
28144
|
-
state: {
|
|
28145
|
-
deleteOption,
|
|
28146
|
-
selectedPaymentMethodId,
|
|
28147
|
-
paymentMethods,
|
|
28148
|
-
skeletonLoader
|
|
28149
|
-
}
|
|
28150
|
-
} = React.useContext(store$4);
|
|
28151
|
-
const {
|
|
28152
|
-
paymentMethodToDelete
|
|
28317
|
+
switchView
|
|
28153
28318
|
} = usePelcro();
|
|
28154
|
-
|
|
28155
|
-
|
|
28156
|
-
|
|
28157
|
-
|
|
28158
|
-
|
|
28159
|
-
|
|
28160
|
-
|
|
28161
|
-
|
|
28162
|
-
}) : /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, paymentMethods && deleteOption === "select" && /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28163
|
-
className: "plc-px-3 plc-py-2 plc-space-y-4 plc-overflow-y-scroll no-scrollbar plc-max-h-80 pelcro-payment-method-select-wrapper plc-mb-4"
|
|
28164
|
-
}, paymentMethods.filter(paymentMethod => (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id) !== (paymentMethodToDelete === null || paymentMethodToDelete === void 0 ? void 0 : paymentMethodToDelete.id)).map(paymentMethod => {
|
|
28165
|
-
var _paymentMethod$proper, _paymentMethod$proper2, _paymentMethod$proper3, _paymentMethod$proper4;
|
|
28166
|
-
const isSelected = selectedPaymentMethodId === String(paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id);
|
|
28167
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28168
|
-
key: paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id,
|
|
28169
|
-
className: `plc-p-2 plc-pl-4 plc-shadow-md plc-text-gray-900 plc-rounded pelcro-payment-method-wrapper`
|
|
28170
|
-
}, /*#__PURE__*/React__default['default'].createElement(Radio, {
|
|
28171
|
-
className: "plc-flex plc-items-center pelcro-select-payment-method-radio",
|
|
28172
|
-
labelClassName: "plc-flex plc-items-center plc-space-x-2 plc-cursor-pointer plc-w-full",
|
|
28173
|
-
id: `pelcro-payment-method-select-${paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id}`,
|
|
28174
|
-
name: "paymentMethod",
|
|
28175
|
-
checked: isSelected,
|
|
28176
|
-
value: paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id,
|
|
28177
|
-
onChange: handlePaymentMethodSelect
|
|
28178
|
-
}, getPaymentCardIcon$1((_paymentMethod$proper = paymentMethod.properties) === null || _paymentMethod$proper === void 0 ? void 0 : _paymentMethod$proper.brand), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28179
|
-
className: "plc-flex plc-flex-col plc-text-lg pelcro-payment-method-details"
|
|
28180
|
-
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
28181
|
-
className: "plc-font-semibold"
|
|
28182
|
-
}, "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022", " ", (_paymentMethod$proper2 = paymentMethod.properties) === null || _paymentMethod$proper2 === void 0 ? void 0 : _paymentMethod$proper2.last4), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
28183
|
-
className: "plc-text-sm plc-text-gray-500"
|
|
28184
|
-
}, t("select.expires"), " ", (_paymentMethod$proper3 = paymentMethod.properties) === null || _paymentMethod$proper3 === void 0 ? void 0 : _paymentMethod$proper3.exp_month, "/", (_paymentMethod$proper4 = paymentMethod.properties) === null || _paymentMethod$proper4 === void 0 ? void 0 : _paymentMethod$proper4.exp_year))));
|
|
28185
|
-
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28186
|
-
className: "plc-px-3"
|
|
28187
|
-
}, /*#__PURE__*/React__default['default'].createElement(PaymentMethodDeleteSubmit, null))), deleteOption === "add" && /*#__PURE__*/React__default['default'].createElement(PaymentMethodView, {
|
|
28188
|
-
type: "deletePaymentSource",
|
|
28189
|
-
showCoupon: false,
|
|
28190
|
-
showExternalPaymentMethods: false,
|
|
28191
|
-
showApplePayButton: false,
|
|
28192
|
-
onDisplay: props.onDisplay,
|
|
28193
|
-
onFailure: props.onFailure,
|
|
28194
|
-
onSuccess: props.onSuccess,
|
|
28195
|
-
setAsDefault: true
|
|
28196
|
-
})));
|
|
28319
|
+
return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
|
|
28320
|
+
variant: "outline",
|
|
28321
|
+
onClick: () => {
|
|
28322
|
+
switchView("dashboard");
|
|
28323
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
28324
|
+
},
|
|
28325
|
+
className: "plc-w-full"
|
|
28326
|
+
}, otherProps), name !== null && name !== void 0 ? name : t("delete.buttons.back"));
|
|
28197
28327
|
};
|
|
28198
28328
|
|
|
28199
|
-
|
|
28200
|
-
const {
|
|
28201
|
-
state: {
|
|
28202
|
-
deleteOption,
|
|
28203
|
-
paymentMethods,
|
|
28204
|
-
skeletonLoader
|
|
28205
|
-
},
|
|
28206
|
-
dispatch
|
|
28207
|
-
} = React.useContext(store$4);
|
|
28329
|
+
function PaymentMethodDeleteView(props) {
|
|
28208
28330
|
const {
|
|
28209
28331
|
t
|
|
28210
28332
|
} = useTranslation("paymentMethod");
|
|
28211
|
-
const handleOptionSelect = event => {
|
|
28212
|
-
dispatch({
|
|
28213
|
-
type: SET_DELETE_PAYMENT_METHOD_OPTION,
|
|
28214
|
-
payload: event.target.value
|
|
28215
|
-
});
|
|
28216
|
-
};
|
|
28217
|
-
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28218
|
-
className: "plc-text-left plc-mr-auto plc-mb-6"
|
|
28219
|
-
}, skeletonLoader ? /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28220
|
-
className: "plc-flex plc-flex-col plc-space-y-3"
|
|
28221
|
-
}, /*#__PURE__*/React__default['default'].createElement(Radio, {
|
|
28222
|
-
className: "plc-animate-puls"
|
|
28223
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28224
|
-
className: "plc-w-36 plc-bg-gray-300 plc-h-4 plc-rounded-md plc-animate-pulse"
|
|
28225
|
-
})), /*#__PURE__*/React__default['default'].createElement(Radio, {
|
|
28226
|
-
className: "plc-animate-pulse"
|
|
28227
|
-
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28228
|
-
className: "plc-w-36 plc-bg-gray-300 plc-h-4 plc-rounded-md plc-animate-pulse"
|
|
28229
|
-
}))) : /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, paymentMethods && paymentMethods.length !== 1 && /*#__PURE__*/React__default['default'].createElement(Radio, {
|
|
28230
|
-
onChange: handleOptionSelect,
|
|
28231
|
-
checked: deleteOption === "select",
|
|
28232
|
-
value: "select"
|
|
28233
|
-
}, t("delete.options.select")), /*#__PURE__*/React__default['default'].createElement(Radio, {
|
|
28234
|
-
onChange: handleOptionSelect,
|
|
28235
|
-
checked: deleteOption === "add",
|
|
28236
|
-
value: "add"
|
|
28237
|
-
}, t("delete.options.add"))));
|
|
28238
|
-
};
|
|
28239
|
-
|
|
28240
|
-
function PaymentMethodDeleteView(props) {
|
|
28241
|
-
const [t] = useTranslation("paymentMethod");
|
|
28242
28333
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28243
28334
|
id: "pelcro-payment-method-delete-view"
|
|
28244
28335
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -28246,12 +28337,12 @@ function PaymentMethodDeleteView(props) {
|
|
|
28246
28337
|
}, /*#__PURE__*/React__default['default'].createElement("h4", {
|
|
28247
28338
|
className: "plc-text-2xl plc-font-semibold plc-mb-2"
|
|
28248
28339
|
}, t("delete.title")), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
28249
|
-
className: ""
|
|
28250
|
-
}, t("delete.subtitle"))), /*#__PURE__*/React__default['default'].createElement(PaymentMethodDeleteContainer, props, /*#__PURE__*/React__default['default'].createElement(AlertWithContext, {
|
|
28251
|
-
className: "plc-
|
|
28252
|
-
}
|
|
28253
|
-
|
|
28254
|
-
})));
|
|
28340
|
+
className: "plc-text-sm"
|
|
28341
|
+
}, t("delete.subtitle"))), /*#__PURE__*/React__default['default'].createElement(PaymentMethodDeleteContainer, props, /*#__PURE__*/React__default['default'].createElement(AlertWithContext, null), /*#__PURE__*/React__default['default'].createElement(PaymentMethodDetails, null), /*#__PURE__*/React__default['default'].createElement(PaymentMethodDeleteList, null), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
28342
|
+
className: "plc-text-sm plc-text-justify"
|
|
28343
|
+
}, t("delete.message")), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
28344
|
+
className: "plc-space-x-0 plc-space-y-3 plc-w-full plc-flex plc-flex-col plc-items-center plc-justify-center plc-mt-4"
|
|
28345
|
+
}, /*#__PURE__*/React__default['default'].createElement(PaymentMethodDeleteSubmit, null), /*#__PURE__*/React__default['default'].createElement(PaymentMethodDeleteBack, null))));
|
|
28255
28346
|
}
|
|
28256
28347
|
|
|
28257
28348
|
const PaymentMethodDeleteModal = props => {
|
|
@@ -28278,7 +28369,7 @@ const PaymentMethodDeleteModal = props => {
|
|
|
28278
28369
|
nonInteraction: true
|
|
28279
28370
|
});
|
|
28280
28371
|
}
|
|
28281
|
-
notify$1.success(t("delete.
|
|
28372
|
+
notify$1.success(t("delete.deletedSuccessfully"));
|
|
28282
28373
|
resetView();
|
|
28283
28374
|
};
|
|
28284
28375
|
return /*#__PURE__*/React__default['default'].createElement(Modal, {
|
|
@@ -29464,6 +29555,14 @@ const getPaymentCardIcon = name => {
|
|
|
29464
29555
|
viewBox: "0 0 50 50"
|
|
29465
29556
|
}, /*#__PURE__*/React__default['default'].createElement("path", {
|
|
29466
29557
|
d: "M 5 7 C 2.25 7 0 9.25 0 12 L 0 38 C 0 40.75 2.25 43 5 43 L 45 43 C 47.75 43 50 40.75 50 38 L 50 12 C 50 9.25 47.75 7 45 7 Z M 5 9 L 45 9 C 46.667969 9 48 10.332031 48 12 L 48 38 C 48 39.667969 46.667969 41 45 41 L 5 41 C 3.332031 41 2 39.667969 2 38 L 2 12 C 2 10.332031 3.332031 9 5 9 Z M 8.5625 19.90625 L 4.84375 28.40625 L 7.0625 28.40625 L 7.875 26.5 L 12.0625 26.5 L 12.875 28.40625 L 17.09375 28.40625 L 17.09375 22.09375 L 19.90625 28.40625 L 21.8125 28.40625 L 24.65625 22.1875 L 24.65625 28.40625 L 26.75 28.40625 L 26.75 19.90625 L 23.40625 19.90625 L 20.84375 25.625 L 18.28125 19.90625 L 15 19.90625 L 15 28.09375 L 11.34375 19.90625 Z M 29.5 19.90625 L 29.5 28.4375 L 37.5 28.4375 L 40 25.59375 L 42.46875 28.4375 L 45.125 28.4375 L 41.375 24.0625 L 45.125 19.90625 L 42.46875 19.90625 L 40.0625 22.5625 L 37.75 19.90625 Z M 9.90625 21.6875 L 11.21875 24.6875 L 8.65625 24.6875 Z M 31.5625 21.71875 L 36.65625 21.75 L 38.6875 24.0625 L 36.40625 26.625 L 31.5625 26.625 L 31.5625 24.9375 L 36.1875 24.9375 L 36.1875 23.3125 L 31.5625 23.3125 Z"
|
|
29558
|
+
})),
|
|
29559
|
+
amex: /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
29560
|
+
className: "plc-w-12",
|
|
29561
|
+
fill: "#ffffff",
|
|
29562
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
29563
|
+
viewBox: "0 0 50 50"
|
|
29564
|
+
}, /*#__PURE__*/React__default['default'].createElement("path", {
|
|
29565
|
+
d: "M 5 7 C 2.25 7 0 9.25 0 12 L 0 38 C 0 40.75 2.25 43 5 43 L 45 43 C 47.75 43 50 40.75 50 38 L 50 12 C 50 9.25 47.75 7 45 7 Z M 5 9 L 45 9 C 46.667969 9 48 10.332031 48 12 L 48 38 C 48 39.667969 46.667969 41 45 41 L 5 41 C 3.332031 41 2 39.667969 2 38 L 2 12 C 2 10.332031 3.332031 9 5 9 Z M 8.5625 19.90625 L 4.84375 28.40625 L 7.0625 28.40625 L 7.875 26.5 L 12.0625 26.5 L 12.875 28.40625 L 17.09375 28.40625 L 17.09375 22.09375 L 19.90625 28.40625 L 21.8125 28.40625 L 24.65625 22.1875 L 24.65625 28.40625 L 26.75 28.40625 L 26.75 19.90625 L 23.40625 19.90625 L 20.84375 25.625 L 18.28125 19.90625 L 15 19.90625 L 15 28.09375 L 11.34375 19.90625 Z M 29.5 19.90625 L 29.5 28.4375 L 37.5 28.4375 L 40 25.59375 L 42.46875 28.4375 L 45.125 28.4375 L 41.375 24.0625 L 45.125 19.90625 L 42.46875 19.90625 L 40.0625 22.5625 L 37.75 19.90625 Z M 9.90625 21.6875 L 11.21875 24.6875 L 8.65625 24.6875 Z M 31.5625 21.71875 L 36.65625 21.75 L 38.6875 24.0625 L 36.40625 26.625 L 31.5625 26.625 L 31.5625 24.9375 L 36.1875 24.9375 L 36.1875 23.3125 L 31.5625 23.3125 Z"
|
|
29467
29566
|
}))
|
|
29468
29567
|
};
|
|
29469
29568
|
return (_icons$name$toLowerCa = icons[name === null || name === void 0 ? void 0 : name.toLowerCase()]) !== null && _icons$name$toLowerCa !== void 0 ? _icons$name$toLowerCa : /*#__PURE__*/React__default['default'].createElement("svg", {
|
|
@@ -30790,23 +30889,8 @@ class Dashboard extends React.Component {
|
|
|
30790
30889
|
});
|
|
30791
30890
|
});
|
|
30792
30891
|
_defineProperty$3(this, "onDeletePaymentMethodClick", source => {
|
|
30793
|
-
|
|
30794
|
-
|
|
30795
|
-
this.props.onClose();
|
|
30796
|
-
notify$1.confirm((onSuccess, onFailure) => {
|
|
30797
|
-
this.deletePaymentMethod(source.id, onSuccess, onFailure);
|
|
30798
|
-
}, {
|
|
30799
|
-
confirmMessage: this.locale("messages.paymentMethodDeletion.isSureToDelete"),
|
|
30800
|
-
loadingMessage: this.locale("messages.paymentMethodDeletion.loading"),
|
|
30801
|
-
successMessage: this.locale("messages.paymentMethodDeletion.success"),
|
|
30802
|
-
errorMessage: this.locale("messages.paymentMethodDeletion.error")
|
|
30803
|
-
}, {
|
|
30804
|
-
closeButtonLabel: this.locale("labels.subCancellation.goBack")
|
|
30805
|
-
});
|
|
30806
|
-
} else {
|
|
30807
|
-
this.props.setPaymentMethodToDelete(source.id);
|
|
30808
|
-
return this.props.setView("payment-method-delete");
|
|
30809
|
-
}
|
|
30892
|
+
this.props.setPaymentMethodToDelete(source.id);
|
|
30893
|
+
return this.props.setView("payment-method-delete");
|
|
30810
30894
|
});
|
|
30811
30895
|
_defineProperty$3(this, "displayRedeem", () => {
|
|
30812
30896
|
return this.props.setView("gift-redeem");
|
|
@@ -35303,7 +35387,6 @@ exports.PaymentMethodCreateView = PaymentMethodCreateView;
|
|
|
35303
35387
|
exports.PaymentMethodDeleteContainer = PaymentMethodDeleteContainer;
|
|
35304
35388
|
exports.PaymentMethodDeleteList = PaymentMethodDeleteList;
|
|
35305
35389
|
exports.PaymentMethodDeleteModal = PaymentMethodDeleteModal;
|
|
35306
|
-
exports.PaymentMethodDeleteOptions = PaymentMethodDeleteOptions;
|
|
35307
35390
|
exports.PaymentMethodDeleteSubmit = PaymentMethodDeleteSubmit;
|
|
35308
35391
|
exports.PaymentMethodDeleteView = PaymentMethodDeleteView;
|
|
35309
35392
|
exports.PaymentMethodSelectContainer = PaymentMethodSelectContainer;
|