@paystack/inline-js 2.15.0-dev.1 → 2.15.0-dev.2
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/inline.js +16 -9
- package/es/inline.js +16 -9
- package/lib/inline.js +16 -9
- package/package.json +1 -1
package/dist/inline.js
CHANGED
|
@@ -517,12 +517,18 @@ var PaystackPop = (function () {
|
|
|
517
517
|
};
|
|
518
518
|
|
|
519
519
|
/* eslint-env browser */
|
|
520
|
-
function
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
520
|
+
function getHighestZIndex() {
|
|
521
|
+
var highestZIndex = 0;
|
|
522
|
+
var elements = Array.from(document.querySelectorAll('body *'));
|
|
523
|
+
elements.forEach(function (element) {
|
|
524
|
+
var computedStyle = window.getComputedStyle(element);
|
|
525
|
+
var zIndex = parseFloat(computedStyle.zIndex);
|
|
526
|
+
|
|
527
|
+
if (!Number.isNaN(zIndex) && zIndex > highestZIndex) {
|
|
528
|
+
highestZIndex = zIndex;
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
return highestZIndex;
|
|
526
532
|
}
|
|
527
533
|
|
|
528
534
|
function createIframe(id) {
|
|
@@ -812,7 +818,7 @@ var PaystackPop = (function () {
|
|
|
812
818
|
var modal = document.createElement('div');
|
|
813
819
|
modal.classList.add('pre-checkout-modal');
|
|
814
820
|
modal.id = "pre-checkout-modal-".concat(id);
|
|
815
|
-
modal.style.zIndex =
|
|
821
|
+
modal.style.zIndex = getHighestZIndex() + 1;
|
|
816
822
|
var content = document.createElement('div');
|
|
817
823
|
content.classList.add('pre-checkout-modal__content');
|
|
818
824
|
modal.appendChild(content);
|
|
@@ -822,11 +828,12 @@ var PaystackPop = (function () {
|
|
|
822
828
|
merchantName = _ref4.merchant_name,
|
|
823
829
|
email = _ref4.email,
|
|
824
830
|
amount = _ref4.amount,
|
|
825
|
-
currency = _ref4.currency
|
|
831
|
+
currency = _ref4.currency,
|
|
832
|
+
label = _ref4.label;
|
|
826
833
|
|
|
827
834
|
var applePayPaymentInfo = document.createElement('div');
|
|
828
835
|
applePayPaymentInfo.classList.add('payment-info');
|
|
829
|
-
applePayPaymentInfo.innerHTML = "<img class=\"merchant-logo\" src=\"".concat(merchantLogo, "\" alt=\"").concat(merchantName, " Logo\">\n <div class=\"customer-info\">\n <div class=\"customer-email\">").concat(email, "</div>\n <div class=\"transaction-amount\">Pay <span class=\"amount\">").concat(currency, " ").concat(amount / 100, "</span></div>\n </div>");
|
|
836
|
+
applePayPaymentInfo.innerHTML = "<img class=\"merchant-logo\" src=\"".concat(merchantLogo, "\" alt=\"").concat(merchantName, " Logo\">\n <div class=\"customer-info\">\n <div class=\"customer-email\">").concat(label || email, "</div>\n <div class=\"transaction-amount\">Pay <span class=\"amount\">").concat(currency, " ").concat(amount / 100, "</span></div>\n </div>");
|
|
830
837
|
content.appendChild(applePayPaymentInfo);
|
|
831
838
|
content.innerHTML += applePayCloseButton;
|
|
832
839
|
var wrapper = document.createElement('div');
|
package/es/inline.js
CHANGED
|
@@ -514,12 +514,18 @@ var canUseApplePay = function canUseApplePay() {
|
|
|
514
514
|
};
|
|
515
515
|
|
|
516
516
|
/* eslint-env browser */
|
|
517
|
-
function
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
517
|
+
function getHighestZIndex() {
|
|
518
|
+
var highestZIndex = 0;
|
|
519
|
+
var elements = Array.from(document.querySelectorAll('body *'));
|
|
520
|
+
elements.forEach(function (element) {
|
|
521
|
+
var computedStyle = window.getComputedStyle(element);
|
|
522
|
+
var zIndex = parseFloat(computedStyle.zIndex);
|
|
523
|
+
|
|
524
|
+
if (!Number.isNaN(zIndex) && zIndex > highestZIndex) {
|
|
525
|
+
highestZIndex = zIndex;
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
return highestZIndex;
|
|
523
529
|
}
|
|
524
530
|
|
|
525
531
|
function createIframe(id) {
|
|
@@ -809,7 +815,7 @@ function mountPreCheckoutModal(id, transaction) {
|
|
|
809
815
|
var modal = document.createElement('div');
|
|
810
816
|
modal.classList.add('pre-checkout-modal');
|
|
811
817
|
modal.id = "pre-checkout-modal-".concat(id);
|
|
812
|
-
modal.style.zIndex =
|
|
818
|
+
modal.style.zIndex = getHighestZIndex() + 1;
|
|
813
819
|
var content = document.createElement('div');
|
|
814
820
|
content.classList.add('pre-checkout-modal__content');
|
|
815
821
|
modal.appendChild(content);
|
|
@@ -819,11 +825,12 @@ function mountPreCheckoutModal(id, transaction) {
|
|
|
819
825
|
merchantName = _ref4.merchant_name,
|
|
820
826
|
email = _ref4.email,
|
|
821
827
|
amount = _ref4.amount,
|
|
822
|
-
currency = _ref4.currency
|
|
828
|
+
currency = _ref4.currency,
|
|
829
|
+
label = _ref4.label;
|
|
823
830
|
|
|
824
831
|
var applePayPaymentInfo = document.createElement('div');
|
|
825
832
|
applePayPaymentInfo.classList.add('payment-info');
|
|
826
|
-
applePayPaymentInfo.innerHTML = "<img class=\"merchant-logo\" src=\"".concat(merchantLogo, "\" alt=\"").concat(merchantName, " Logo\">\n <div class=\"customer-info\">\n <div class=\"customer-email\">").concat(email, "</div>\n <div class=\"transaction-amount\">Pay <span class=\"amount\">").concat(currency, " ").concat(amount / 100, "</span></div>\n </div>");
|
|
833
|
+
applePayPaymentInfo.innerHTML = "<img class=\"merchant-logo\" src=\"".concat(merchantLogo, "\" alt=\"").concat(merchantName, " Logo\">\n <div class=\"customer-info\">\n <div class=\"customer-email\">").concat(label || email, "</div>\n <div class=\"transaction-amount\">Pay <span class=\"amount\">").concat(currency, " ").concat(amount / 100, "</span></div>\n </div>");
|
|
827
834
|
content.appendChild(applePayPaymentInfo);
|
|
828
835
|
content.innerHTML += applePayCloseButton;
|
|
829
836
|
var wrapper = document.createElement('div');
|
package/lib/inline.js
CHANGED
|
@@ -516,12 +516,18 @@ var canUseApplePay = function canUseApplePay() {
|
|
|
516
516
|
};
|
|
517
517
|
|
|
518
518
|
/* eslint-env browser */
|
|
519
|
-
function
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
519
|
+
function getHighestZIndex() {
|
|
520
|
+
var highestZIndex = 0;
|
|
521
|
+
var elements = Array.from(document.querySelectorAll('body *'));
|
|
522
|
+
elements.forEach(function (element) {
|
|
523
|
+
var computedStyle = window.getComputedStyle(element);
|
|
524
|
+
var zIndex = parseFloat(computedStyle.zIndex);
|
|
525
|
+
|
|
526
|
+
if (!Number.isNaN(zIndex) && zIndex > highestZIndex) {
|
|
527
|
+
highestZIndex = zIndex;
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
return highestZIndex;
|
|
525
531
|
}
|
|
526
532
|
|
|
527
533
|
function createIframe(id) {
|
|
@@ -811,7 +817,7 @@ function mountPreCheckoutModal(id, transaction) {
|
|
|
811
817
|
var modal = document.createElement('div');
|
|
812
818
|
modal.classList.add('pre-checkout-modal');
|
|
813
819
|
modal.id = "pre-checkout-modal-".concat(id);
|
|
814
|
-
modal.style.zIndex =
|
|
820
|
+
modal.style.zIndex = getHighestZIndex() + 1;
|
|
815
821
|
var content = document.createElement('div');
|
|
816
822
|
content.classList.add('pre-checkout-modal__content');
|
|
817
823
|
modal.appendChild(content);
|
|
@@ -821,11 +827,12 @@ function mountPreCheckoutModal(id, transaction) {
|
|
|
821
827
|
merchantName = _ref4.merchant_name,
|
|
822
828
|
email = _ref4.email,
|
|
823
829
|
amount = _ref4.amount,
|
|
824
|
-
currency = _ref4.currency
|
|
830
|
+
currency = _ref4.currency,
|
|
831
|
+
label = _ref4.label;
|
|
825
832
|
|
|
826
833
|
var applePayPaymentInfo = document.createElement('div');
|
|
827
834
|
applePayPaymentInfo.classList.add('payment-info');
|
|
828
|
-
applePayPaymentInfo.innerHTML = "<img class=\"merchant-logo\" src=\"".concat(merchantLogo, "\" alt=\"").concat(merchantName, " Logo\">\n <div class=\"customer-info\">\n <div class=\"customer-email\">").concat(email, "</div>\n <div class=\"transaction-amount\">Pay <span class=\"amount\">").concat(currency, " ").concat(amount / 100, "</span></div>\n </div>");
|
|
835
|
+
applePayPaymentInfo.innerHTML = "<img class=\"merchant-logo\" src=\"".concat(merchantLogo, "\" alt=\"").concat(merchantName, " Logo\">\n <div class=\"customer-info\">\n <div class=\"customer-email\">").concat(label || email, "</div>\n <div class=\"transaction-amount\">Pay <span class=\"amount\">").concat(currency, " ").concat(amount / 100, "</span></div>\n </div>");
|
|
829
836
|
content.appendChild(applePayPaymentInfo);
|
|
830
837
|
content.innerHTML += applePayCloseButton;
|
|
831
838
|
var wrapper = document.createElement('div');
|