@pelcro/react-pelcro-js 3.26.0-sandbox.24 → 3.26.0-sandbox.26
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 -27
- package/dist/index.esm.js +29 -27
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3452,7 +3452,7 @@ var labels$11 = {
|
|
|
3452
3452
|
code: "Coupon code",
|
|
3453
3453
|
"for": "for",
|
|
3454
3454
|
interval: "{{count}} {{interval}}",
|
|
3455
|
-
interval_plural: "{{count}} {{interval}}
|
|
3455
|
+
interval_plural: "{{count}} {{interval}}",
|
|
3456
3456
|
tax: "Tax",
|
|
3457
3457
|
removeCoupon: "REMOVE",
|
|
3458
3458
|
firstName: "First name",
|
|
@@ -4323,7 +4323,7 @@ var labels$M = {
|
|
|
4323
4323
|
code: "Code promo",
|
|
4324
4324
|
"for": "pour",
|
|
4325
4325
|
interval: "{{count}} {{interval}}",
|
|
4326
|
-
interval_plural: "{{count}} {{interval}}
|
|
4326
|
+
interval_plural: "{{count}} {{interval}}",
|
|
4327
4327
|
tax: "Taxe",
|
|
4328
4328
|
removeCoupon: "RETIRER",
|
|
4329
4329
|
firstName: "Prénom",
|
|
@@ -6169,7 +6169,7 @@ var labels$e = {
|
|
|
6169
6169
|
code: "Código de cupón",
|
|
6170
6170
|
"for": "por",
|
|
6171
6171
|
interval: "{{count}} {{interval}}",
|
|
6172
|
-
interval_plural: "{{count}} {{interval}}
|
|
6172
|
+
interval_plural: "{{count}} {{interval}}",
|
|
6173
6173
|
tax: "Impuesto",
|
|
6174
6174
|
removeCoupon: "ELIMINAR",
|
|
6175
6175
|
firstName: "Nombre",
|
|
@@ -14812,7 +14812,7 @@ class SelectModal extends React.Component {
|
|
|
14812
14812
|
startingPlan = plan;
|
|
14813
14813
|
}
|
|
14814
14814
|
}
|
|
14815
|
-
return `${startingPlan.amount_formatted}/${startingPlan.interval_count > 1 ? `${startingPlan.interval_count} ${startingPlan.
|
|
14815
|
+
return `${startingPlan.amount_formatted}/${startingPlan.interval_count > 1 ? `${startingPlan.interval_count} ${startingPlan.interval_translated}` : `${startingPlan.interval_translated}`}`;
|
|
14816
14816
|
});
|
|
14817
14817
|
_defineProperty$3(this, "renderOneProduct", (product, index, options) => {
|
|
14818
14818
|
const isPlanMode = Boolean(this.state.mode === "plan");
|
|
@@ -20306,7 +20306,7 @@ const OrderCreateFreeButton = _ref => {
|
|
|
20306
20306
|
* @return {JSX}
|
|
20307
20307
|
*/
|
|
20308
20308
|
const ApplePayButton = _ref => {
|
|
20309
|
-
var _ref2, _ref3, _state$updatedPrice, _props$plan;
|
|
20309
|
+
var _window$Pelcro$site$r, _ref2, _ref3, _state$updatedPrice, _props$plan;
|
|
20310
20310
|
let {
|
|
20311
20311
|
onClick,
|
|
20312
20312
|
props,
|
|
@@ -20320,16 +20320,20 @@ const ApplePayButton = _ref => {
|
|
|
20320
20320
|
plan,
|
|
20321
20321
|
invoice
|
|
20322
20322
|
} = usePelcro();
|
|
20323
|
+
const {
|
|
20324
|
+
payPageId,
|
|
20325
|
+
reportGroup,
|
|
20326
|
+
apple_pay_merchant_id: ApplePayMerchantId,
|
|
20327
|
+
apple_pay_enabled: ApplePayEnabled,
|
|
20328
|
+
apple_pay_billing_agreement: ApplePayBillingAgreement
|
|
20329
|
+
} = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_gateway_settings;
|
|
20323
20330
|
const updatedPrice = (_ref2 = (_ref3 = (_state$updatedPrice = state.updatedPrice) !== null && _state$updatedPrice !== void 0 ? _state$updatedPrice : props === null || props === void 0 ? void 0 : (_props$plan = props.plan) === null || _props$plan === void 0 ? void 0 : _props$plan.amount) !== null && _ref3 !== void 0 ? _ref3 : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref2 !== void 0 ? _ref2 : invoice.amount_remaining;
|
|
20324
20331
|
React.useEffect(() => {
|
|
20325
20332
|
if (window.ApplePaySession) {
|
|
20326
|
-
// TODO: Should not be hardcoded
|
|
20327
|
-
const merchantIdentifier = "merchant.pelcro.prelive";
|
|
20328
|
-
|
|
20329
20333
|
// Indicates whether the device supports Apple Pay and whether the user has an active card in Wallet.
|
|
20330
|
-
const promise = ApplePaySession.canMakePaymentsWithActiveCard(
|
|
20334
|
+
const promise = ApplePaySession.canMakePaymentsWithActiveCard(ApplePayMerchantId);
|
|
20331
20335
|
promise.then(function (canMakePayments) {
|
|
20332
|
-
if (canMakePayments) {
|
|
20336
|
+
if (canMakePayments && ApplePayEnabled) {
|
|
20333
20337
|
// Display Apple Pay Buttons here…
|
|
20334
20338
|
const pelcroApplyPayButton = document.getElementById("pelcro-apple-pay-button");
|
|
20335
20339
|
if (pelcroApplyPayButton) {
|
|
@@ -20368,8 +20372,8 @@ const ApplePayButton = _ref => {
|
|
|
20368
20372
|
amount: updatedPrice / 100,
|
|
20369
20373
|
paymentTiming: "recurring",
|
|
20370
20374
|
recurringPaymentStartDate: new Date().toISOString(),
|
|
20371
|
-
recurringPaymentIntervalUnit: plan === null || plan === void 0 ? void 0 : plan.interval,
|
|
20372
|
-
recurringPaymentIntervalCount: plan === null || plan === void 0 ? void 0 : plan.interval_count
|
|
20375
|
+
recurringPaymentIntervalUnit: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? "day" : plan === null || plan === void 0 ? void 0 : plan.interval,
|
|
20376
|
+
recurringPaymentIntervalCount: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? (plan === null || plan === void 0 ? void 0 : plan.interval_count) * 7 : plan === null || plan === void 0 ? void 0 : plan.interval_count
|
|
20373
20377
|
} : {
|
|
20374
20378
|
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
|
|
20375
20379
|
amount: updatedPrice / 100
|
|
@@ -20382,16 +20386,16 @@ const ApplePayButton = _ref => {
|
|
|
20382
20386
|
amount: updatedPrice / 100,
|
|
20383
20387
|
paymentTiming: "recurring",
|
|
20384
20388
|
recurringPaymentStartDate: new Date().toISOString(),
|
|
20385
|
-
recurringPaymentIntervalUnit: plan === null || plan === void 0 ? void 0 : plan.interval,
|
|
20386
|
-
recurringPaymentIntervalCount: plan === null || plan === void 0 ? void 0 : plan.interval_count
|
|
20389
|
+
recurringPaymentIntervalUnit: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? "day" : plan === null || plan === void 0 ? void 0 : plan.interval,
|
|
20390
|
+
recurringPaymentIntervalCount: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? (plan === null || plan === void 0 ? void 0 : plan.interval_count) * 7 : plan === null || plan === void 0 ? void 0 : plan.interval_count
|
|
20387
20391
|
},
|
|
20388
|
-
billingAgreement:
|
|
20392
|
+
billingAgreement: ApplePayBillingAgreement !== null && ApplePayBillingAgreement !== void 0 ? ApplePayBillingAgreement : "",
|
|
20389
20393
|
managementURL: "https://applepaydemo.apple.com",
|
|
20390
20394
|
tokenNotificationURL: "https://applepaydemo.apple.com"
|
|
20391
20395
|
}
|
|
20392
20396
|
})
|
|
20393
20397
|
};
|
|
20394
|
-
|
|
20398
|
+
console.log(ApplePayPaymentRequest);
|
|
20395
20399
|
// Create ApplePaySession
|
|
20396
20400
|
// @todo - Clarify supported version parameter
|
|
20397
20401
|
// @odo - Apple Pay demo uses version 6 (https://applepaydemo.apple.com/)
|
|
@@ -20442,8 +20446,8 @@ const ApplePayButton = _ref => {
|
|
|
20442
20446
|
amount: updatedPrice / 100,
|
|
20443
20447
|
paymentTiming: "recurring",
|
|
20444
20448
|
recurringPaymentStartDate: new Date().toISOString(),
|
|
20445
|
-
recurringPaymentIntervalUnit: plan === null || plan === void 0 ? void 0 : plan.interval,
|
|
20446
|
-
recurringPaymentIntervalCount: plan === null || plan === void 0 ? void 0 : plan.interval_count
|
|
20449
|
+
recurringPaymentIntervalUnit: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? "day" : plan === null || plan === void 0 ? void 0 : plan.interval,
|
|
20450
|
+
recurringPaymentIntervalCount: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? (plan === null || plan === void 0 ? void 0 : plan.interval_count) * 7 : plan === null || plan === void 0 ? void 0 : plan.interval_count
|
|
20447
20451
|
} : {
|
|
20448
20452
|
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
|
|
20449
20453
|
amount: updatedPrice / 100
|
|
@@ -20489,7 +20493,6 @@ const ApplePayButton = _ref => {
|
|
|
20489
20493
|
// };
|
|
20490
20494
|
|
|
20491
20495
|
session.onpaymentauthorized = event => {
|
|
20492
|
-
var _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
20493
20496
|
console.log("on payment authorized step", event);
|
|
20494
20497
|
// Define ApplePayPaymentAuthorizationResult
|
|
20495
20498
|
const result = {
|
|
@@ -20519,8 +20522,6 @@ const ApplePayButton = _ref => {
|
|
|
20519
20522
|
}
|
|
20520
20523
|
};
|
|
20521
20524
|
console.log(applePayToken);
|
|
20522
|
-
const payPageId = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_gateway_settings.pay_page_id;
|
|
20523
|
-
const reportGroup = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.vantiv_gateway_settings.report_group;
|
|
20524
20525
|
const orderId = `pelcro-${new Date().getTime()}`;
|
|
20525
20526
|
const eProtectRequest = {
|
|
20526
20527
|
paypageId: payPageId,
|
|
@@ -20723,11 +20724,11 @@ const SubscriptionRenewView = _ref => {
|
|
|
20723
20724
|
const getPricingText = plan => {
|
|
20724
20725
|
const autoRenewed = plan.auto_renew;
|
|
20725
20726
|
const {
|
|
20726
|
-
|
|
20727
|
+
interval_translated,
|
|
20727
20728
|
interval_count
|
|
20728
20729
|
} = plan;
|
|
20729
20730
|
const intervalText = t("labels.interval", {
|
|
20730
|
-
interval,
|
|
20731
|
+
interval: interval_translated,
|
|
20731
20732
|
count: interval_count
|
|
20732
20733
|
});
|
|
20733
20734
|
return /*#__PURE__*/React__default['default'].createElement("p", {
|
|
@@ -21057,6 +21058,7 @@ const SubscriptionCancelButton = _ref => {
|
|
|
21057
21058
|
}, t("labels.cancel"));
|
|
21058
21059
|
};
|
|
21059
21060
|
|
|
21061
|
+
// New cancellation option modal
|
|
21060
21062
|
const SubscriptionCancelOptions = _ref => {
|
|
21061
21063
|
var _subscription$schedul;
|
|
21062
21064
|
let {
|
|
@@ -21086,7 +21088,7 @@ const SubscriptionCancelOptions = _ref => {
|
|
|
21086
21088
|
className: "plc-text-left plc-mr-auto plc-mb-6"
|
|
21087
21089
|
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
21088
21090
|
className: "plc-mb-3"
|
|
21089
|
-
}, t("messages.cancelWhen")), hasPhases && /*#__PURE__*/React__default['default'].createElement(Radio, {
|
|
21091
|
+
}, t("messages.cancelWhen")), subscription.cancel_at_period_end === 0 && hasPhases && /*#__PURE__*/React__default['default'].createElement(Radio, {
|
|
21090
21092
|
onChange: handleOptionSelect,
|
|
21091
21093
|
checked: cancelationOption === "period_end",
|
|
21092
21094
|
value: "period_end"
|
|
@@ -21094,7 +21096,7 @@ const SubscriptionCancelOptions = _ref => {
|
|
|
21094
21096
|
year: "numeric",
|
|
21095
21097
|
month: "short",
|
|
21096
21098
|
day: "numeric"
|
|
21097
|
-
})), /*#__PURE__*/React__default['default'].createElement(Radio, {
|
|
21099
|
+
})), subscription.cancel_at_period_end === 0 && /*#__PURE__*/React__default['default'].createElement(Radio, {
|
|
21098
21100
|
onChange: handleOptionSelect,
|
|
21099
21101
|
checked: cancelationOption === "current_period_end",
|
|
21100
21102
|
value: "current_period_end"
|
|
@@ -22093,11 +22095,11 @@ const SubscriptionCreateView = _ref => {
|
|
|
22093
22095
|
var _plan$quantity;
|
|
22094
22096
|
const autoRenewed = plan.auto_renew;
|
|
22095
22097
|
const {
|
|
22096
|
-
|
|
22098
|
+
interval_translated,
|
|
22097
22099
|
interval_count
|
|
22098
22100
|
} = plan;
|
|
22099
22101
|
const intervalText = t("labels.interval", {
|
|
22100
|
-
interval,
|
|
22102
|
+
interval: interval_translated,
|
|
22101
22103
|
count: interval_count
|
|
22102
22104
|
});
|
|
22103
22105
|
const priceFormatted = getFormattedPriceByLocal((plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1), plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
|
package/dist/index.esm.js
CHANGED
|
@@ -3422,7 +3422,7 @@ var labels$11 = {
|
|
|
3422
3422
|
code: "Coupon code",
|
|
3423
3423
|
"for": "for",
|
|
3424
3424
|
interval: "{{count}} {{interval}}",
|
|
3425
|
-
interval_plural: "{{count}} {{interval}}
|
|
3425
|
+
interval_plural: "{{count}} {{interval}}",
|
|
3426
3426
|
tax: "Tax",
|
|
3427
3427
|
removeCoupon: "REMOVE",
|
|
3428
3428
|
firstName: "First name",
|
|
@@ -4293,7 +4293,7 @@ var labels$M = {
|
|
|
4293
4293
|
code: "Code promo",
|
|
4294
4294
|
"for": "pour",
|
|
4295
4295
|
interval: "{{count}} {{interval}}",
|
|
4296
|
-
interval_plural: "{{count}} {{interval}}
|
|
4296
|
+
interval_plural: "{{count}} {{interval}}",
|
|
4297
4297
|
tax: "Taxe",
|
|
4298
4298
|
removeCoupon: "RETIRER",
|
|
4299
4299
|
firstName: "Prénom",
|
|
@@ -6139,7 +6139,7 @@ var labels$e = {
|
|
|
6139
6139
|
code: "Código de cupón",
|
|
6140
6140
|
"for": "por",
|
|
6141
6141
|
interval: "{{count}} {{interval}}",
|
|
6142
|
-
interval_plural: "{{count}} {{interval}}
|
|
6142
|
+
interval_plural: "{{count}} {{interval}}",
|
|
6143
6143
|
tax: "Impuesto",
|
|
6144
6144
|
removeCoupon: "ELIMINAR",
|
|
6145
6145
|
firstName: "Nombre",
|
|
@@ -14782,7 +14782,7 @@ class SelectModal extends Component {
|
|
|
14782
14782
|
startingPlan = plan;
|
|
14783
14783
|
}
|
|
14784
14784
|
}
|
|
14785
|
-
return `${startingPlan.amount_formatted}/${startingPlan.interval_count > 1 ? `${startingPlan.interval_count} ${startingPlan.
|
|
14785
|
+
return `${startingPlan.amount_formatted}/${startingPlan.interval_count > 1 ? `${startingPlan.interval_count} ${startingPlan.interval_translated}` : `${startingPlan.interval_translated}`}`;
|
|
14786
14786
|
});
|
|
14787
14787
|
_defineProperty$3(this, "renderOneProduct", (product, index, options) => {
|
|
14788
14788
|
const isPlanMode = Boolean(this.state.mode === "plan");
|
|
@@ -20276,7 +20276,7 @@ const OrderCreateFreeButton = _ref => {
|
|
|
20276
20276
|
* @return {JSX}
|
|
20277
20277
|
*/
|
|
20278
20278
|
const ApplePayButton = _ref => {
|
|
20279
|
-
var _ref2, _ref3, _state$updatedPrice, _props$plan;
|
|
20279
|
+
var _window$Pelcro$site$r, _ref2, _ref3, _state$updatedPrice, _props$plan;
|
|
20280
20280
|
let {
|
|
20281
20281
|
onClick,
|
|
20282
20282
|
props,
|
|
@@ -20290,16 +20290,20 @@ const ApplePayButton = _ref => {
|
|
|
20290
20290
|
plan,
|
|
20291
20291
|
invoice
|
|
20292
20292
|
} = usePelcro();
|
|
20293
|
+
const {
|
|
20294
|
+
payPageId,
|
|
20295
|
+
reportGroup,
|
|
20296
|
+
apple_pay_merchant_id: ApplePayMerchantId,
|
|
20297
|
+
apple_pay_enabled: ApplePayEnabled,
|
|
20298
|
+
apple_pay_billing_agreement: ApplePayBillingAgreement
|
|
20299
|
+
} = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_gateway_settings;
|
|
20293
20300
|
const updatedPrice = (_ref2 = (_ref3 = (_state$updatedPrice = state.updatedPrice) !== null && _state$updatedPrice !== void 0 ? _state$updatedPrice : props === null || props === void 0 ? void 0 : (_props$plan = props.plan) === null || _props$plan === void 0 ? void 0 : _props$plan.amount) !== null && _ref3 !== void 0 ? _ref3 : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref2 !== void 0 ? _ref2 : invoice.amount_remaining;
|
|
20294
20301
|
useEffect(() => {
|
|
20295
20302
|
if (window.ApplePaySession) {
|
|
20296
|
-
// TODO: Should not be hardcoded
|
|
20297
|
-
const merchantIdentifier = "merchant.pelcro.prelive";
|
|
20298
|
-
|
|
20299
20303
|
// Indicates whether the device supports Apple Pay and whether the user has an active card in Wallet.
|
|
20300
|
-
const promise = ApplePaySession.canMakePaymentsWithActiveCard(
|
|
20304
|
+
const promise = ApplePaySession.canMakePaymentsWithActiveCard(ApplePayMerchantId);
|
|
20301
20305
|
promise.then(function (canMakePayments) {
|
|
20302
|
-
if (canMakePayments) {
|
|
20306
|
+
if (canMakePayments && ApplePayEnabled) {
|
|
20303
20307
|
// Display Apple Pay Buttons here…
|
|
20304
20308
|
const pelcroApplyPayButton = document.getElementById("pelcro-apple-pay-button");
|
|
20305
20309
|
if (pelcroApplyPayButton) {
|
|
@@ -20338,8 +20342,8 @@ const ApplePayButton = _ref => {
|
|
|
20338
20342
|
amount: updatedPrice / 100,
|
|
20339
20343
|
paymentTiming: "recurring",
|
|
20340
20344
|
recurringPaymentStartDate: new Date().toISOString(),
|
|
20341
|
-
recurringPaymentIntervalUnit: plan === null || plan === void 0 ? void 0 : plan.interval,
|
|
20342
|
-
recurringPaymentIntervalCount: plan === null || plan === void 0 ? void 0 : plan.interval_count
|
|
20345
|
+
recurringPaymentIntervalUnit: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? "day" : plan === null || plan === void 0 ? void 0 : plan.interval,
|
|
20346
|
+
recurringPaymentIntervalCount: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? (plan === null || plan === void 0 ? void 0 : plan.interval_count) * 7 : plan === null || plan === void 0 ? void 0 : plan.interval_count
|
|
20343
20347
|
} : {
|
|
20344
20348
|
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
|
|
20345
20349
|
amount: updatedPrice / 100
|
|
@@ -20352,16 +20356,16 @@ const ApplePayButton = _ref => {
|
|
|
20352
20356
|
amount: updatedPrice / 100,
|
|
20353
20357
|
paymentTiming: "recurring",
|
|
20354
20358
|
recurringPaymentStartDate: new Date().toISOString(),
|
|
20355
|
-
recurringPaymentIntervalUnit: plan === null || plan === void 0 ? void 0 : plan.interval,
|
|
20356
|
-
recurringPaymentIntervalCount: plan === null || plan === void 0 ? void 0 : plan.interval_count
|
|
20359
|
+
recurringPaymentIntervalUnit: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? "day" : plan === null || plan === void 0 ? void 0 : plan.interval,
|
|
20360
|
+
recurringPaymentIntervalCount: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? (plan === null || plan === void 0 ? void 0 : plan.interval_count) * 7 : plan === null || plan === void 0 ? void 0 : plan.interval_count
|
|
20357
20361
|
},
|
|
20358
|
-
billingAgreement:
|
|
20362
|
+
billingAgreement: ApplePayBillingAgreement !== null && ApplePayBillingAgreement !== void 0 ? ApplePayBillingAgreement : "",
|
|
20359
20363
|
managementURL: "https://applepaydemo.apple.com",
|
|
20360
20364
|
tokenNotificationURL: "https://applepaydemo.apple.com"
|
|
20361
20365
|
}
|
|
20362
20366
|
})
|
|
20363
20367
|
};
|
|
20364
|
-
|
|
20368
|
+
console.log(ApplePayPaymentRequest);
|
|
20365
20369
|
// Create ApplePaySession
|
|
20366
20370
|
// @todo - Clarify supported version parameter
|
|
20367
20371
|
// @odo - Apple Pay demo uses version 6 (https://applepaydemo.apple.com/)
|
|
@@ -20412,8 +20416,8 @@ const ApplePayButton = _ref => {
|
|
|
20412
20416
|
amount: updatedPrice / 100,
|
|
20413
20417
|
paymentTiming: "recurring",
|
|
20414
20418
|
recurringPaymentStartDate: new Date().toISOString(),
|
|
20415
|
-
recurringPaymentIntervalUnit: plan === null || plan === void 0 ? void 0 : plan.interval,
|
|
20416
|
-
recurringPaymentIntervalCount: plan === null || plan === void 0 ? void 0 : plan.interval_count
|
|
20419
|
+
recurringPaymentIntervalUnit: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? "day" : plan === null || plan === void 0 ? void 0 : plan.interval,
|
|
20420
|
+
recurringPaymentIntervalCount: (plan === null || plan === void 0 ? void 0 : plan.interval) === "week" ? (plan === null || plan === void 0 ? void 0 : plan.interval_count) * 7 : plan === null || plan === void 0 ? void 0 : plan.interval_count
|
|
20417
20421
|
} : {
|
|
20418
20422
|
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || `invoice #${invoice.id}`,
|
|
20419
20423
|
amount: updatedPrice / 100
|
|
@@ -20459,7 +20463,6 @@ const ApplePayButton = _ref => {
|
|
|
20459
20463
|
// };
|
|
20460
20464
|
|
|
20461
20465
|
session.onpaymentauthorized = event => {
|
|
20462
|
-
var _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
20463
20466
|
console.log("on payment authorized step", event);
|
|
20464
20467
|
// Define ApplePayPaymentAuthorizationResult
|
|
20465
20468
|
const result = {
|
|
@@ -20489,8 +20492,6 @@ const ApplePayButton = _ref => {
|
|
|
20489
20492
|
}
|
|
20490
20493
|
};
|
|
20491
20494
|
console.log(applePayToken);
|
|
20492
|
-
const payPageId = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_gateway_settings.pay_page_id;
|
|
20493
|
-
const reportGroup = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.vantiv_gateway_settings.report_group;
|
|
20494
20495
|
const orderId = `pelcro-${new Date().getTime()}`;
|
|
20495
20496
|
const eProtectRequest = {
|
|
20496
20497
|
paypageId: payPageId,
|
|
@@ -20693,11 +20694,11 @@ const SubscriptionRenewView = _ref => {
|
|
|
20693
20694
|
const getPricingText = plan => {
|
|
20694
20695
|
const autoRenewed = plan.auto_renew;
|
|
20695
20696
|
const {
|
|
20696
|
-
|
|
20697
|
+
interval_translated,
|
|
20697
20698
|
interval_count
|
|
20698
20699
|
} = plan;
|
|
20699
20700
|
const intervalText = t("labels.interval", {
|
|
20700
|
-
interval,
|
|
20701
|
+
interval: interval_translated,
|
|
20701
20702
|
count: interval_count
|
|
20702
20703
|
});
|
|
20703
20704
|
return /*#__PURE__*/React__default.createElement("p", {
|
|
@@ -21027,6 +21028,7 @@ const SubscriptionCancelButton = _ref => {
|
|
|
21027
21028
|
}, t("labels.cancel"));
|
|
21028
21029
|
};
|
|
21029
21030
|
|
|
21031
|
+
// New cancellation option modal
|
|
21030
21032
|
const SubscriptionCancelOptions = _ref => {
|
|
21031
21033
|
var _subscription$schedul;
|
|
21032
21034
|
let {
|
|
@@ -21056,7 +21058,7 @@ const SubscriptionCancelOptions = _ref => {
|
|
|
21056
21058
|
className: "plc-text-left plc-mr-auto plc-mb-6"
|
|
21057
21059
|
}, /*#__PURE__*/React__default.createElement("p", {
|
|
21058
21060
|
className: "plc-mb-3"
|
|
21059
|
-
}, t("messages.cancelWhen")), hasPhases && /*#__PURE__*/React__default.createElement(Radio, {
|
|
21061
|
+
}, t("messages.cancelWhen")), subscription.cancel_at_period_end === 0 && hasPhases && /*#__PURE__*/React__default.createElement(Radio, {
|
|
21060
21062
|
onChange: handleOptionSelect,
|
|
21061
21063
|
checked: cancelationOption === "period_end",
|
|
21062
21064
|
value: "period_end"
|
|
@@ -21064,7 +21066,7 @@ const SubscriptionCancelOptions = _ref => {
|
|
|
21064
21066
|
year: "numeric",
|
|
21065
21067
|
month: "short",
|
|
21066
21068
|
day: "numeric"
|
|
21067
|
-
})), /*#__PURE__*/React__default.createElement(Radio, {
|
|
21069
|
+
})), subscription.cancel_at_period_end === 0 && /*#__PURE__*/React__default.createElement(Radio, {
|
|
21068
21070
|
onChange: handleOptionSelect,
|
|
21069
21071
|
checked: cancelationOption === "current_period_end",
|
|
21070
21072
|
value: "current_period_end"
|
|
@@ -22063,11 +22065,11 @@ const SubscriptionCreateView = _ref => {
|
|
|
22063
22065
|
var _plan$quantity;
|
|
22064
22066
|
const autoRenewed = plan.auto_renew;
|
|
22065
22067
|
const {
|
|
22066
|
-
|
|
22068
|
+
interval_translated,
|
|
22067
22069
|
interval_count
|
|
22068
22070
|
} = plan;
|
|
22069
22071
|
const intervalText = t("labels.interval", {
|
|
22070
|
-
interval,
|
|
22072
|
+
interval: interval_translated,
|
|
22071
22073
|
count: interval_count
|
|
22072
22074
|
});
|
|
22073
22075
|
const priceFormatted = getFormattedPriceByLocal((plan === null || plan === void 0 ? void 0 : plan.amount) * ((_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1), plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
|