@paystack/inline-js 2.27.0-dev.4 → 2.27.0-dev.5

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
@@ -946,6 +946,16 @@ var PaystackPop = (function () {
946
946
  };
947
947
 
948
948
  var _excluded$2 = ["height", "width", "borderRadius", "buttonRadius"];
949
+
950
+ // Outside production, checkout calls the legacy API on a VPN-only host, so the
951
+ // checkout frame needs Local Network Access delegated from the merchant page.
952
+ function getCheckoutIframeAllow() {
953
+ var features = ['payment', 'clipboard-read', 'clipboard-write'];
954
+ if (config.environment !== ENVIRONMENT.PRODUCTION) {
955
+ features.push('local-network-access');
956
+ }
957
+ return features.join('; ');
958
+ }
949
959
  function createIframe(id) {
950
960
  var iframe = document.createElement('iframe');
951
961
  iframe.setAttribute('frameBorder', '0');
@@ -962,7 +972,7 @@ var PaystackPop = (function () {
962
972
  iframe.style.cssText = checkoutCSS;
963
973
  iframe.style.colorScheme = 'light';
964
974
  iframe.setAttribute('allowpaymentrequest', 'true');
965
- iframe.setAttribute('allow', 'payment; clipboard-read; clipboard-write');
975
+ iframe.setAttribute('allow', getCheckoutIframeAllow());
966
976
  document.body.appendChild(iframe);
967
977
  return iframe;
968
978
  }
@@ -984,7 +994,7 @@ var PaystackPop = (function () {
984
994
  iframe.id = id;
985
995
  iframe.name = id;
986
996
  iframe.setAttribute('allowpaymentrequest', 'true');
987
- iframe.setAttribute('allow', 'payment; clipboard-read; clipboard-write');
997
+ iframe.setAttribute('allow', getCheckoutIframeAllow());
988
998
  return iframe;
989
999
  }
990
1000
  function getApplePayButton(container) {
package/es/inline.js CHANGED
@@ -943,6 +943,16 @@ var loadGooglePay = function loadGooglePay(transaction) {
943
943
  };
944
944
 
945
945
  var _excluded$2 = ["height", "width", "borderRadius", "buttonRadius"];
946
+
947
+ // Outside production, checkout calls the legacy API on a VPN-only host, so the
948
+ // checkout frame needs Local Network Access delegated from the merchant page.
949
+ function getCheckoutIframeAllow() {
950
+ var features = ['payment', 'clipboard-read', 'clipboard-write'];
951
+ if (config.environment !== ENVIRONMENT.PRODUCTION) {
952
+ features.push('local-network-access');
953
+ }
954
+ return features.join('; ');
955
+ }
946
956
  function createIframe(id) {
947
957
  var iframe = document.createElement('iframe');
948
958
  iframe.setAttribute('frameBorder', '0');
@@ -959,7 +969,7 @@ function mountCheckoutIframe(id) {
959
969
  iframe.style.cssText = checkoutCSS;
960
970
  iframe.style.colorScheme = 'light';
961
971
  iframe.setAttribute('allowpaymentrequest', 'true');
962
- iframe.setAttribute('allow', 'payment; clipboard-read; clipboard-write');
972
+ iframe.setAttribute('allow', getCheckoutIframeAllow());
963
973
  document.body.appendChild(iframe);
964
974
  return iframe;
965
975
  }
@@ -981,7 +991,7 @@ function mountEmbedCheckoutIframe(id, src) {
981
991
  iframe.id = id;
982
992
  iframe.name = id;
983
993
  iframe.setAttribute('allowpaymentrequest', 'true');
984
- iframe.setAttribute('allow', 'payment; clipboard-read; clipboard-write');
994
+ iframe.setAttribute('allow', getCheckoutIframeAllow());
985
995
  return iframe;
986
996
  }
987
997
  function getApplePayButton(container) {
package/lib/inline.js CHANGED
@@ -945,6 +945,16 @@ var loadGooglePay = function loadGooglePay(transaction) {
945
945
  };
946
946
 
947
947
  var _excluded$2 = ["height", "width", "borderRadius", "buttonRadius"];
948
+
949
+ // Outside production, checkout calls the legacy API on a VPN-only host, so the
950
+ // checkout frame needs Local Network Access delegated from the merchant page.
951
+ function getCheckoutIframeAllow() {
952
+ var features = ['payment', 'clipboard-read', 'clipboard-write'];
953
+ if (config.environment !== ENVIRONMENT.PRODUCTION) {
954
+ features.push('local-network-access');
955
+ }
956
+ return features.join('; ');
957
+ }
948
958
  function createIframe(id) {
949
959
  var iframe = document.createElement('iframe');
950
960
  iframe.setAttribute('frameBorder', '0');
@@ -961,7 +971,7 @@ function mountCheckoutIframe(id) {
961
971
  iframe.style.cssText = checkoutCSS;
962
972
  iframe.style.colorScheme = 'light';
963
973
  iframe.setAttribute('allowpaymentrequest', 'true');
964
- iframe.setAttribute('allow', 'payment; clipboard-read; clipboard-write');
974
+ iframe.setAttribute('allow', getCheckoutIframeAllow());
965
975
  document.body.appendChild(iframe);
966
976
  return iframe;
967
977
  }
@@ -983,7 +993,7 @@ function mountEmbedCheckoutIframe(id, src) {
983
993
  iframe.id = id;
984
994
  iframe.name = id;
985
995
  iframe.setAttribute('allowpaymentrequest', 'true');
986
- iframe.setAttribute('allow', 'payment; clipboard-read; clipboard-write');
996
+ iframe.setAttribute('allow', getCheckoutIframeAllow());
987
997
  return iframe;
988
998
  }
989
999
  function getApplePayButton(container) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paystack/inline-js",
3
- "version": "2.27.0-dev.4",
3
+ "version": "2.27.0-dev.5",
4
4
  "description": "Client-side library to load the Paystack checkout form",
5
5
  "packageManager": "pnpm@10.33.4+sha512.1c67b3b359b2d408119ba1ed289f34b8fc3c6873412bec6fd264fbdc82489e510fcbecb9ce9d22dae7f3b76269d8441046014bdca53b9979cd7a561ad631b800",
6
6
  "main": "lib/inline.js",