@paystack/inline-js 2.16.0-dev.1 → 2.16.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 CHANGED
@@ -208,7 +208,9 @@ var PaystackPop = (function () {
208
208
  // checkoutUrl: 'https://checkout-studio.paystack.com/',
209
209
  checkoutUrl: 'https://deploy-preview-120--checkout-ui-vue3.netlify.app',
210
210
  paymentBaseUrl: 'https://legacy-staging.paystack.co/',
211
- paystackApiUrl: 'https://studio-api.paystack.co/',
211
+ // paystackApiUrl: 'https://studio-api.paystack.co/',
212
+ paystackApiUrl: 'https://api.paystack.co/',
213
+ // testing a merchant issue
212
214
  siteUrl: 'https://beta.paystack.com',
213
215
  pusherKey: '1c7b262ee18455815893',
214
216
  pusherUrl: 'https://checkout-studio.paystack.com/static/vendor/pusher.min.js'
@@ -1671,50 +1673,45 @@ var PaystackPop = (function () {
1671
1673
  var transaction = resumableTransaction || new InlineTransaction(params);
1672
1674
  return new Promise(function (resolve, reject) {
1673
1675
  transaction.requestInline().then(function () {
1674
- // const shouldLoadPreCheckoutModal =
1675
- // response.channels.includes('apple_pay');
1676
+ var shouldLoadPreCheckoutModal = response.channels.includes('apple_pay');
1676
1677
  inlineInstance.newTransaction({
1677
1678
  inlineTransaction: transaction
1678
1679
  });
1679
- resolve(transaction); // if (!shouldLoadPreCheckoutModal) {
1680
- // inlineInstance.newTransaction({ inlineTransaction: transaction });
1681
- // resolve(transaction);
1682
- // } else {
1683
- // inlineInstance.preloadTransaction({
1684
- // inlineTransaction: transaction,
1685
- // });
1686
- // inlineInstance.preCheckoutModal = mountPreCheckoutModal(
1687
- // inlineInstance.id,
1688
- // response,
1689
- // );
1690
- // inlineInstance.paymentRequestContainer =
1691
- // getPreCheckoutModalPaymentRequestContainer(
1692
- // inlineInstance.preCheckoutModal,
1693
- // );
1694
- // mountPaymentRequestButtons(inlineInstance.paymentRequestContainer, {
1695
- // channels: response.channels,
1696
- // styles: {
1697
- // applePay: {
1698
- // width: '100%',
1699
- // type: 'pay',
1700
- // height: '42px',
1701
- // padding: '15px',
1702
- // borderRadius: '5px',
1703
- // },
1704
- // },
1705
- // })
1706
- // .then(() => {
1707
- // inlineInstance.registerPreCheckoutModalEventListeners();
1708
- // inlineInstance.registerPaymentRequestEventListeners();
1709
- // animatePreCheckoutModalIn(inlineInstance.preCheckoutModal);
1710
- // resolve(transaction);
1711
- // })
1712
- // .catch(() => {
1713
- // inlineInstance.closePreCheckoutModal();
1714
- // inlineInstance.animateCheckoutIn();
1715
- // resolve(transaction);
1716
- // });
1717
- // }
1680
+ resolve(transaction);
1681
+
1682
+ if (!shouldLoadPreCheckoutModal) {
1683
+ inlineInstance.newTransaction({
1684
+ inlineTransaction: transaction
1685
+ });
1686
+ resolve(transaction);
1687
+ } else {
1688
+ inlineInstance.preloadTransaction({
1689
+ inlineTransaction: transaction
1690
+ });
1691
+ inlineInstance.preCheckoutModal = mountPreCheckoutModal(inlineInstance.id, response);
1692
+ inlineInstance.paymentRequestContainer = getPreCheckoutModalPaymentRequestContainer(inlineInstance.preCheckoutModal);
1693
+ mountPaymentRequestButtons(inlineInstance.paymentRequestContainer, {
1694
+ channels: response.channels,
1695
+ styles: {
1696
+ applePay: {
1697
+ width: '100%',
1698
+ type: 'pay',
1699
+ height: '42px',
1700
+ padding: '15px',
1701
+ borderRadius: '5px'
1702
+ }
1703
+ }
1704
+ }).then(function () {
1705
+ inlineInstance.registerPreCheckoutModalEventListeners();
1706
+ inlineInstance.registerPaymentRequestEventListeners();
1707
+ animatePreCheckoutModalIn(inlineInstance.preCheckoutModal);
1708
+ resolve(transaction);
1709
+ }).catch(function () {
1710
+ inlineInstance.closePreCheckoutModal();
1711
+ inlineInstance.animateCheckoutIn();
1712
+ resolve(transaction);
1713
+ });
1714
+ }
1718
1715
  }).catch(function (error) {
1719
1716
  transaction.onSetupError({
1720
1717
  status: false,
@@ -1947,6 +1944,7 @@ var PaystackPop = (function () {
1947
1944
  var _this4 = this;
1948
1945
 
1949
1946
  var applePayButton = getApplePayButton(this.paymentRequestContainer);
1947
+ console.log('apple pay button', JSON.stringify(applePayButton));
1950
1948
 
1951
1949
  applePayButton.onclick = function () {
1952
1950
  return _this4.startApplePay();
@@ -1956,14 +1954,18 @@ var PaystackPop = (function () {
1956
1954
  key: "registerPaymentRequestEventListeners",
1957
1955
  value: function registerPaymentRequestEventListeners() {
1958
1956
  var transaction = this.activeTransaction();
1957
+ console.log('transaction', transaction);
1959
1958
 
1960
1959
  if (transaction) {
1961
1960
  if (canUseApplePay(transaction.response.channels)) {
1962
1961
  this.registerApplePayEventListener();
1962
+ console.log('registered payment request event listeners');
1963
1963
  } else {
1964
1964
  removeAllChildNodes(this.paymentRequestContainer);
1965
+ console.log('removed cn');
1965
1966
  }
1966
1967
  } else {
1968
+ console.log('removed cn');
1967
1969
  removeAllChildNodes(this.paymentRequestContainer);
1968
1970
  }
1969
1971
  }
@@ -1974,6 +1976,7 @@ var PaystackPop = (function () {
1974
1976
 
1975
1977
  var paymentMethod = 'apple pay';
1976
1978
  var transaction = this.activeTransaction();
1979
+ console.log('starting apple pay with transaction', transaction);
1977
1980
 
1978
1981
  if (transaction) {
1979
1982
  var paymentAttemptAnalyticsPayload = {
@@ -2202,18 +2205,19 @@ var PaystackPop = (function () {
2202
2205
  var eventData = event.data || event.message;
2203
2206
 
2204
2207
  if (eventData && (typeof eventData === 'string' || eventData instanceof String)) {
2205
- var response = parseResponse(eventData);
2206
- var oldCheckoutCloseResponse = response && response.action === 'PaystackClose';
2208
+ var _response = parseResponse(eventData);
2209
+
2210
+ var oldCheckoutCloseResponse = _response && _response.action === 'PaystackClose';
2207
2211
 
2208
2212
  if (oldCheckoutCloseResponse) {
2209
- var chargeResponse = response.data;
2213
+ var chargeResponse = _response.data;
2210
2214
 
2211
2215
  if (chargeResponse) {
2212
2216
  activeTransaction.onSuccess(eventData);
2213
2217
  }
2214
2218
  }
2215
2219
 
2216
- if (response.action === 'PaystackTLSClose') {
2220
+ if (_response.action === 'PaystackTLSClose') {
2217
2221
  activeTransaction.cancel();
2218
2222
  }
2219
2223
  }
package/es/inline.js CHANGED
@@ -205,7 +205,9 @@ var stagingConfig = _objectSpread2(_objectSpread2({}, baseConfig), {}, {
205
205
  // checkoutUrl: 'https://checkout-studio.paystack.com/',
206
206
  checkoutUrl: 'https://deploy-preview-120--checkout-ui-vue3.netlify.app',
207
207
  paymentBaseUrl: 'https://legacy-staging.paystack.co/',
208
- paystackApiUrl: 'https://studio-api.paystack.co/',
208
+ // paystackApiUrl: 'https://studio-api.paystack.co/',
209
+ paystackApiUrl: 'https://api.paystack.co/',
210
+ // testing a merchant issue
209
211
  siteUrl: 'https://beta.paystack.com',
210
212
  pusherKey: '1c7b262ee18455815893',
211
213
  pusherUrl: 'https://checkout-studio.paystack.com/static/vendor/pusher.min.js'
@@ -1668,50 +1670,45 @@ var Inline = /*#__PURE__*/function () {
1668
1670
  var transaction = resumableTransaction || new InlineTransaction(params);
1669
1671
  return new Promise(function (resolve, reject) {
1670
1672
  transaction.requestInline().then(function () {
1671
- // const shouldLoadPreCheckoutModal =
1672
- // response.channels.includes('apple_pay');
1673
+ var shouldLoadPreCheckoutModal = response.channels.includes('apple_pay');
1673
1674
  inlineInstance.newTransaction({
1674
1675
  inlineTransaction: transaction
1675
1676
  });
1676
- resolve(transaction); // if (!shouldLoadPreCheckoutModal) {
1677
- // inlineInstance.newTransaction({ inlineTransaction: transaction });
1678
- // resolve(transaction);
1679
- // } else {
1680
- // inlineInstance.preloadTransaction({
1681
- // inlineTransaction: transaction,
1682
- // });
1683
- // inlineInstance.preCheckoutModal = mountPreCheckoutModal(
1684
- // inlineInstance.id,
1685
- // response,
1686
- // );
1687
- // inlineInstance.paymentRequestContainer =
1688
- // getPreCheckoutModalPaymentRequestContainer(
1689
- // inlineInstance.preCheckoutModal,
1690
- // );
1691
- // mountPaymentRequestButtons(inlineInstance.paymentRequestContainer, {
1692
- // channels: response.channels,
1693
- // styles: {
1694
- // applePay: {
1695
- // width: '100%',
1696
- // type: 'pay',
1697
- // height: '42px',
1698
- // padding: '15px',
1699
- // borderRadius: '5px',
1700
- // },
1701
- // },
1702
- // })
1703
- // .then(() => {
1704
- // inlineInstance.registerPreCheckoutModalEventListeners();
1705
- // inlineInstance.registerPaymentRequestEventListeners();
1706
- // animatePreCheckoutModalIn(inlineInstance.preCheckoutModal);
1707
- // resolve(transaction);
1708
- // })
1709
- // .catch(() => {
1710
- // inlineInstance.closePreCheckoutModal();
1711
- // inlineInstance.animateCheckoutIn();
1712
- // resolve(transaction);
1713
- // });
1714
- // }
1677
+ resolve(transaction);
1678
+
1679
+ if (!shouldLoadPreCheckoutModal) {
1680
+ inlineInstance.newTransaction({
1681
+ inlineTransaction: transaction
1682
+ });
1683
+ resolve(transaction);
1684
+ } else {
1685
+ inlineInstance.preloadTransaction({
1686
+ inlineTransaction: transaction
1687
+ });
1688
+ inlineInstance.preCheckoutModal = mountPreCheckoutModal(inlineInstance.id, response);
1689
+ inlineInstance.paymentRequestContainer = getPreCheckoutModalPaymentRequestContainer(inlineInstance.preCheckoutModal);
1690
+ mountPaymentRequestButtons(inlineInstance.paymentRequestContainer, {
1691
+ channels: response.channels,
1692
+ styles: {
1693
+ applePay: {
1694
+ width: '100%',
1695
+ type: 'pay',
1696
+ height: '42px',
1697
+ padding: '15px',
1698
+ borderRadius: '5px'
1699
+ }
1700
+ }
1701
+ }).then(function () {
1702
+ inlineInstance.registerPreCheckoutModalEventListeners();
1703
+ inlineInstance.registerPaymentRequestEventListeners();
1704
+ animatePreCheckoutModalIn(inlineInstance.preCheckoutModal);
1705
+ resolve(transaction);
1706
+ }).catch(function () {
1707
+ inlineInstance.closePreCheckoutModal();
1708
+ inlineInstance.animateCheckoutIn();
1709
+ resolve(transaction);
1710
+ });
1711
+ }
1715
1712
  }).catch(function (error) {
1716
1713
  transaction.onSetupError({
1717
1714
  status: false,
@@ -1944,6 +1941,7 @@ var Inline = /*#__PURE__*/function () {
1944
1941
  var _this4 = this;
1945
1942
 
1946
1943
  var applePayButton = getApplePayButton(this.paymentRequestContainer);
1944
+ console.log('apple pay button', JSON.stringify(applePayButton));
1947
1945
 
1948
1946
  applePayButton.onclick = function () {
1949
1947
  return _this4.startApplePay();
@@ -1953,14 +1951,18 @@ var Inline = /*#__PURE__*/function () {
1953
1951
  key: "registerPaymentRequestEventListeners",
1954
1952
  value: function registerPaymentRequestEventListeners() {
1955
1953
  var transaction = this.activeTransaction();
1954
+ console.log('transaction', transaction);
1956
1955
 
1957
1956
  if (transaction) {
1958
1957
  if (canUseApplePay(transaction.response.channels)) {
1959
1958
  this.registerApplePayEventListener();
1959
+ console.log('registered payment request event listeners');
1960
1960
  } else {
1961
1961
  removeAllChildNodes(this.paymentRequestContainer);
1962
+ console.log('removed cn');
1962
1963
  }
1963
1964
  } else {
1965
+ console.log('removed cn');
1964
1966
  removeAllChildNodes(this.paymentRequestContainer);
1965
1967
  }
1966
1968
  }
@@ -1971,6 +1973,7 @@ var Inline = /*#__PURE__*/function () {
1971
1973
 
1972
1974
  var paymentMethod = 'apple pay';
1973
1975
  var transaction = this.activeTransaction();
1976
+ console.log('starting apple pay with transaction', transaction);
1974
1977
 
1975
1978
  if (transaction) {
1976
1979
  var paymentAttemptAnalyticsPayload = {
@@ -2199,18 +2202,19 @@ var Inline = /*#__PURE__*/function () {
2199
2202
  var eventData = event.data || event.message;
2200
2203
 
2201
2204
  if (eventData && (typeof eventData === 'string' || eventData instanceof String)) {
2202
- var response = parseResponse(eventData);
2203
- var oldCheckoutCloseResponse = response && response.action === 'PaystackClose';
2205
+ var _response = parseResponse(eventData);
2206
+
2207
+ var oldCheckoutCloseResponse = _response && _response.action === 'PaystackClose';
2204
2208
 
2205
2209
  if (oldCheckoutCloseResponse) {
2206
- var chargeResponse = response.data;
2210
+ var chargeResponse = _response.data;
2207
2211
 
2208
2212
  if (chargeResponse) {
2209
2213
  activeTransaction.onSuccess(eventData);
2210
2214
  }
2211
2215
  }
2212
2216
 
2213
- if (response.action === 'PaystackTLSClose') {
2217
+ if (_response.action === 'PaystackTLSClose') {
2214
2218
  activeTransaction.cancel();
2215
2219
  }
2216
2220
  }
package/lib/inline.js CHANGED
@@ -207,7 +207,9 @@ var stagingConfig = _objectSpread2(_objectSpread2({}, baseConfig), {}, {
207
207
  // checkoutUrl: 'https://checkout-studio.paystack.com/',
208
208
  checkoutUrl: 'https://deploy-preview-120--checkout-ui-vue3.netlify.app',
209
209
  paymentBaseUrl: 'https://legacy-staging.paystack.co/',
210
- paystackApiUrl: 'https://studio-api.paystack.co/',
210
+ // paystackApiUrl: 'https://studio-api.paystack.co/',
211
+ paystackApiUrl: 'https://api.paystack.co/',
212
+ // testing a merchant issue
211
213
  siteUrl: 'https://beta.paystack.com',
212
214
  pusherKey: '1c7b262ee18455815893',
213
215
  pusherUrl: 'https://checkout-studio.paystack.com/static/vendor/pusher.min.js'
@@ -1670,50 +1672,45 @@ var Inline = /*#__PURE__*/function () {
1670
1672
  var transaction = resumableTransaction || new InlineTransaction(params);
1671
1673
  return new Promise(function (resolve, reject) {
1672
1674
  transaction.requestInline().then(function () {
1673
- // const shouldLoadPreCheckoutModal =
1674
- // response.channels.includes('apple_pay');
1675
+ var shouldLoadPreCheckoutModal = response.channels.includes('apple_pay');
1675
1676
  inlineInstance.newTransaction({
1676
1677
  inlineTransaction: transaction
1677
1678
  });
1678
- resolve(transaction); // if (!shouldLoadPreCheckoutModal) {
1679
- // inlineInstance.newTransaction({ inlineTransaction: transaction });
1680
- // resolve(transaction);
1681
- // } else {
1682
- // inlineInstance.preloadTransaction({
1683
- // inlineTransaction: transaction,
1684
- // });
1685
- // inlineInstance.preCheckoutModal = mountPreCheckoutModal(
1686
- // inlineInstance.id,
1687
- // response,
1688
- // );
1689
- // inlineInstance.paymentRequestContainer =
1690
- // getPreCheckoutModalPaymentRequestContainer(
1691
- // inlineInstance.preCheckoutModal,
1692
- // );
1693
- // mountPaymentRequestButtons(inlineInstance.paymentRequestContainer, {
1694
- // channels: response.channels,
1695
- // styles: {
1696
- // applePay: {
1697
- // width: '100%',
1698
- // type: 'pay',
1699
- // height: '42px',
1700
- // padding: '15px',
1701
- // borderRadius: '5px',
1702
- // },
1703
- // },
1704
- // })
1705
- // .then(() => {
1706
- // inlineInstance.registerPreCheckoutModalEventListeners();
1707
- // inlineInstance.registerPaymentRequestEventListeners();
1708
- // animatePreCheckoutModalIn(inlineInstance.preCheckoutModal);
1709
- // resolve(transaction);
1710
- // })
1711
- // .catch(() => {
1712
- // inlineInstance.closePreCheckoutModal();
1713
- // inlineInstance.animateCheckoutIn();
1714
- // resolve(transaction);
1715
- // });
1716
- // }
1679
+ resolve(transaction);
1680
+
1681
+ if (!shouldLoadPreCheckoutModal) {
1682
+ inlineInstance.newTransaction({
1683
+ inlineTransaction: transaction
1684
+ });
1685
+ resolve(transaction);
1686
+ } else {
1687
+ inlineInstance.preloadTransaction({
1688
+ inlineTransaction: transaction
1689
+ });
1690
+ inlineInstance.preCheckoutModal = mountPreCheckoutModal(inlineInstance.id, response);
1691
+ inlineInstance.paymentRequestContainer = getPreCheckoutModalPaymentRequestContainer(inlineInstance.preCheckoutModal);
1692
+ mountPaymentRequestButtons(inlineInstance.paymentRequestContainer, {
1693
+ channels: response.channels,
1694
+ styles: {
1695
+ applePay: {
1696
+ width: '100%',
1697
+ type: 'pay',
1698
+ height: '42px',
1699
+ padding: '15px',
1700
+ borderRadius: '5px'
1701
+ }
1702
+ }
1703
+ }).then(function () {
1704
+ inlineInstance.registerPreCheckoutModalEventListeners();
1705
+ inlineInstance.registerPaymentRequestEventListeners();
1706
+ animatePreCheckoutModalIn(inlineInstance.preCheckoutModal);
1707
+ resolve(transaction);
1708
+ }).catch(function () {
1709
+ inlineInstance.closePreCheckoutModal();
1710
+ inlineInstance.animateCheckoutIn();
1711
+ resolve(transaction);
1712
+ });
1713
+ }
1717
1714
  }).catch(function (error) {
1718
1715
  transaction.onSetupError({
1719
1716
  status: false,
@@ -1946,6 +1943,7 @@ var Inline = /*#__PURE__*/function () {
1946
1943
  var _this4 = this;
1947
1944
 
1948
1945
  var applePayButton = getApplePayButton(this.paymentRequestContainer);
1946
+ console.log('apple pay button', JSON.stringify(applePayButton));
1949
1947
 
1950
1948
  applePayButton.onclick = function () {
1951
1949
  return _this4.startApplePay();
@@ -1955,14 +1953,18 @@ var Inline = /*#__PURE__*/function () {
1955
1953
  key: "registerPaymentRequestEventListeners",
1956
1954
  value: function registerPaymentRequestEventListeners() {
1957
1955
  var transaction = this.activeTransaction();
1956
+ console.log('transaction', transaction);
1958
1957
 
1959
1958
  if (transaction) {
1960
1959
  if (canUseApplePay(transaction.response.channels)) {
1961
1960
  this.registerApplePayEventListener();
1961
+ console.log('registered payment request event listeners');
1962
1962
  } else {
1963
1963
  removeAllChildNodes(this.paymentRequestContainer);
1964
+ console.log('removed cn');
1964
1965
  }
1965
1966
  } else {
1967
+ console.log('removed cn');
1966
1968
  removeAllChildNodes(this.paymentRequestContainer);
1967
1969
  }
1968
1970
  }
@@ -1973,6 +1975,7 @@ var Inline = /*#__PURE__*/function () {
1973
1975
 
1974
1976
  var paymentMethod = 'apple pay';
1975
1977
  var transaction = this.activeTransaction();
1978
+ console.log('starting apple pay with transaction', transaction);
1976
1979
 
1977
1980
  if (transaction) {
1978
1981
  var paymentAttemptAnalyticsPayload = {
@@ -2201,18 +2204,19 @@ var Inline = /*#__PURE__*/function () {
2201
2204
  var eventData = event.data || event.message;
2202
2205
 
2203
2206
  if (eventData && (typeof eventData === 'string' || eventData instanceof String)) {
2204
- var response = parseResponse(eventData);
2205
- var oldCheckoutCloseResponse = response && response.action === 'PaystackClose';
2207
+ var _response = parseResponse(eventData);
2208
+
2209
+ var oldCheckoutCloseResponse = _response && _response.action === 'PaystackClose';
2206
2210
 
2207
2211
  if (oldCheckoutCloseResponse) {
2208
- var chargeResponse = response.data;
2212
+ var chargeResponse = _response.data;
2209
2213
 
2210
2214
  if (chargeResponse) {
2211
2215
  activeTransaction.onSuccess(eventData);
2212
2216
  }
2213
2217
  }
2214
2218
 
2215
- if (response.action === 'PaystackTLSClose') {
2219
+ if (_response.action === 'PaystackTLSClose') {
2216
2220
  activeTransaction.cancel();
2217
2221
  }
2218
2222
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paystack/inline-js",
3
- "version": "2.16.0-dev.1",
3
+ "version": "2.16.0-dev.2",
4
4
  "description": "Client-side library to load the Paystack checkout form",
5
5
  "main": "lib/inline.js",
6
6
  "module": "es/inline.js",