@monei-js/components 1.5.1 → 1.6.0

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.
@@ -816,7 +816,7 @@ var transformStyle = function transformStyle(style) {
816
816
  return result;
817
817
  }, {});
818
818
  };
819
- var loadScript = function loadScript(src, dataset) {
819
+ var loadScript = function loadScript(src, nonce, dataset) {
820
820
  return new Promise(function (resolve, reject) {
821
821
  if (Array.from(document.scripts).findIndex(function (s) {
822
822
  return s.src === src;
@@ -835,6 +835,10 @@ var loadScript = function loadScript(src, dataset) {
835
835
  return reject(error);
836
836
  };
837
837
 
838
+ if (nonce) {
839
+ script.setAttribute('nonce', nonce);
840
+ }
841
+
838
842
  if (dataset) {
839
843
  Object.keys(dataset).forEach(function (key) {
840
844
  if (dataset[key]) {
@@ -896,7 +900,11 @@ var getLanguage = function getLanguage() {
896
900
  lang = localStorage.getItem('i18nextLng');
897
901
  } catch (error) {}
898
902
 
899
- return lang || '';
903
+ if (lang) {
904
+ return lang.split('-')[0];
905
+ }
906
+
907
+ return '';
900
908
  };
901
909
 
902
910
  var getClientEnv = function getClientEnv() {
@@ -984,7 +992,7 @@ var globalConfig = {
984
992
  };
985
993
  var stageConfig = {
986
994
  local: {
987
- paymentPageUrl: "http://192.168.18.3:8080/",
995
+ paymentPageUrl: "http://localhost:8080/",
988
996
  posPaymentPageUrl: "http://192.168.18.3:8080/",
989
997
  cardInputUrl: "http://192.168.18.3:3001/" + version + "/inner-card-input/",
990
998
  paymentModalUrl: "http://192.168.18.3:3002/" + version + "/inner-payment-modal/",
@@ -992,7 +1000,7 @@ var stageConfig = {
992
1000
  bizumUrl: "http://192.168.18.3:3004/" + version + "/inner-bizum/",
993
1001
  bizumButtonUrl: "http://192.168.18.3:3005/" + version + "/inner-bizum-button/",
994
1002
  googlePayUrl: "http://192.168.18.3:3006/" + version + "/inner-google-pay/",
995
- paymentRequestUrl: "https://monei-payment-request.eu.ngrok.io/" + version + "/inner-payment-request/",
1003
+ paymentRequestUrl: "https://monei-local.ngrok.io/" + version + "/inner-payment-request/",
996
1004
  click2PayUrl: "http://192.168.18.3:3008/inner-click2pay/",
997
1005
  click2PayButtonUrl: "http://192.168.18.3:3009/inner-click2pay-button/",
998
1006
  cofidisUrl: "http://192.168.18.3:3010/" + version + "/inner-cofidis/",
@@ -1001,8 +1009,8 @@ var stageConfig = {
1001
1009
  cofidisLoanUrl: "http://192.168.18.3:3013/" + version + "/inner-cofidis-loan/",
1002
1010
  cofidisLoanButtonUrl: "http://192.168.18.3:3014/" + version + "/inner-cofidis-loan-button/",
1003
1011
  cofidisLoanWidgetUrl: "http://192.168.18.3:3015/" + version + "/inner-cofidis-loan-widget/",
1004
- apiUrl: 'https://api.microapps-staging.com/v1',
1005
- secureDomain: 'https://secure.microapps-staging.com'
1012
+ apiUrl: 'https://api.monei.com/v1',
1013
+ secureDomain: 'https://secure.monei.com'
1006
1014
  },
1007
1015
  dev: {
1008
1016
  apiUrl: 'https://api.microapps-staging.com/v1',
@@ -14217,6 +14225,14 @@ var options = {
14217
14225
  type: zoid.PROP_TYPE.OBJECT,
14218
14226
  alias: 'innerStyle',
14219
14227
  required: false
14228
+ },
14229
+ __getConfig: {
14230
+ type: zoid.PROP_TYPE.FUNCTION,
14231
+ required: false,
14232
+ value: function value(_ref2) {
14233
+ var props = _ref2.props;
14234
+ return getPaymentMethods.bind(null, props);
14235
+ }
14220
14236
  }
14221
14237
  },
14222
14238
  validate: validateComponentProps,
@@ -14237,9 +14253,9 @@ var options = {
14237
14253
 
14238
14254
  return containerTemplate(params);
14239
14255
  },
14240
- prerenderTemplate: function prerenderTemplate(_ref2) {
14241
- var doc = _ref2.doc,
14242
- props = _ref2.props;
14256
+ prerenderTemplate: function prerenderTemplate(_ref3) {
14257
+ var doc = _ref3.doc,
14258
+ props = _ref3.props;
14243
14259
  var html = doc.createElement('html');
14244
14260
  var body = doc.createElement('body');
14245
14261
  body.style.margin = '0';
@@ -14307,6 +14323,15 @@ var options$1 = {
14307
14323
  type: zoid.PROP_TYPE.OBJECT,
14308
14324
  required: false
14309
14325
  },
14326
+ allowedPaymentMethods: {
14327
+ type: zoid.PROP_TYPE.ARRAY,
14328
+ required: false
14329
+ },
14330
+ customDomain: {
14331
+ type: zoid.PROP_TYPE.STRING,
14332
+ "default": config.secureDomain,
14333
+ required: false
14334
+ },
14310
14335
  billingDetails: {
14311
14336
  type: zoid.PROP_TYPE.OBJECT,
14312
14337
  required: false
@@ -14429,7 +14454,7 @@ var onLoadPaypal = /*#__PURE__*/function () {
14429
14454
  switch (_context2.prev = _context2.next) {
14430
14455
  case 0:
14431
14456
  _context2.next = 2;
14432
- return loadScript(src, {
14457
+ return loadScript(src, props.cspNonce, {
14433
14458
  namespace: namespace,
14434
14459
  cspNonce: props.cspNonce
14435
14460
  });
@@ -14716,6 +14741,10 @@ var options$3 = {
14716
14741
  type: zoid.PROP_TYPE.STRING,
14717
14742
  required: false
14718
14743
  },
14744
+ phoneNumber: {
14745
+ type: zoid.PROP_TYPE.STRING,
14746
+ required: false
14747
+ },
14719
14748
  onError: {
14720
14749
  type: zoid.PROP_TYPE.FUNCTION,
14721
14750
  required: false
@@ -14787,6 +14816,10 @@ var options$4 = {
14787
14816
  type: zoid.PROP_TYPE.STRING,
14788
14817
  required: false
14789
14818
  },
14819
+ phoneNumber: {
14820
+ type: zoid.PROP_TYPE.STRING,
14821
+ required: false
14822
+ },
14790
14823
  onError: {
14791
14824
  type: zoid.PROP_TYPE.FUNCTION,
14792
14825
  required: false
@@ -14826,9 +14859,10 @@ var options$4 = {
14826
14859
  return function (_ref3) {
14827
14860
  var amount = _ref3.amount,
14828
14861
  currency = _ref3.currency;
14829
- var bizumModal = new BizumModal(_extends({}, props, {
14862
+ var bizumModal = new BizumModal(_extends({
14830
14863
  amount: amount,
14831
- currency: currency,
14864
+ currency: currency
14865
+ }, props, {
14832
14866
  onClose: function onClose() {
14833
14867
  window.onpopstate = null;
14834
14868
  document.body.style.overflow = '';
@@ -15752,12 +15786,28 @@ var NextActionType;
15752
15786
  (function (NextActionType) {
15753
15787
  NextActionType["CONFIRM"] = "CONFIRM";
15754
15788
  NextActionType["FRICTIONLESS_CHALLENGE"] = "FRICTIONLESS_CHALLENGE";
15789
+ NextActionType["BIZUM_CHALLENGE"] = "BIZUM_CHALLENGE";
15755
15790
  NextActionType["CHALLENGE"] = "CHALLENGE";
15756
15791
  NextActionType["COMPLETE"] = "COMPLETE";
15757
15792
  })(NextActionType || (NextActionType = {}));
15758
15793
 
15794
+ var CardBrand;
15795
+
15796
+ (function (CardBrand) {
15797
+ CardBrand["Visa"] = "visa";
15798
+ CardBrand["Mastercard"] = "mastercard";
15799
+ CardBrand["Amex"] = "amex";
15800
+ CardBrand["Discover"] = "discover";
15801
+ CardBrand["Diners"] = "diners";
15802
+ CardBrand["JCB"] = "jcb";
15803
+ CardBrand["Maestro"] = "maestro";
15804
+ CardBrand["UnionPay"] = "unionpay";
15805
+ CardBrand["Elo"] = "elo";
15806
+ CardBrand["Hipercard"] = "hipercard";
15807
+ })(CardBrand || (CardBrand = {}));
15808
+
15759
15809
  var api = _api;
15760
15810
  var utils = _utils;
15761
15811
 
15762
- export { Bizum, BizumModal, CardInput, Cofidis, CofidisLoan, CofidisLoanModal, CofidisLoanWidget, CofidisModal, CofidisPay, CofidisPayModal, CofidisPayWidget, CofidisWidget, GooglePay, NextActionType, PayPal, PaymentModal, PaymentRequest, api, config, confirmPayment$1 as confirmPayment, createToken$1 as createToken, utils };
15812
+ export { Bizum, BizumModal, CardBrand, CardInput, Cofidis, CofidisLoan, CofidisLoanModal, CofidisLoanWidget, CofidisModal, CofidisPay, CofidisPayModal, CofidisPayWidget, CofidisWidget, GooglePay, NextActionType, PayPal, PaymentModal, PaymentRequest, api, config, confirmPayment$1 as confirmPayment, createToken$1 as createToken, utils };
15763
15813
  //# sourceMappingURL=components.esm.js.map