@pelcro/react-pelcro-js 3.26.0-sandbox.36 → 3.26.0-sandbox.38
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 +16 -21
- package/dist/index.esm.js +16 -21
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3458,7 +3458,9 @@ var labels$11 = {
|
|
|
3458
3458
|
firstName: "First name",
|
|
3459
3459
|
lastName: "Last name",
|
|
3460
3460
|
phone: "Phone",
|
|
3461
|
-
freeItems: "Free Items"
|
|
3461
|
+
freeItems: "Free Items",
|
|
3462
|
+
order: "Order",
|
|
3463
|
+
amount: "Amount"
|
|
3462
3464
|
};
|
|
3463
3465
|
var checkoutForm_en = {
|
|
3464
3466
|
messages: messages$14,
|
|
@@ -4329,7 +4331,9 @@ var labels$M = {
|
|
|
4329
4331
|
firstName: "Prénom",
|
|
4330
4332
|
lastName: "Nom de famille",
|
|
4331
4333
|
phone: "Téléphoner",
|
|
4332
|
-
freeItems: "Articles gratuits"
|
|
4334
|
+
freeItems: "Articles gratuits",
|
|
4335
|
+
order: "Commande",
|
|
4336
|
+
amount: "Montant"
|
|
4333
4337
|
};
|
|
4334
4338
|
var checkoutForm_fr = {
|
|
4335
4339
|
messages: messages$O,
|
|
@@ -5200,7 +5204,9 @@ var labels$v = {
|
|
|
5200
5204
|
firstName: "이름",
|
|
5201
5205
|
lastName: "성",
|
|
5202
5206
|
phone: "핸드폰",
|
|
5203
|
-
freeItems: "무료 아이템"
|
|
5207
|
+
freeItems: "무료 아이템",
|
|
5208
|
+
order: "주문",
|
|
5209
|
+
amount: "금액"
|
|
5204
5210
|
};
|
|
5205
5211
|
var checkoutForm_ko = {
|
|
5206
5212
|
messages: messages$w,
|
|
@@ -6175,7 +6181,9 @@ var labels$e = {
|
|
|
6175
6181
|
firstName: "Nombre",
|
|
6176
6182
|
lastName: "Apellido",
|
|
6177
6183
|
phone: "Teléfono",
|
|
6178
|
-
freeItems: "Artículos gratis"
|
|
6184
|
+
freeItems: "Artículos gratis",
|
|
6185
|
+
order: "Pida",
|
|
6186
|
+
amount: "Importe"
|
|
6179
6187
|
};
|
|
6180
6188
|
var checkoutForm_es = {
|
|
6181
6189
|
messages: messages$e,
|
|
@@ -20375,7 +20383,7 @@ const ApplePayButton = _ref => {
|
|
|
20375
20383
|
if (pelcroApplyPayButton) {
|
|
20376
20384
|
pelcroApplyPayButton.style.display = "block";
|
|
20377
20385
|
}
|
|
20378
|
-
console.log("canMakePayments", canMakePayments);
|
|
20386
|
+
console.log("ApplePay canMakePayments: ", canMakePayments);
|
|
20379
20387
|
}
|
|
20380
20388
|
});
|
|
20381
20389
|
} else {
|
|
@@ -20417,7 +20425,7 @@ const ApplePayButton = _ref => {
|
|
|
20417
20425
|
amount: updatedPrice / 100
|
|
20418
20426
|
}
|
|
20419
20427
|
};
|
|
20420
|
-
|
|
20428
|
+
|
|
20421
20429
|
// Create ApplePaySession
|
|
20422
20430
|
// @todo - Clarify supported version parameter
|
|
20423
20431
|
// @odo - Apple Pay demo uses version 6 (https://applepaydemo.apple.com/)
|
|
@@ -20430,7 +20438,6 @@ const ApplePayButton = _ref => {
|
|
|
20430
20438
|
const {
|
|
20431
20439
|
validationURL
|
|
20432
20440
|
} = event;
|
|
20433
|
-
console.log("then merchantSession step", event);
|
|
20434
20441
|
// Call your own server to request a new merchant session.
|
|
20435
20442
|
window.Pelcro.payment.startSession({
|
|
20436
20443
|
auth_token: window.Pelcro.user.read().auth_token,
|
|
@@ -20439,7 +20446,6 @@ const ApplePayButton = _ref => {
|
|
|
20439
20446
|
}, (err, res) => {
|
|
20440
20447
|
if (err) {
|
|
20441
20448
|
// Handle any errors during merchant validation
|
|
20442
|
-
console.error("Merchant validation SDK error: ", err);
|
|
20443
20449
|
session.abort();
|
|
20444
20450
|
return dispatch({
|
|
20445
20451
|
type: SHOW_ALERT,
|
|
@@ -20450,13 +20456,11 @@ const ApplePayButton = _ref => {
|
|
|
20450
20456
|
});
|
|
20451
20457
|
}
|
|
20452
20458
|
// Complete merchant validation with the merchant session object
|
|
20453
|
-
console.log("Merchant validation SDK response: ", res);
|
|
20454
20459
|
const merchantSession = res;
|
|
20455
20460
|
session.completeMerchantValidation(merchantSession);
|
|
20456
20461
|
});
|
|
20457
20462
|
};
|
|
20458
20463
|
session.onpaymentmethodselected = event => {
|
|
20459
|
-
console.log("payment method selected step", event);
|
|
20460
20464
|
// Define ApplePayPaymentMethodUpdate based on the selected payment method.
|
|
20461
20465
|
// No updates or errors are needed, pass an empty object.
|
|
20462
20466
|
const newTotal = {
|
|
@@ -20474,7 +20478,6 @@ const ApplePayButton = _ref => {
|
|
|
20474
20478
|
|
|
20475
20479
|
// TODO: Check if onshippingmethodselected it should be implemented
|
|
20476
20480
|
// session.onshippingmethodselected = (event) => {
|
|
20477
|
-
// console.log("on shipping method selected step", event);
|
|
20478
20481
|
// // Define ApplePayShippingMethodUpdate based on the selected shipping method.
|
|
20479
20482
|
// // No updates or errors are needed, pass an empty object.
|
|
20480
20483
|
// const newTotal = {
|
|
@@ -20496,14 +20499,12 @@ const ApplePayButton = _ref => {
|
|
|
20496
20499
|
|
|
20497
20500
|
// TODO: Check if onshippingcontactselected it should be implemented
|
|
20498
20501
|
// session.onshippingcontactselected = (event) => {
|
|
20499
|
-
// console.log("on shipping contact selected step", event);
|
|
20500
20502
|
// // Define ApplePayShippingContactUpdate based on the selected shipping contact.
|
|
20501
20503
|
// const update = {};
|
|
20502
20504
|
// session.completeShippingContactSelection(update);
|
|
20503
20505
|
// };
|
|
20504
20506
|
|
|
20505
20507
|
session.onpaymentauthorized = event => {
|
|
20506
|
-
console.log("on payment authorized step", event);
|
|
20507
20508
|
// Define ApplePayPaymentAuthorizationResult
|
|
20508
20509
|
const result = {
|
|
20509
20510
|
status: ApplePaySession.STATUS_SUCCESS // eslint-disable-line no-undef
|
|
@@ -20532,7 +20533,6 @@ const ApplePayButton = _ref => {
|
|
|
20532
20533
|
transactionId: transactionId
|
|
20533
20534
|
}
|
|
20534
20535
|
};
|
|
20535
|
-
console.log(applePayToken);
|
|
20536
20536
|
const orderId = `pelcro-${new Date().getTime()}`;
|
|
20537
20537
|
const eProtectRequest = {
|
|
20538
20538
|
paypageId: payPageId,
|
|
@@ -20548,7 +20548,6 @@ const ApplePayButton = _ref => {
|
|
|
20548
20548
|
const {
|
|
20549
20549
|
expDate
|
|
20550
20550
|
} = vantivResponse;
|
|
20551
|
-
console.log("Response:", vantivResponse);
|
|
20552
20551
|
const expMonth = expDate.substring(0, 2);
|
|
20553
20552
|
const expYear = expDate.substring(2);
|
|
20554
20553
|
const vantivPaymentRequest = {
|
|
@@ -20587,7 +20586,6 @@ const ApplePayButton = _ref => {
|
|
|
20587
20586
|
|
|
20588
20587
|
// TODO: Check if oncouponcodechanged it should be implemented
|
|
20589
20588
|
// session.oncouponcodechanged = (event) => {
|
|
20590
|
-
// console.log("on coupon code changed step", event);
|
|
20591
20589
|
// // Define ApplePayCouponCodeUpdate
|
|
20592
20590
|
// const newTotal = calculateNewTotal(event.couponCode);
|
|
20593
20591
|
// const newLineItems = calculateNewLineItems(event.couponCode);
|
|
@@ -20606,7 +20604,6 @@ const ApplePayButton = _ref => {
|
|
|
20606
20604
|
|
|
20607
20605
|
session.oncancel = event => {
|
|
20608
20606
|
// Payment cancelled by WebKit
|
|
20609
|
-
console.log("on cancel step", event);
|
|
20610
20607
|
dispatch({
|
|
20611
20608
|
type: LOADING,
|
|
20612
20609
|
payload: false
|
|
@@ -20672,11 +20669,9 @@ function PaymentMethodView(_ref) {
|
|
|
20672
20669
|
className: "plc-w-full plc-p-2 plc-mb-4 plc-font-semibold plc-text-center plc-text-gray-900 plc-bg-gray-100 plc-border plc-border-gray-200"
|
|
20673
20670
|
}, /*#__PURE__*/React__default['default'].createElement("p", {
|
|
20674
20671
|
className: "plc-text-gray-600"
|
|
20675
|
-
},
|
|
20676
|
-
className: "plc-tracking-wider plc-uppercase"
|
|
20677
|
-
}, order === null || order === void 0 ? void 0 : order.name) : /*#__PURE__*/React__default['default'].createElement("span", {
|
|
20672
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
20678
20673
|
className: "plc-tracking-wider plc-uppercase"
|
|
20679
|
-
}, t("labels.
|
|
20674
|
+
}, t("labels.amount")), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement("span", {
|
|
20680
20675
|
className: "plc-text-xl plc-font-semibold plc-text-primary-600"
|
|
20681
20676
|
}, (_calcAndFormatItemsTo = calcAndFormatItemsTotal(order, (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency)) !== null && _calcAndFormatItemsTo !== void 0 ? _calcAndFormatItemsTo : getFormattedPriceByLocal(order === null || order === void 0 ? void 0 : order.price, order === null || order === void 0 ? void 0 : order.currency, getPageOrDefaultLanguage())))), cardProcessor === "stripe" && !showSubscriptionButton && !showOrderButton && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
20682
20677
|
className: "plc-flex plc-items-center plc-w-full plc-px-4 plc-py-2 plc-text-center plc-text-green-600 plc-border plc-border-green-400 plc-rounded plc-bg-green-50"
|
package/dist/index.esm.js
CHANGED
|
@@ -3428,7 +3428,9 @@ var labels$11 = {
|
|
|
3428
3428
|
firstName: "First name",
|
|
3429
3429
|
lastName: "Last name",
|
|
3430
3430
|
phone: "Phone",
|
|
3431
|
-
freeItems: "Free Items"
|
|
3431
|
+
freeItems: "Free Items",
|
|
3432
|
+
order: "Order",
|
|
3433
|
+
amount: "Amount"
|
|
3432
3434
|
};
|
|
3433
3435
|
var checkoutForm_en = {
|
|
3434
3436
|
messages: messages$14,
|
|
@@ -4299,7 +4301,9 @@ var labels$M = {
|
|
|
4299
4301
|
firstName: "Prénom",
|
|
4300
4302
|
lastName: "Nom de famille",
|
|
4301
4303
|
phone: "Téléphoner",
|
|
4302
|
-
freeItems: "Articles gratuits"
|
|
4304
|
+
freeItems: "Articles gratuits",
|
|
4305
|
+
order: "Commande",
|
|
4306
|
+
amount: "Montant"
|
|
4303
4307
|
};
|
|
4304
4308
|
var checkoutForm_fr = {
|
|
4305
4309
|
messages: messages$O,
|
|
@@ -5170,7 +5174,9 @@ var labels$v = {
|
|
|
5170
5174
|
firstName: "이름",
|
|
5171
5175
|
lastName: "성",
|
|
5172
5176
|
phone: "핸드폰",
|
|
5173
|
-
freeItems: "무료 아이템"
|
|
5177
|
+
freeItems: "무료 아이템",
|
|
5178
|
+
order: "주문",
|
|
5179
|
+
amount: "금액"
|
|
5174
5180
|
};
|
|
5175
5181
|
var checkoutForm_ko = {
|
|
5176
5182
|
messages: messages$w,
|
|
@@ -6145,7 +6151,9 @@ var labels$e = {
|
|
|
6145
6151
|
firstName: "Nombre",
|
|
6146
6152
|
lastName: "Apellido",
|
|
6147
6153
|
phone: "Teléfono",
|
|
6148
|
-
freeItems: "Artículos gratis"
|
|
6154
|
+
freeItems: "Artículos gratis",
|
|
6155
|
+
order: "Pida",
|
|
6156
|
+
amount: "Importe"
|
|
6149
6157
|
};
|
|
6150
6158
|
var checkoutForm_es = {
|
|
6151
6159
|
messages: messages$e,
|
|
@@ -20345,7 +20353,7 @@ const ApplePayButton = _ref => {
|
|
|
20345
20353
|
if (pelcroApplyPayButton) {
|
|
20346
20354
|
pelcroApplyPayButton.style.display = "block";
|
|
20347
20355
|
}
|
|
20348
|
-
console.log("canMakePayments", canMakePayments);
|
|
20356
|
+
console.log("ApplePay canMakePayments: ", canMakePayments);
|
|
20349
20357
|
}
|
|
20350
20358
|
});
|
|
20351
20359
|
} else {
|
|
@@ -20387,7 +20395,7 @@ const ApplePayButton = _ref => {
|
|
|
20387
20395
|
amount: updatedPrice / 100
|
|
20388
20396
|
}
|
|
20389
20397
|
};
|
|
20390
|
-
|
|
20398
|
+
|
|
20391
20399
|
// Create ApplePaySession
|
|
20392
20400
|
// @todo - Clarify supported version parameter
|
|
20393
20401
|
// @odo - Apple Pay demo uses version 6 (https://applepaydemo.apple.com/)
|
|
@@ -20400,7 +20408,6 @@ const ApplePayButton = _ref => {
|
|
|
20400
20408
|
const {
|
|
20401
20409
|
validationURL
|
|
20402
20410
|
} = event;
|
|
20403
|
-
console.log("then merchantSession step", event);
|
|
20404
20411
|
// Call your own server to request a new merchant session.
|
|
20405
20412
|
window.Pelcro.payment.startSession({
|
|
20406
20413
|
auth_token: window.Pelcro.user.read().auth_token,
|
|
@@ -20409,7 +20416,6 @@ const ApplePayButton = _ref => {
|
|
|
20409
20416
|
}, (err, res) => {
|
|
20410
20417
|
if (err) {
|
|
20411
20418
|
// Handle any errors during merchant validation
|
|
20412
|
-
console.error("Merchant validation SDK error: ", err);
|
|
20413
20419
|
session.abort();
|
|
20414
20420
|
return dispatch({
|
|
20415
20421
|
type: SHOW_ALERT,
|
|
@@ -20420,13 +20426,11 @@ const ApplePayButton = _ref => {
|
|
|
20420
20426
|
});
|
|
20421
20427
|
}
|
|
20422
20428
|
// Complete merchant validation with the merchant session object
|
|
20423
|
-
console.log("Merchant validation SDK response: ", res);
|
|
20424
20429
|
const merchantSession = res;
|
|
20425
20430
|
session.completeMerchantValidation(merchantSession);
|
|
20426
20431
|
});
|
|
20427
20432
|
};
|
|
20428
20433
|
session.onpaymentmethodselected = event => {
|
|
20429
|
-
console.log("payment method selected step", event);
|
|
20430
20434
|
// Define ApplePayPaymentMethodUpdate based on the selected payment method.
|
|
20431
20435
|
// No updates or errors are needed, pass an empty object.
|
|
20432
20436
|
const newTotal = {
|
|
@@ -20444,7 +20448,6 @@ const ApplePayButton = _ref => {
|
|
|
20444
20448
|
|
|
20445
20449
|
// TODO: Check if onshippingmethodselected it should be implemented
|
|
20446
20450
|
// session.onshippingmethodselected = (event) => {
|
|
20447
|
-
// console.log("on shipping method selected step", event);
|
|
20448
20451
|
// // Define ApplePayShippingMethodUpdate based on the selected shipping method.
|
|
20449
20452
|
// // No updates or errors are needed, pass an empty object.
|
|
20450
20453
|
// const newTotal = {
|
|
@@ -20466,14 +20469,12 @@ const ApplePayButton = _ref => {
|
|
|
20466
20469
|
|
|
20467
20470
|
// TODO: Check if onshippingcontactselected it should be implemented
|
|
20468
20471
|
// session.onshippingcontactselected = (event) => {
|
|
20469
|
-
// console.log("on shipping contact selected step", event);
|
|
20470
20472
|
// // Define ApplePayShippingContactUpdate based on the selected shipping contact.
|
|
20471
20473
|
// const update = {};
|
|
20472
20474
|
// session.completeShippingContactSelection(update);
|
|
20473
20475
|
// };
|
|
20474
20476
|
|
|
20475
20477
|
session.onpaymentauthorized = event => {
|
|
20476
|
-
console.log("on payment authorized step", event);
|
|
20477
20478
|
// Define ApplePayPaymentAuthorizationResult
|
|
20478
20479
|
const result = {
|
|
20479
20480
|
status: ApplePaySession.STATUS_SUCCESS // eslint-disable-line no-undef
|
|
@@ -20502,7 +20503,6 @@ const ApplePayButton = _ref => {
|
|
|
20502
20503
|
transactionId: transactionId
|
|
20503
20504
|
}
|
|
20504
20505
|
};
|
|
20505
|
-
console.log(applePayToken);
|
|
20506
20506
|
const orderId = `pelcro-${new Date().getTime()}`;
|
|
20507
20507
|
const eProtectRequest = {
|
|
20508
20508
|
paypageId: payPageId,
|
|
@@ -20518,7 +20518,6 @@ const ApplePayButton = _ref => {
|
|
|
20518
20518
|
const {
|
|
20519
20519
|
expDate
|
|
20520
20520
|
} = vantivResponse;
|
|
20521
|
-
console.log("Response:", vantivResponse);
|
|
20522
20521
|
const expMonth = expDate.substring(0, 2);
|
|
20523
20522
|
const expYear = expDate.substring(2);
|
|
20524
20523
|
const vantivPaymentRequest = {
|
|
@@ -20557,7 +20556,6 @@ const ApplePayButton = _ref => {
|
|
|
20557
20556
|
|
|
20558
20557
|
// TODO: Check if oncouponcodechanged it should be implemented
|
|
20559
20558
|
// session.oncouponcodechanged = (event) => {
|
|
20560
|
-
// console.log("on coupon code changed step", event);
|
|
20561
20559
|
// // Define ApplePayCouponCodeUpdate
|
|
20562
20560
|
// const newTotal = calculateNewTotal(event.couponCode);
|
|
20563
20561
|
// const newLineItems = calculateNewLineItems(event.couponCode);
|
|
@@ -20576,7 +20574,6 @@ const ApplePayButton = _ref => {
|
|
|
20576
20574
|
|
|
20577
20575
|
session.oncancel = event => {
|
|
20578
20576
|
// Payment cancelled by WebKit
|
|
20579
|
-
console.log("on cancel step", event);
|
|
20580
20577
|
dispatch({
|
|
20581
20578
|
type: LOADING,
|
|
20582
20579
|
payload: false
|
|
@@ -20642,11 +20639,9 @@ function PaymentMethodView(_ref) {
|
|
|
20642
20639
|
className: "plc-w-full plc-p-2 plc-mb-4 plc-font-semibold plc-text-center plc-text-gray-900 plc-bg-gray-100 plc-border plc-border-gray-200"
|
|
20643
20640
|
}, /*#__PURE__*/React__default.createElement("p", {
|
|
20644
20641
|
className: "plc-text-gray-600"
|
|
20645
|
-
},
|
|
20646
|
-
className: "plc-tracking-wider plc-uppercase"
|
|
20647
|
-
}, order === null || order === void 0 ? void 0 : order.name) : /*#__PURE__*/React__default.createElement("span", {
|
|
20642
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
20648
20643
|
className: "plc-tracking-wider plc-uppercase"
|
|
20649
|
-
}, t("labels.
|
|
20644
|
+
}, t("labels.amount")), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
|
|
20650
20645
|
className: "plc-text-xl plc-font-semibold plc-text-primary-600"
|
|
20651
20646
|
}, (_calcAndFormatItemsTo = calcAndFormatItemsTotal(order, (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency)) !== null && _calcAndFormatItemsTo !== void 0 ? _calcAndFormatItemsTo : getFormattedPriceByLocal(order === null || order === void 0 ? void 0 : order.price, order === null || order === void 0 ? void 0 : order.currency, getPageOrDefaultLanguage())))), cardProcessor === "stripe" && !showSubscriptionButton && !showOrderButton && /*#__PURE__*/React__default.createElement("div", {
|
|
20652
20647
|
className: "plc-flex plc-items-center plc-w-full plc-px-4 plc-py-2 plc-text-center plc-text-green-600 plc-border plc-border-green-400 plc-rounded plc-bg-green-50"
|