@paystack/inline-js 2.19.0-dev.4 → 2.19.0-dev.6
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 +19 -12
- package/es/inline.js +19 -12
- package/lib/inline.js +19 -12
- package/package.json +1 -1
package/dist/inline.js
CHANGED
|
@@ -930,7 +930,7 @@ var PaystackPop = (function () {
|
|
|
930
930
|
sendLinkOtp({
|
|
931
931
|
channels: channels || OTP_RESEND_COUNT_CONFIG[this.otpResendCount].channels,
|
|
932
932
|
email: this.transaction.email,
|
|
933
|
-
transaction: this.transaction
|
|
933
|
+
transaction: this.transaction
|
|
934
934
|
}).then(function (response) {
|
|
935
935
|
return _this.onSuccess(response.data.token);
|
|
936
936
|
}).catch(function () {// catching here so a unhandledrejection error is not thrown
|
|
@@ -1501,7 +1501,10 @@ var PaystackPop = (function () {
|
|
|
1501
1501
|
* */
|
|
1502
1502
|
|
|
1503
1503
|
|
|
1504
|
-
function getLinkContent(
|
|
1504
|
+
function getLinkContent(_ref4) {
|
|
1505
|
+
var transaction = _ref4.transaction,
|
|
1506
|
+
closePreCheckoutModal = _ref4.closePreCheckoutModal,
|
|
1507
|
+
inlineInstanceId = _ref4.inlineInstanceId;
|
|
1505
1508
|
var wrapper = document.createElement('div');
|
|
1506
1509
|
wrapper.classList.add('modal-wrapper');
|
|
1507
1510
|
wrapper.innerHTML = wrapper.innerHTML + secureByPaystackWhite + secureByPaystackGrey;
|
|
@@ -1534,9 +1537,9 @@ var PaystackPop = (function () {
|
|
|
1534
1537
|
transaction: transaction,
|
|
1535
1538
|
token: linkToken
|
|
1536
1539
|
}).then(function (response) {
|
|
1537
|
-
getCheckoutIframe().contentWindow.postMessage({
|
|
1540
|
+
getCheckoutIframe(inlineInstanceId).contentWindow.postMessage({
|
|
1538
1541
|
type: 'link-success',
|
|
1539
|
-
data: response
|
|
1542
|
+
data: response.data
|
|
1540
1543
|
}, '*');
|
|
1541
1544
|
otpRetry.unmount();
|
|
1542
1545
|
loader.unmount();
|
|
@@ -1596,13 +1599,13 @@ var PaystackPop = (function () {
|
|
|
1596
1599
|
content.classList.add('pre-checkout-modal__content');
|
|
1597
1600
|
modal.appendChild(content);
|
|
1598
1601
|
|
|
1599
|
-
var
|
|
1600
|
-
merchantLogo =
|
|
1601
|
-
merchantName =
|
|
1602
|
-
email =
|
|
1603
|
-
amount =
|
|
1604
|
-
currency =
|
|
1605
|
-
label =
|
|
1602
|
+
var _ref5 = transaction || {},
|
|
1603
|
+
merchantLogo = _ref5.merchant_logo,
|
|
1604
|
+
merchantName = _ref5.merchant_name,
|
|
1605
|
+
email = _ref5.email,
|
|
1606
|
+
amount = _ref5.amount,
|
|
1607
|
+
currency = _ref5.currency,
|
|
1608
|
+
label = _ref5.label;
|
|
1606
1609
|
|
|
1607
1610
|
var applePayPaymentInfo = document.createElement('div');
|
|
1608
1611
|
var formattedAmount = new Intl.NumberFormat('en', {
|
|
@@ -1616,7 +1619,11 @@ var PaystackPop = (function () {
|
|
|
1616
1619
|
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(formattedAmount, "</span></div>\n </div>");
|
|
1617
1620
|
content.appendChild(applePayPaymentInfo);
|
|
1618
1621
|
content.innerHTML += applePayCloseButton;
|
|
1619
|
-
var wrapper = canPayWithLink(transaction) ? getLinkContent(
|
|
1622
|
+
var wrapper = canPayWithLink(transaction) ? getLinkContent({
|
|
1623
|
+
transaction: transaction,
|
|
1624
|
+
closePreCheckoutModal: closePreCheckoutModal,
|
|
1625
|
+
inlineInstanceId: id
|
|
1626
|
+
}) : getApplePayContent();
|
|
1620
1627
|
content.appendChild(wrapper);
|
|
1621
1628
|
var style = document.createElement('style');
|
|
1622
1629
|
style.textContent = preCheckoutModalCSS;
|
package/es/inline.js
CHANGED
|
@@ -927,7 +927,7 @@ var OtpRetry = /*#__PURE__*/function () {
|
|
|
927
927
|
sendLinkOtp({
|
|
928
928
|
channels: channels || OTP_RESEND_COUNT_CONFIG[this.otpResendCount].channels,
|
|
929
929
|
email: this.transaction.email,
|
|
930
|
-
transaction: this.transaction
|
|
930
|
+
transaction: this.transaction
|
|
931
931
|
}).then(function (response) {
|
|
932
932
|
return _this.onSuccess(response.data.token);
|
|
933
933
|
}).catch(function () {// catching here so a unhandledrejection error is not thrown
|
|
@@ -1498,7 +1498,10 @@ function getLinkOtpHelp(linkContainer) {
|
|
|
1498
1498
|
* */
|
|
1499
1499
|
|
|
1500
1500
|
|
|
1501
|
-
function getLinkContent(
|
|
1501
|
+
function getLinkContent(_ref4) {
|
|
1502
|
+
var transaction = _ref4.transaction,
|
|
1503
|
+
closePreCheckoutModal = _ref4.closePreCheckoutModal,
|
|
1504
|
+
inlineInstanceId = _ref4.inlineInstanceId;
|
|
1502
1505
|
var wrapper = document.createElement('div');
|
|
1503
1506
|
wrapper.classList.add('modal-wrapper');
|
|
1504
1507
|
wrapper.innerHTML = wrapper.innerHTML + secureByPaystackWhite + secureByPaystackGrey;
|
|
@@ -1531,9 +1534,9 @@ function getLinkContent(transaction, closePreCheckoutModal) {
|
|
|
1531
1534
|
transaction: transaction,
|
|
1532
1535
|
token: linkToken
|
|
1533
1536
|
}).then(function (response) {
|
|
1534
|
-
getCheckoutIframe().contentWindow.postMessage({
|
|
1537
|
+
getCheckoutIframe(inlineInstanceId).contentWindow.postMessage({
|
|
1535
1538
|
type: 'link-success',
|
|
1536
|
-
data: response
|
|
1539
|
+
data: response.data
|
|
1537
1540
|
}, '*');
|
|
1538
1541
|
otpRetry.unmount();
|
|
1539
1542
|
loader.unmount();
|
|
@@ -1593,13 +1596,13 @@ function mountPreCheckoutModal(id, transaction, closePreCheckoutModal) {
|
|
|
1593
1596
|
content.classList.add('pre-checkout-modal__content');
|
|
1594
1597
|
modal.appendChild(content);
|
|
1595
1598
|
|
|
1596
|
-
var
|
|
1597
|
-
merchantLogo =
|
|
1598
|
-
merchantName =
|
|
1599
|
-
email =
|
|
1600
|
-
amount =
|
|
1601
|
-
currency =
|
|
1602
|
-
label =
|
|
1599
|
+
var _ref5 = transaction || {},
|
|
1600
|
+
merchantLogo = _ref5.merchant_logo,
|
|
1601
|
+
merchantName = _ref5.merchant_name,
|
|
1602
|
+
email = _ref5.email,
|
|
1603
|
+
amount = _ref5.amount,
|
|
1604
|
+
currency = _ref5.currency,
|
|
1605
|
+
label = _ref5.label;
|
|
1603
1606
|
|
|
1604
1607
|
var applePayPaymentInfo = document.createElement('div');
|
|
1605
1608
|
var formattedAmount = new Intl.NumberFormat('en', {
|
|
@@ -1613,7 +1616,11 @@ function mountPreCheckoutModal(id, transaction, closePreCheckoutModal) {
|
|
|
1613
1616
|
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(formattedAmount, "</span></div>\n </div>");
|
|
1614
1617
|
content.appendChild(applePayPaymentInfo);
|
|
1615
1618
|
content.innerHTML += applePayCloseButton;
|
|
1616
|
-
var wrapper = canPayWithLink(transaction) ? getLinkContent(
|
|
1619
|
+
var wrapper = canPayWithLink(transaction) ? getLinkContent({
|
|
1620
|
+
transaction: transaction,
|
|
1621
|
+
closePreCheckoutModal: closePreCheckoutModal,
|
|
1622
|
+
inlineInstanceId: id
|
|
1623
|
+
}) : getApplePayContent();
|
|
1617
1624
|
content.appendChild(wrapper);
|
|
1618
1625
|
var style = document.createElement('style');
|
|
1619
1626
|
style.textContent = preCheckoutModalCSS;
|
package/lib/inline.js
CHANGED
|
@@ -929,7 +929,7 @@ var OtpRetry = /*#__PURE__*/function () {
|
|
|
929
929
|
sendLinkOtp({
|
|
930
930
|
channels: channels || OTP_RESEND_COUNT_CONFIG[this.otpResendCount].channels,
|
|
931
931
|
email: this.transaction.email,
|
|
932
|
-
transaction: this.transaction
|
|
932
|
+
transaction: this.transaction
|
|
933
933
|
}).then(function (response) {
|
|
934
934
|
return _this.onSuccess(response.data.token);
|
|
935
935
|
}).catch(function () {// catching here so a unhandledrejection error is not thrown
|
|
@@ -1500,7 +1500,10 @@ function getLinkOtpHelp(linkContainer) {
|
|
|
1500
1500
|
* */
|
|
1501
1501
|
|
|
1502
1502
|
|
|
1503
|
-
function getLinkContent(
|
|
1503
|
+
function getLinkContent(_ref4) {
|
|
1504
|
+
var transaction = _ref4.transaction,
|
|
1505
|
+
closePreCheckoutModal = _ref4.closePreCheckoutModal,
|
|
1506
|
+
inlineInstanceId = _ref4.inlineInstanceId;
|
|
1504
1507
|
var wrapper = document.createElement('div');
|
|
1505
1508
|
wrapper.classList.add('modal-wrapper');
|
|
1506
1509
|
wrapper.innerHTML = wrapper.innerHTML + secureByPaystackWhite + secureByPaystackGrey;
|
|
@@ -1533,9 +1536,9 @@ function getLinkContent(transaction, closePreCheckoutModal) {
|
|
|
1533
1536
|
transaction: transaction,
|
|
1534
1537
|
token: linkToken
|
|
1535
1538
|
}).then(function (response) {
|
|
1536
|
-
getCheckoutIframe().contentWindow.postMessage({
|
|
1539
|
+
getCheckoutIframe(inlineInstanceId).contentWindow.postMessage({
|
|
1537
1540
|
type: 'link-success',
|
|
1538
|
-
data: response
|
|
1541
|
+
data: response.data
|
|
1539
1542
|
}, '*');
|
|
1540
1543
|
otpRetry.unmount();
|
|
1541
1544
|
loader.unmount();
|
|
@@ -1595,13 +1598,13 @@ function mountPreCheckoutModal(id, transaction, closePreCheckoutModal) {
|
|
|
1595
1598
|
content.classList.add('pre-checkout-modal__content');
|
|
1596
1599
|
modal.appendChild(content);
|
|
1597
1600
|
|
|
1598
|
-
var
|
|
1599
|
-
merchantLogo =
|
|
1600
|
-
merchantName =
|
|
1601
|
-
email =
|
|
1602
|
-
amount =
|
|
1603
|
-
currency =
|
|
1604
|
-
label =
|
|
1601
|
+
var _ref5 = transaction || {},
|
|
1602
|
+
merchantLogo = _ref5.merchant_logo,
|
|
1603
|
+
merchantName = _ref5.merchant_name,
|
|
1604
|
+
email = _ref5.email,
|
|
1605
|
+
amount = _ref5.amount,
|
|
1606
|
+
currency = _ref5.currency,
|
|
1607
|
+
label = _ref5.label;
|
|
1605
1608
|
|
|
1606
1609
|
var applePayPaymentInfo = document.createElement('div');
|
|
1607
1610
|
var formattedAmount = new Intl.NumberFormat('en', {
|
|
@@ -1615,7 +1618,11 @@ function mountPreCheckoutModal(id, transaction, closePreCheckoutModal) {
|
|
|
1615
1618
|
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(formattedAmount, "</span></div>\n </div>");
|
|
1616
1619
|
content.appendChild(applePayPaymentInfo);
|
|
1617
1620
|
content.innerHTML += applePayCloseButton;
|
|
1618
|
-
var wrapper = canPayWithLink(transaction) ? getLinkContent(
|
|
1621
|
+
var wrapper = canPayWithLink(transaction) ? getLinkContent({
|
|
1622
|
+
transaction: transaction,
|
|
1623
|
+
closePreCheckoutModal: closePreCheckoutModal,
|
|
1624
|
+
inlineInstanceId: id
|
|
1625
|
+
}) : getApplePayContent();
|
|
1619
1626
|
content.appendChild(wrapper);
|
|
1620
1627
|
var style = document.createElement('style');
|
|
1621
1628
|
style.textContent = preCheckoutModalCSS;
|