@paystack/inline-js 2.11.0-dev.6 → 2.11.0-dev.7
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 +10 -7
- package/package.json +1 -1
package/dist/inline.js
CHANGED
|
@@ -228,7 +228,7 @@ var generateApplePayFallbackCSS = function generateApplePayFallbackCSS(_ref2) {
|
|
|
228
228
|
return '\n @supports (-webkit-appearance: -apple-pay-button) { \n .apple-pay-button {\n display: inline-block;\n -webkit-appearance: -apple-pay-button;\n width: ' + width + ';\n height: ' + height + ';\n border-radius: ' + borderRadius + ';\n padding: ' + padding + ';\n -apple-pay-button-type: ' + type + ';\n -webkit-locale: ' + locale + '; \n }\n .apple-pay-button-black {\n -apple-pay-button-style: black;\n }\n .apple-pay-button-white {\n -apple-pay-button-style: white;\n }\n .apple-pay-button-white-with-line {\n -apple-pay-button-style: white-outline;\n }\n }\n\n @supports not (-webkit-appearance: -apple-pay-button) {\n .apple-pay-button {\n display: inline-block;\n background-size: 100% 60%;\n background-repeat: no-repeat;\n background-position: 50% 50%;\n border-radius: 5px;\n padding: 0px;\n box-sizing: border-box;\n min-width: 200px;\n min-height: 32px;\n max-height: 64px;\n }\n .apple-pay-button-black {\n background-image: -webkit-named-image(apple-pay-logo-white);\n background-color: black;\n }\n .apple-pay-button-white {\n background-image: -webkit-named-image(apple-pay-logo-black);\n background-color: white;\n }\n .apple-pay-button-white-with-line {\n background-image: -webkit-named-image(apple-pay-logo-black);\n background-color: white;\n border: .5px solid black;\n } \n }\n';
|
|
229
229
|
};
|
|
230
230
|
|
|
231
|
-
var preCheckoutModalCSS = '\n\n .pre-checkout-modal {\n display: none;\n position: fixed;\n z-index: 1;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100%;\n overflow: auto;\n background-color: rgba(0, 0, 0, 0.75);\n transition: all 0.2s ease;\n }\n\n .pre-checkout-modal.show {\n display: block;\n }\n\n .pre-checkout-modal__content {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n background-color: #fefefe;\n padding: 30px
|
|
231
|
+
var preCheckoutModalCSS = '\n\n .pre-checkout-modal {\n display: none;\n position: fixed;\n z-index: 1;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100%;\n overflow: auto;\n background-color: rgba(0, 0, 0, 0.75);\n transition: all 0.2s ease;\n }\n\n .pre-checkout-modal.show {\n display: block;\n }\n\n .pre-checkout-modal__content {\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n background-color: #fefefe;\n padding: 30px 24px;\n padding-bottom: max(30px, env(safe-area-inset-bottom));\n width: 100%;\n border-radius: 6px 6px 0 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n max-width: 450px;\n\n box-sizing: border-box;\n transform: translateY(238px);\n transition: transform 0.3s cubic-bezier(.16,.81,.32,1);\n }\n\n .modal-wrapper {\n padding: 0 16px;\n }\n\n .payment-info {\n position: relative;\n border-bottom: solid 1px whitesmoke;\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n width: 100%;\n }\n\n .customer-email {\n color: #737373;\n font-size: 13px;\n line-height: 16px;\n }\n\n .customer-info {\n flex: 1;\n text-align: right;\n }\n\n .merchant-logo {\n display: flex;\n align-items: center;\n height: 22px;\n width: 22px;\n }\n .transaction-amount {\n margin-top: 5px;\n font-size: 13px;\n line-height: 16px;\n color: #737373;\n }\n\n .amount {\n color: #29b263;\n font-weight: bold;\n }\n\n @media only screen and (min-width: 500px) {\n .pre-checkout-modal__content {\n bottom: 0;\n top: 0;\n margin: auto;\n border-radius: 6px;\n height: fit-content;\n }\n }\n\n .pre-checkout-modal__content.show {\n transform: translateY(0);\n padding-bottom: 0;\n }\n\n .pre-checkout-modal__content > * {\n margin-top: 0;\n margin-bottom: 40px;\n }\n .pre-checkout-modal__content > *:last-child {\n margin-bottom: 0;\n }\n\n .pre-checkout-modal__content svg {\n margin: auto;\n width: 100%;\n }\n\n #inline-button-wordmark--white {\n position: absolute;\n bottom: -50px;\n margin: auto;\n right: 0;\n width: fit-content;\n }\n\n #inline-button-wordmark--grey {\n display: none;\n }\n\n .pre-checkout-modal__content #apple-pay-mark--light {\n margin-bottom: 16px;\n }\n\n .pre-checkout-modal p {\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",\n "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;\n color: #4E4E4E;\n line-height: 28px;\n font-size: 14px;\n font-weight: 500;\n text-align: center;\n letter-spacing: -0.3px;\n }\n\n .pre-checkout-modal button {\n height: 42px;\n width: 100%;\n background: linear-gradient(180deg, #40ad57 21.43%, #44b669 88.1%), #44b669;\n border: 1px solid #49a861;\n box-sizing: border-box;\n box-shadow: 0px 1px 4px rgba(0, 0, 0, 0.1);\n border-radius: 5px;\n text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);\n color: #ffffff;\n font-weight: 600;\n font-size: 14px;\n line-height: 14px;\n\n -webkit-text-size-adjust: 100%;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",\n "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;\n }\n\n #payment-request-button {\n width: 100%;\n height: fit-content;\n margin-bottom: 16px;\n }\n\n #paystackpop-button {\n padding: 0 16px;\n }\n\n @media only screen and (max-width: 500px) {\n .pre-checkout-modal__content {\n max-width: 500px;\n border-radius: 0;\n }\n\n .modal-wrapper {\n padding: 0;\n }\n\n #inline-button-wordmark--white {\n display: none\n }\n \n #inline-button-wordmark--grey {\n display: block;\n width: 100%;\n margin: 16px 0;\n height: 13px;\n }\n }\n';
|
|
232
232
|
|
|
233
233
|
var amountSubunitToBase = function amountSubunitToBase() {
|
|
234
234
|
var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
@@ -627,22 +627,25 @@ function mountPreCheckoutModal(id, transaction) {
|
|
|
627
627
|
applePayPaymentInfo.innerHTML = '<img class="merchant-logo" src="' + merchant_logo + '" alt="' + merchant_name + ' Logo">\n <div class="customer-info">\n <div class="customer-email">' + email + '</div>\n <div class="transaction-amount">Pay <span class="amount">' + amount / 100 + ' ' + currency + '</span></div>\n </div>';
|
|
628
628
|
content.appendChild(applePayPaymentInfo);
|
|
629
629
|
|
|
630
|
-
|
|
630
|
+
var wrapper = document.createElement("div");
|
|
631
|
+
wrapper.classList.add('modal-wrapper');
|
|
632
|
+
wrapper.innerHTML = applePayMarkLight;
|
|
631
633
|
|
|
632
634
|
var applePayDescription = document.createElement("p");
|
|
633
635
|
applePayDescription.innerHTML = 'Pay with Apple Pay to complete your purchase without filling a form';
|
|
634
|
-
|
|
636
|
+
wrapper.appendChild(applePayDescription);
|
|
635
637
|
|
|
636
638
|
var paymentButtonContainer = document.createElement("div");
|
|
637
639
|
paymentButtonContainer.id = "payment-request-button";
|
|
638
|
-
|
|
640
|
+
wrapper.appendChild(paymentButtonContainer);
|
|
639
641
|
|
|
640
642
|
var openPaystackPopButton = document.createElement("button");
|
|
641
643
|
openPaystackPopButton.id = "paystackpop-button";
|
|
642
644
|
openPaystackPopButton.innerText = "More payment options";
|
|
643
|
-
|
|
645
|
+
wrapper.appendChild(openPaystackPopButton);
|
|
644
646
|
|
|
645
|
-
|
|
647
|
+
wrapper.innerHTML = wrapper.innerHTML + secureByPaystackWhite + secureByPaystackGrey;
|
|
648
|
+
content.appendChild(wrapper);
|
|
646
649
|
|
|
647
650
|
var style = document.createElement("style");
|
|
648
651
|
style.textContent = preCheckoutModalCSS;
|
|
@@ -1239,7 +1242,7 @@ var Inline = function () {
|
|
|
1239
1242
|
applePay: {
|
|
1240
1243
|
width: "100%",
|
|
1241
1244
|
type: "pay",
|
|
1242
|
-
height: "
|
|
1245
|
+
height: "42px",
|
|
1243
1246
|
padding: '15px',
|
|
1244
1247
|
borderRadius: "5px"
|
|
1245
1248
|
}
|