@pelcro/react-pelcro-js 3.26.0-sandbox.36 → 3.26.0-sandbox.37
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 +2 -13
- package/dist/index.esm.js +2 -13
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -20375,7 +20375,7 @@ const ApplePayButton = _ref => {
|
|
|
20375
20375
|
if (pelcroApplyPayButton) {
|
|
20376
20376
|
pelcroApplyPayButton.style.display = "block";
|
|
20377
20377
|
}
|
|
20378
|
-
console.log("canMakePayments", canMakePayments);
|
|
20378
|
+
console.log("ApplePay canMakePayments: ", canMakePayments);
|
|
20379
20379
|
}
|
|
20380
20380
|
});
|
|
20381
20381
|
} else {
|
|
@@ -20417,7 +20417,7 @@ const ApplePayButton = _ref => {
|
|
|
20417
20417
|
amount: updatedPrice / 100
|
|
20418
20418
|
}
|
|
20419
20419
|
};
|
|
20420
|
-
|
|
20420
|
+
|
|
20421
20421
|
// Create ApplePaySession
|
|
20422
20422
|
// @todo - Clarify supported version parameter
|
|
20423
20423
|
// @odo - Apple Pay demo uses version 6 (https://applepaydemo.apple.com/)
|
|
@@ -20430,7 +20430,6 @@ const ApplePayButton = _ref => {
|
|
|
20430
20430
|
const {
|
|
20431
20431
|
validationURL
|
|
20432
20432
|
} = event;
|
|
20433
|
-
console.log("then merchantSession step", event);
|
|
20434
20433
|
// Call your own server to request a new merchant session.
|
|
20435
20434
|
window.Pelcro.payment.startSession({
|
|
20436
20435
|
auth_token: window.Pelcro.user.read().auth_token,
|
|
@@ -20439,7 +20438,6 @@ const ApplePayButton = _ref => {
|
|
|
20439
20438
|
}, (err, res) => {
|
|
20440
20439
|
if (err) {
|
|
20441
20440
|
// Handle any errors during merchant validation
|
|
20442
|
-
console.error("Merchant validation SDK error: ", err);
|
|
20443
20441
|
session.abort();
|
|
20444
20442
|
return dispatch({
|
|
20445
20443
|
type: SHOW_ALERT,
|
|
@@ -20450,13 +20448,11 @@ const ApplePayButton = _ref => {
|
|
|
20450
20448
|
});
|
|
20451
20449
|
}
|
|
20452
20450
|
// Complete merchant validation with the merchant session object
|
|
20453
|
-
console.log("Merchant validation SDK response: ", res);
|
|
20454
20451
|
const merchantSession = res;
|
|
20455
20452
|
session.completeMerchantValidation(merchantSession);
|
|
20456
20453
|
});
|
|
20457
20454
|
};
|
|
20458
20455
|
session.onpaymentmethodselected = event => {
|
|
20459
|
-
console.log("payment method selected step", event);
|
|
20460
20456
|
// Define ApplePayPaymentMethodUpdate based on the selected payment method.
|
|
20461
20457
|
// No updates or errors are needed, pass an empty object.
|
|
20462
20458
|
const newTotal = {
|
|
@@ -20474,7 +20470,6 @@ const ApplePayButton = _ref => {
|
|
|
20474
20470
|
|
|
20475
20471
|
// TODO: Check if onshippingmethodselected it should be implemented
|
|
20476
20472
|
// session.onshippingmethodselected = (event) => {
|
|
20477
|
-
// console.log("on shipping method selected step", event);
|
|
20478
20473
|
// // Define ApplePayShippingMethodUpdate based on the selected shipping method.
|
|
20479
20474
|
// // No updates or errors are needed, pass an empty object.
|
|
20480
20475
|
// const newTotal = {
|
|
@@ -20496,14 +20491,12 @@ const ApplePayButton = _ref => {
|
|
|
20496
20491
|
|
|
20497
20492
|
// TODO: Check if onshippingcontactselected it should be implemented
|
|
20498
20493
|
// session.onshippingcontactselected = (event) => {
|
|
20499
|
-
// console.log("on shipping contact selected step", event);
|
|
20500
20494
|
// // Define ApplePayShippingContactUpdate based on the selected shipping contact.
|
|
20501
20495
|
// const update = {};
|
|
20502
20496
|
// session.completeShippingContactSelection(update);
|
|
20503
20497
|
// };
|
|
20504
20498
|
|
|
20505
20499
|
session.onpaymentauthorized = event => {
|
|
20506
|
-
console.log("on payment authorized step", event);
|
|
20507
20500
|
// Define ApplePayPaymentAuthorizationResult
|
|
20508
20501
|
const result = {
|
|
20509
20502
|
status: ApplePaySession.STATUS_SUCCESS // eslint-disable-line no-undef
|
|
@@ -20532,7 +20525,6 @@ const ApplePayButton = _ref => {
|
|
|
20532
20525
|
transactionId: transactionId
|
|
20533
20526
|
}
|
|
20534
20527
|
};
|
|
20535
|
-
console.log(applePayToken);
|
|
20536
20528
|
const orderId = `pelcro-${new Date().getTime()}`;
|
|
20537
20529
|
const eProtectRequest = {
|
|
20538
20530
|
paypageId: payPageId,
|
|
@@ -20548,7 +20540,6 @@ const ApplePayButton = _ref => {
|
|
|
20548
20540
|
const {
|
|
20549
20541
|
expDate
|
|
20550
20542
|
} = vantivResponse;
|
|
20551
|
-
console.log("Response:", vantivResponse);
|
|
20552
20543
|
const expMonth = expDate.substring(0, 2);
|
|
20553
20544
|
const expYear = expDate.substring(2);
|
|
20554
20545
|
const vantivPaymentRequest = {
|
|
@@ -20587,7 +20578,6 @@ const ApplePayButton = _ref => {
|
|
|
20587
20578
|
|
|
20588
20579
|
// TODO: Check if oncouponcodechanged it should be implemented
|
|
20589
20580
|
// session.oncouponcodechanged = (event) => {
|
|
20590
|
-
// console.log("on coupon code changed step", event);
|
|
20591
20581
|
// // Define ApplePayCouponCodeUpdate
|
|
20592
20582
|
// const newTotal = calculateNewTotal(event.couponCode);
|
|
20593
20583
|
// const newLineItems = calculateNewLineItems(event.couponCode);
|
|
@@ -20606,7 +20596,6 @@ const ApplePayButton = _ref => {
|
|
|
20606
20596
|
|
|
20607
20597
|
session.oncancel = event => {
|
|
20608
20598
|
// Payment cancelled by WebKit
|
|
20609
|
-
console.log("on cancel step", event);
|
|
20610
20599
|
dispatch({
|
|
20611
20600
|
type: LOADING,
|
|
20612
20601
|
payload: false
|
package/dist/index.esm.js
CHANGED
|
@@ -20345,7 +20345,7 @@ const ApplePayButton = _ref => {
|
|
|
20345
20345
|
if (pelcroApplyPayButton) {
|
|
20346
20346
|
pelcroApplyPayButton.style.display = "block";
|
|
20347
20347
|
}
|
|
20348
|
-
console.log("canMakePayments", canMakePayments);
|
|
20348
|
+
console.log("ApplePay canMakePayments: ", canMakePayments);
|
|
20349
20349
|
}
|
|
20350
20350
|
});
|
|
20351
20351
|
} else {
|
|
@@ -20387,7 +20387,7 @@ const ApplePayButton = _ref => {
|
|
|
20387
20387
|
amount: updatedPrice / 100
|
|
20388
20388
|
}
|
|
20389
20389
|
};
|
|
20390
|
-
|
|
20390
|
+
|
|
20391
20391
|
// Create ApplePaySession
|
|
20392
20392
|
// @todo - Clarify supported version parameter
|
|
20393
20393
|
// @odo - Apple Pay demo uses version 6 (https://applepaydemo.apple.com/)
|
|
@@ -20400,7 +20400,6 @@ const ApplePayButton = _ref => {
|
|
|
20400
20400
|
const {
|
|
20401
20401
|
validationURL
|
|
20402
20402
|
} = event;
|
|
20403
|
-
console.log("then merchantSession step", event);
|
|
20404
20403
|
// Call your own server to request a new merchant session.
|
|
20405
20404
|
window.Pelcro.payment.startSession({
|
|
20406
20405
|
auth_token: window.Pelcro.user.read().auth_token,
|
|
@@ -20409,7 +20408,6 @@ const ApplePayButton = _ref => {
|
|
|
20409
20408
|
}, (err, res) => {
|
|
20410
20409
|
if (err) {
|
|
20411
20410
|
// Handle any errors during merchant validation
|
|
20412
|
-
console.error("Merchant validation SDK error: ", err);
|
|
20413
20411
|
session.abort();
|
|
20414
20412
|
return dispatch({
|
|
20415
20413
|
type: SHOW_ALERT,
|
|
@@ -20420,13 +20418,11 @@ const ApplePayButton = _ref => {
|
|
|
20420
20418
|
});
|
|
20421
20419
|
}
|
|
20422
20420
|
// Complete merchant validation with the merchant session object
|
|
20423
|
-
console.log("Merchant validation SDK response: ", res);
|
|
20424
20421
|
const merchantSession = res;
|
|
20425
20422
|
session.completeMerchantValidation(merchantSession);
|
|
20426
20423
|
});
|
|
20427
20424
|
};
|
|
20428
20425
|
session.onpaymentmethodselected = event => {
|
|
20429
|
-
console.log("payment method selected step", event);
|
|
20430
20426
|
// Define ApplePayPaymentMethodUpdate based on the selected payment method.
|
|
20431
20427
|
// No updates or errors are needed, pass an empty object.
|
|
20432
20428
|
const newTotal = {
|
|
@@ -20444,7 +20440,6 @@ const ApplePayButton = _ref => {
|
|
|
20444
20440
|
|
|
20445
20441
|
// TODO: Check if onshippingmethodselected it should be implemented
|
|
20446
20442
|
// session.onshippingmethodselected = (event) => {
|
|
20447
|
-
// console.log("on shipping method selected step", event);
|
|
20448
20443
|
// // Define ApplePayShippingMethodUpdate based on the selected shipping method.
|
|
20449
20444
|
// // No updates or errors are needed, pass an empty object.
|
|
20450
20445
|
// const newTotal = {
|
|
@@ -20466,14 +20461,12 @@ const ApplePayButton = _ref => {
|
|
|
20466
20461
|
|
|
20467
20462
|
// TODO: Check if onshippingcontactselected it should be implemented
|
|
20468
20463
|
// session.onshippingcontactselected = (event) => {
|
|
20469
|
-
// console.log("on shipping contact selected step", event);
|
|
20470
20464
|
// // Define ApplePayShippingContactUpdate based on the selected shipping contact.
|
|
20471
20465
|
// const update = {};
|
|
20472
20466
|
// session.completeShippingContactSelection(update);
|
|
20473
20467
|
// };
|
|
20474
20468
|
|
|
20475
20469
|
session.onpaymentauthorized = event => {
|
|
20476
|
-
console.log("on payment authorized step", event);
|
|
20477
20470
|
// Define ApplePayPaymentAuthorizationResult
|
|
20478
20471
|
const result = {
|
|
20479
20472
|
status: ApplePaySession.STATUS_SUCCESS // eslint-disable-line no-undef
|
|
@@ -20502,7 +20495,6 @@ const ApplePayButton = _ref => {
|
|
|
20502
20495
|
transactionId: transactionId
|
|
20503
20496
|
}
|
|
20504
20497
|
};
|
|
20505
|
-
console.log(applePayToken);
|
|
20506
20498
|
const orderId = `pelcro-${new Date().getTime()}`;
|
|
20507
20499
|
const eProtectRequest = {
|
|
20508
20500
|
paypageId: payPageId,
|
|
@@ -20518,7 +20510,6 @@ const ApplePayButton = _ref => {
|
|
|
20518
20510
|
const {
|
|
20519
20511
|
expDate
|
|
20520
20512
|
} = vantivResponse;
|
|
20521
|
-
console.log("Response:", vantivResponse);
|
|
20522
20513
|
const expMonth = expDate.substring(0, 2);
|
|
20523
20514
|
const expYear = expDate.substring(2);
|
|
20524
20515
|
const vantivPaymentRequest = {
|
|
@@ -20557,7 +20548,6 @@ const ApplePayButton = _ref => {
|
|
|
20557
20548
|
|
|
20558
20549
|
// TODO: Check if oncouponcodechanged it should be implemented
|
|
20559
20550
|
// session.oncouponcodechanged = (event) => {
|
|
20560
|
-
// console.log("on coupon code changed step", event);
|
|
20561
20551
|
// // Define ApplePayCouponCodeUpdate
|
|
20562
20552
|
// const newTotal = calculateNewTotal(event.couponCode);
|
|
20563
20553
|
// const newLineItems = calculateNewLineItems(event.couponCode);
|
|
@@ -20576,7 +20566,6 @@ const ApplePayButton = _ref => {
|
|
|
20576
20566
|
|
|
20577
20567
|
session.oncancel = event => {
|
|
20578
20568
|
// Payment cancelled by WebKit
|
|
20579
|
-
console.log("on cancel step", event);
|
|
20580
20569
|
dispatch({
|
|
20581
20570
|
type: LOADING,
|
|
20582
20571
|
payload: false
|