@pelcro/react-pelcro-js 3.26.0-beta.13 → 3.26.0-beta.14
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 +6 -6
- package/dist/index.esm.js +6 -6
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -21230,7 +21230,7 @@ const ApplePayButton = _ref => {
|
|
|
21230
21230
|
const orderPrice = getOrderItemsTotal();
|
|
21231
21231
|
const orderCurrency = !Array.isArray(order) ? order === null || order === void 0 ? void 0 : order.currency : (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency;
|
|
21232
21232
|
const orderLabel = !Array.isArray(order) ? order === null || order === void 0 ? void 0 : order.name : "Order";
|
|
21233
|
-
const updatedPrice = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_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 && _ref5 !== void 0 ? _ref5 : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref4 !== void 0 ? _ref4 : orderPrice) !== null && _ref3 !== void 0 ? _ref3 : invoice.amount_remaining) !== null && _ref2 !== void 0 ? _ref2 : null;
|
|
21233
|
+
const updatedPrice = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_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 && _ref5 !== void 0 ? _ref5 : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref4 !== void 0 ? _ref4 : orderPrice) !== null && _ref3 !== void 0 ? _ref3 : invoice === null || invoice === void 0 ? void 0 : invoice.amount_remaining) !== null && _ref2 !== void 0 ? _ref2 : null;
|
|
21234
21234
|
React.useEffect(() => {
|
|
21235
21235
|
if (window.ApplePaySession) {
|
|
21236
21236
|
// Indicates whether the device supports Apple Pay and whether the user has an active card in Wallet.
|
|
@@ -21267,7 +21267,7 @@ const ApplePayButton = _ref => {
|
|
|
21267
21267
|
merchantCapabilities: ["supports3DS"],
|
|
21268
21268
|
supportedNetworks: ["visa", "masterCard", "amex", "discover"],
|
|
21269
21269
|
total: {
|
|
21270
|
-
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || orderLabel || `invoice #${invoice.id}`,
|
|
21270
|
+
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || orderLabel || `invoice #${invoice === null || invoice === void 0 ? void 0 : invoice.id}`,
|
|
21271
21271
|
type: "final",
|
|
21272
21272
|
amount: updatedPrice / 100
|
|
21273
21273
|
}
|
|
@@ -21315,12 +21315,12 @@ const ApplePayButton = _ref => {
|
|
|
21315
21315
|
// Define ApplePayPaymentMethodUpdate based on the selected payment method.
|
|
21316
21316
|
// No updates or errors are needed, pass an empty object.
|
|
21317
21317
|
const newTotal = {
|
|
21318
|
-
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || orderLabel || `invoice #${invoice.id}`,
|
|
21318
|
+
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || orderLabel || `invoice #${invoice === null || invoice === void 0 ? void 0 : invoice.id}`,
|
|
21319
21319
|
type: "final",
|
|
21320
21320
|
amount: updatedPrice / 100
|
|
21321
21321
|
};
|
|
21322
21322
|
const newLineItems = [{
|
|
21323
|
-
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || orderLabel || `invoice #${invoice.id}`,
|
|
21323
|
+
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || orderLabel || `invoice #${invoice === null || invoice === void 0 ? void 0 : invoice.id}`,
|
|
21324
21324
|
type: "final",
|
|
21325
21325
|
amount: updatedPrice / 100
|
|
21326
21326
|
}];
|
|
@@ -21333,14 +21333,14 @@ const ApplePayButton = _ref => {
|
|
|
21333
21333
|
// // Define ApplePayShippingMethodUpdate based on the selected shipping method.
|
|
21334
21334
|
// // No updates or errors are needed, pass an empty object.
|
|
21335
21335
|
// const newTotal = {
|
|
21336
|
-
// label: plan?.nickname || orderLabel || `invoice #${invoice
|
|
21336
|
+
// label: plan?.nickname || orderLabel || `invoice #${invoice?.id}`,
|
|
21337
21337
|
// type: "final",
|
|
21338
21338
|
// amount: updatedPrice / 100
|
|
21339
21339
|
// };
|
|
21340
21340
|
|
|
21341
21341
|
// const newLineItems = [
|
|
21342
21342
|
// {
|
|
21343
|
-
// label: plan?.nickname || orderLabel || `invoice #${invoice
|
|
21343
|
+
// label: plan?.nickname || orderLabel || `invoice #${invoice?.id}`,
|
|
21344
21344
|
// type: "final",
|
|
21345
21345
|
// amount: updatedPrice / 100
|
|
21346
21346
|
// }
|
package/dist/index.esm.js
CHANGED
|
@@ -21200,7 +21200,7 @@ const ApplePayButton = _ref => {
|
|
|
21200
21200
|
const orderPrice = getOrderItemsTotal();
|
|
21201
21201
|
const orderCurrency = !Array.isArray(order) ? order === null || order === void 0 ? void 0 : order.currency : (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency;
|
|
21202
21202
|
const orderLabel = !Array.isArray(order) ? order === null || order === void 0 ? void 0 : order.name : "Order";
|
|
21203
|
-
const updatedPrice = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_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 && _ref5 !== void 0 ? _ref5 : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref4 !== void 0 ? _ref4 : orderPrice) !== null && _ref3 !== void 0 ? _ref3 : invoice.amount_remaining) !== null && _ref2 !== void 0 ? _ref2 : null;
|
|
21203
|
+
const updatedPrice = (_ref2 = (_ref3 = (_ref4 = (_ref5 = (_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 && _ref5 !== void 0 ? _ref5 : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref4 !== void 0 ? _ref4 : orderPrice) !== null && _ref3 !== void 0 ? _ref3 : invoice === null || invoice === void 0 ? void 0 : invoice.amount_remaining) !== null && _ref2 !== void 0 ? _ref2 : null;
|
|
21204
21204
|
useEffect(() => {
|
|
21205
21205
|
if (window.ApplePaySession) {
|
|
21206
21206
|
// Indicates whether the device supports Apple Pay and whether the user has an active card in Wallet.
|
|
@@ -21237,7 +21237,7 @@ const ApplePayButton = _ref => {
|
|
|
21237
21237
|
merchantCapabilities: ["supports3DS"],
|
|
21238
21238
|
supportedNetworks: ["visa", "masterCard", "amex", "discover"],
|
|
21239
21239
|
total: {
|
|
21240
|
-
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || orderLabel || `invoice #${invoice.id}`,
|
|
21240
|
+
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || orderLabel || `invoice #${invoice === null || invoice === void 0 ? void 0 : invoice.id}`,
|
|
21241
21241
|
type: "final",
|
|
21242
21242
|
amount: updatedPrice / 100
|
|
21243
21243
|
}
|
|
@@ -21285,12 +21285,12 @@ const ApplePayButton = _ref => {
|
|
|
21285
21285
|
// Define ApplePayPaymentMethodUpdate based on the selected payment method.
|
|
21286
21286
|
// No updates or errors are needed, pass an empty object.
|
|
21287
21287
|
const newTotal = {
|
|
21288
|
-
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || orderLabel || `invoice #${invoice.id}`,
|
|
21288
|
+
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || orderLabel || `invoice #${invoice === null || invoice === void 0 ? void 0 : invoice.id}`,
|
|
21289
21289
|
type: "final",
|
|
21290
21290
|
amount: updatedPrice / 100
|
|
21291
21291
|
};
|
|
21292
21292
|
const newLineItems = [{
|
|
21293
|
-
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || orderLabel || `invoice #${invoice.id}`,
|
|
21293
|
+
label: (plan === null || plan === void 0 ? void 0 : plan.nickname) || orderLabel || `invoice #${invoice === null || invoice === void 0 ? void 0 : invoice.id}`,
|
|
21294
21294
|
type: "final",
|
|
21295
21295
|
amount: updatedPrice / 100
|
|
21296
21296
|
}];
|
|
@@ -21303,14 +21303,14 @@ const ApplePayButton = _ref => {
|
|
|
21303
21303
|
// // Define ApplePayShippingMethodUpdate based on the selected shipping method.
|
|
21304
21304
|
// // No updates or errors are needed, pass an empty object.
|
|
21305
21305
|
// const newTotal = {
|
|
21306
|
-
// label: plan?.nickname || orderLabel || `invoice #${invoice
|
|
21306
|
+
// label: plan?.nickname || orderLabel || `invoice #${invoice?.id}`,
|
|
21307
21307
|
// type: "final",
|
|
21308
21308
|
// amount: updatedPrice / 100
|
|
21309
21309
|
// };
|
|
21310
21310
|
|
|
21311
21311
|
// const newLineItems = [
|
|
21312
21312
|
// {
|
|
21313
|
-
// label: plan?.nickname || orderLabel || `invoice #${invoice
|
|
21313
|
+
// label: plan?.nickname || orderLabel || `invoice #${invoice?.id}`,
|
|
21314
21314
|
// type: "final",
|
|
21315
21315
|
// amount: updatedPrice / 100
|
|
21316
21316
|
// }
|