@pelcro/react-pelcro-js 3.26.0-beta.63 → 3.26.0-beta.65
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 +13 -9
- package/dist/index.esm.js +13 -9
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -19490,7 +19490,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
19490
19490
|
});
|
|
19491
19491
|
}
|
|
19492
19492
|
if (type == "updatePaymentSource" || type == "deletePaymentSource") {
|
|
19493
|
-
handleBraintreePayment(payload, state);
|
|
19493
|
+
handleBraintreePayment(payload, state.couponCode);
|
|
19494
19494
|
} else {
|
|
19495
19495
|
braintree3DSecureInstanceRef.current.then(threeDSecureInstance => {
|
|
19496
19496
|
threeDSecureInstance.verifyCard({
|
|
@@ -19502,7 +19502,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
19502
19502
|
bin: payload.details.bin
|
|
19503
19503
|
}).then(payload => {
|
|
19504
19504
|
if (payload.liabilityShifted) {
|
|
19505
|
-
handleBraintreePayment(payload, state);
|
|
19505
|
+
handleBraintreePayment(payload, state.couponCode);
|
|
19506
19506
|
} else if (payload.liabilityShiftPossible) {
|
|
19507
19507
|
dispatch({
|
|
19508
19508
|
type: DISABLE_SUBMIT,
|
|
@@ -19565,7 +19565,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
19565
19565
|
}
|
|
19566
19566
|
});
|
|
19567
19567
|
};
|
|
19568
|
-
const handleBraintreePayment = (braintreePaymentRequest,
|
|
19568
|
+
const handleBraintreePayment = (braintreePaymentRequest, couponCode) => {
|
|
19569
19569
|
const isUsingExistingPaymentMethod = Boolean(selectedPaymentMethodId);
|
|
19570
19570
|
const braintreeNonce = braintreePaymentRequest === null || braintreePaymentRequest === void 0 ? void 0 : braintreePaymentRequest.nonce;
|
|
19571
19571
|
if (type === "createPayment") {
|
|
@@ -20675,7 +20675,8 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
20675
20675
|
gift_recipient_last_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.lastName,
|
|
20676
20676
|
gift_start_date: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.startDate,
|
|
20677
20677
|
gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
|
|
20678
|
-
address_id: product.address_required ? selectedAddressId : null
|
|
20678
|
+
address_id: product.address_required ? selectedAddressId : null,
|
|
20679
|
+
metadata: props === null || props === void 0 ? void 0 : props.subCreateMetadata
|
|
20679
20680
|
}, (err, res) => {
|
|
20680
20681
|
var _res$data;
|
|
20681
20682
|
if (res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && _res$data.setup_intent) {
|
|
@@ -23119,7 +23120,8 @@ function PaymentMethodView(_ref) {
|
|
|
23119
23120
|
showSubscriptionButton,
|
|
23120
23121
|
showOrderButton,
|
|
23121
23122
|
showApplePayButton,
|
|
23122
|
-
order
|
|
23123
|
+
order,
|
|
23124
|
+
subCreateMetadata
|
|
23123
23125
|
} = _ref;
|
|
23124
23126
|
const {
|
|
23125
23127
|
t
|
|
@@ -23162,7 +23164,8 @@ function PaymentMethodView(_ref) {
|
|
|
23162
23164
|
onSuccess: onSuccess,
|
|
23163
23165
|
onGiftRenewalSuccess: onGiftRenewalSuccess,
|
|
23164
23166
|
onFailure: onFailure,
|
|
23165
|
-
freeOrders: showOrderButton
|
|
23167
|
+
freeOrders: showOrderButton,
|
|
23168
|
+
subCreateMetadata: subCreateMetadata
|
|
23166
23169
|
}, /*#__PURE__*/React__default['default'].createElement(AlertWithContext, {
|
|
23167
23170
|
className: "plc-mb-2"
|
|
23168
23171
|
}), 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(SelectedPaymentMethod, null), supportsTap && (!isUserFirstName || !isUserLastName || !isUserPhone) && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -24742,7 +24745,8 @@ const SubscriptionCreateView = _ref => {
|
|
|
24742
24745
|
var _window$Pelcro, _window$Pelcro$uiSett, _product$paywall$subs, _product$paywall, _window$Pelcro$paywal, _product$paywall$subs2, _product$paywall2, _window$Pelcro$paywal2;
|
|
24743
24746
|
let {
|
|
24744
24747
|
onSuccess = () => {},
|
|
24745
|
-
onFailure = () => {}
|
|
24748
|
+
onFailure = () => {},
|
|
24749
|
+
...otherProps
|
|
24746
24750
|
} = _ref;
|
|
24747
24751
|
const {
|
|
24748
24752
|
t
|
|
@@ -24785,7 +24789,7 @@ const SubscriptionCreateView = _ref => {
|
|
|
24785
24789
|
className: "plc-text-2xl plc-font-semibold "
|
|
24786
24790
|
}, (_product$paywall$subs = product === null || product === void 0 ? void 0 : (_product$paywall = product.paywall) === null || _product$paywall === void 0 ? void 0 : _product$paywall.subscribe_title) !== null && _product$paywall$subs !== void 0 ? _product$paywall$subs : (_window$Pelcro$paywal = window.Pelcro.paywall.read()) === null || _window$Pelcro$paywal === void 0 ? void 0 : _window$Pelcro$paywal.subscribe_title), " ", /*#__PURE__*/React__default['default'].createElement("p", null, (_product$paywall$subs2 = product === null || product === void 0 ? void 0 : (_product$paywall2 = product.paywall) === null || _product$paywall2 === void 0 ? void 0 : _product$paywall2.subscribe_subtitle) !== null && _product$paywall$subs2 !== void 0 ? _product$paywall$subs2 : (_window$Pelcro$paywal2 = window.Pelcro.paywall.read()) === null || _window$Pelcro$paywal2 === void 0 ? void 0 : _window$Pelcro$paywal2.subscribe_subtitle), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
24787
24791
|
className: "plc-w-full plc-p-2 plc-mt-2 plc-font-semibold plc-text-center plc-text-gray-900 plc-bg-gray-100 plc-border plc-border-gray-200"
|
|
24788
|
-
}, plan && getPricingText(plan))), /*#__PURE__*/React__default['default'].createElement(PaymentMethodView, {
|
|
24792
|
+
}, plan && getPricingText(plan))), /*#__PURE__*/React__default['default'].createElement(PaymentMethodView, Object.assign({
|
|
24789
24793
|
type: "createPayment",
|
|
24790
24794
|
showCoupon: true,
|
|
24791
24795
|
showExternalPaymentMethods: true,
|
|
@@ -24793,7 +24797,7 @@ const SubscriptionCreateView = _ref => {
|
|
|
24793
24797
|
onSuccess: onSuccess,
|
|
24794
24798
|
onFailure: onFailure,
|
|
24795
24799
|
showSubscriptionButton: showSubscriptionButton
|
|
24796
|
-
}));
|
|
24800
|
+
}, otherProps)));
|
|
24797
24801
|
};
|
|
24798
24802
|
|
|
24799
24803
|
/**
|
package/dist/index.esm.js
CHANGED
|
@@ -19460,7 +19460,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
19460
19460
|
});
|
|
19461
19461
|
}
|
|
19462
19462
|
if (type == "updatePaymentSource" || type == "deletePaymentSource") {
|
|
19463
|
-
handleBraintreePayment(payload, state);
|
|
19463
|
+
handleBraintreePayment(payload, state.couponCode);
|
|
19464
19464
|
} else {
|
|
19465
19465
|
braintree3DSecureInstanceRef.current.then(threeDSecureInstance => {
|
|
19466
19466
|
threeDSecureInstance.verifyCard({
|
|
@@ -19472,7 +19472,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
19472
19472
|
bin: payload.details.bin
|
|
19473
19473
|
}).then(payload => {
|
|
19474
19474
|
if (payload.liabilityShifted) {
|
|
19475
|
-
handleBraintreePayment(payload, state);
|
|
19475
|
+
handleBraintreePayment(payload, state.couponCode);
|
|
19476
19476
|
} else if (payload.liabilityShiftPossible) {
|
|
19477
19477
|
dispatch({
|
|
19478
19478
|
type: DISABLE_SUBMIT,
|
|
@@ -19535,7 +19535,7 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
19535
19535
|
}
|
|
19536
19536
|
});
|
|
19537
19537
|
};
|
|
19538
|
-
const handleBraintreePayment = (braintreePaymentRequest,
|
|
19538
|
+
const handleBraintreePayment = (braintreePaymentRequest, couponCode) => {
|
|
19539
19539
|
const isUsingExistingPaymentMethod = Boolean(selectedPaymentMethodId);
|
|
19540
19540
|
const braintreeNonce = braintreePaymentRequest === null || braintreePaymentRequest === void 0 ? void 0 : braintreePaymentRequest.nonce;
|
|
19541
19541
|
if (type === "createPayment") {
|
|
@@ -20645,7 +20645,8 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
20645
20645
|
gift_recipient_last_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.lastName,
|
|
20646
20646
|
gift_start_date: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.startDate,
|
|
20647
20647
|
gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
|
|
20648
|
-
address_id: product.address_required ? selectedAddressId : null
|
|
20648
|
+
address_id: product.address_required ? selectedAddressId : null,
|
|
20649
|
+
metadata: props === null || props === void 0 ? void 0 : props.subCreateMetadata
|
|
20649
20650
|
}, (err, res) => {
|
|
20650
20651
|
var _res$data;
|
|
20651
20652
|
if (res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && _res$data.setup_intent) {
|
|
@@ -23089,7 +23090,8 @@ function PaymentMethodView(_ref) {
|
|
|
23089
23090
|
showSubscriptionButton,
|
|
23090
23091
|
showOrderButton,
|
|
23091
23092
|
showApplePayButton,
|
|
23092
|
-
order
|
|
23093
|
+
order,
|
|
23094
|
+
subCreateMetadata
|
|
23093
23095
|
} = _ref;
|
|
23094
23096
|
const {
|
|
23095
23097
|
t
|
|
@@ -23132,7 +23134,8 @@ function PaymentMethodView(_ref) {
|
|
|
23132
23134
|
onSuccess: onSuccess,
|
|
23133
23135
|
onGiftRenewalSuccess: onGiftRenewalSuccess,
|
|
23134
23136
|
onFailure: onFailure,
|
|
23135
|
-
freeOrders: showOrderButton
|
|
23137
|
+
freeOrders: showOrderButton,
|
|
23138
|
+
subCreateMetadata: subCreateMetadata
|
|
23136
23139
|
}, /*#__PURE__*/React__default.createElement(AlertWithContext, {
|
|
23137
23140
|
className: "plc-mb-2"
|
|
23138
23141
|
}), 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(SelectedPaymentMethod, null), supportsTap && (!isUserFirstName || !isUserLastName || !isUserPhone) && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -24712,7 +24715,8 @@ const SubscriptionCreateView = _ref => {
|
|
|
24712
24715
|
var _window$Pelcro, _window$Pelcro$uiSett, _product$paywall$subs, _product$paywall, _window$Pelcro$paywal, _product$paywall$subs2, _product$paywall2, _window$Pelcro$paywal2;
|
|
24713
24716
|
let {
|
|
24714
24717
|
onSuccess = () => {},
|
|
24715
|
-
onFailure = () => {}
|
|
24718
|
+
onFailure = () => {},
|
|
24719
|
+
...otherProps
|
|
24716
24720
|
} = _ref;
|
|
24717
24721
|
const {
|
|
24718
24722
|
t
|
|
@@ -24755,7 +24759,7 @@ const SubscriptionCreateView = _ref => {
|
|
|
24755
24759
|
className: "plc-text-2xl plc-font-semibold "
|
|
24756
24760
|
}, (_product$paywall$subs = product === null || product === void 0 ? void 0 : (_product$paywall = product.paywall) === null || _product$paywall === void 0 ? void 0 : _product$paywall.subscribe_title) !== null && _product$paywall$subs !== void 0 ? _product$paywall$subs : (_window$Pelcro$paywal = window.Pelcro.paywall.read()) === null || _window$Pelcro$paywal === void 0 ? void 0 : _window$Pelcro$paywal.subscribe_title), " ", /*#__PURE__*/React__default.createElement("p", null, (_product$paywall$subs2 = product === null || product === void 0 ? void 0 : (_product$paywall2 = product.paywall) === null || _product$paywall2 === void 0 ? void 0 : _product$paywall2.subscribe_subtitle) !== null && _product$paywall$subs2 !== void 0 ? _product$paywall$subs2 : (_window$Pelcro$paywal2 = window.Pelcro.paywall.read()) === null || _window$Pelcro$paywal2 === void 0 ? void 0 : _window$Pelcro$paywal2.subscribe_subtitle), /*#__PURE__*/React__default.createElement("div", {
|
|
24757
24761
|
className: "plc-w-full plc-p-2 plc-mt-2 plc-font-semibold plc-text-center plc-text-gray-900 plc-bg-gray-100 plc-border plc-border-gray-200"
|
|
24758
|
-
}, plan && getPricingText(plan))), /*#__PURE__*/React__default.createElement(PaymentMethodView, {
|
|
24762
|
+
}, plan && getPricingText(plan))), /*#__PURE__*/React__default.createElement(PaymentMethodView, Object.assign({
|
|
24759
24763
|
type: "createPayment",
|
|
24760
24764
|
showCoupon: true,
|
|
24761
24765
|
showExternalPaymentMethods: true,
|
|
@@ -24763,7 +24767,7 @@ const SubscriptionCreateView = _ref => {
|
|
|
24763
24767
|
onSuccess: onSuccess,
|
|
24764
24768
|
onFailure: onFailure,
|
|
24765
24769
|
showSubscriptionButton: showSubscriptionButton
|
|
24766
|
-
}));
|
|
24770
|
+
}, otherProps)));
|
|
24767
24771
|
};
|
|
24768
24772
|
|
|
24769
24773
|
/**
|