@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.
@@ -2,6 +2,7 @@ export interface BizumProps {
2
2
  accountId?: string;
3
3
  sessionId?: string;
4
4
  paymentId?: string;
5
+ phoneNumber?: string;
5
6
  amount?: number;
6
7
  currency?: string;
7
8
  fullscreen?: boolean;
@@ -42,6 +42,7 @@ export declare type CardInputProps = {
42
42
  yearOutOfRange?: string;
43
43
  dateOutOfRange?: string;
44
44
  invalidExpiryDate?: string;
45
+ invalidCardType?: string;
45
46
  emptyCVC?: string;
46
47
  invalidCVC?: string;
47
48
  };
@@ -820,7 +820,7 @@ var transformStyle = function transformStyle(style) {
820
820
  return result;
821
821
  }, {});
822
822
  };
823
- var loadScript = function loadScript(src, dataset) {
823
+ var loadScript = function loadScript(src, nonce, dataset) {
824
824
  return new Promise(function (resolve, reject) {
825
825
  if (Array.from(document.scripts).findIndex(function (s) {
826
826
  return s.src === src;
@@ -839,6 +839,10 @@ var loadScript = function loadScript(src, dataset) {
839
839
  return reject(error);
840
840
  };
841
841
 
842
+ if (nonce) {
843
+ script.setAttribute('nonce', nonce);
844
+ }
845
+
842
846
  if (dataset) {
843
847
  Object.keys(dataset).forEach(function (key) {
844
848
  if (dataset[key]) {
@@ -900,7 +904,11 @@ var getLanguage = function getLanguage() {
900
904
  lang = localStorage.getItem('i18nextLng');
901
905
  } catch (error) {}
902
906
 
903
- return lang || '';
907
+ if (lang) {
908
+ return lang.split('-')[0];
909
+ }
910
+
911
+ return '';
904
912
  };
905
913
 
906
914
  var getClientEnv = function getClientEnv() {
@@ -988,7 +996,7 @@ var globalConfig = {
988
996
  };
989
997
  var stageConfig = {
990
998
  local: {
991
- paymentPageUrl: "http://192.168.18.3:8080/",
999
+ paymentPageUrl: "http://localhost:8080/",
992
1000
  posPaymentPageUrl: "http://192.168.18.3:8080/",
993
1001
  cardInputUrl: "http://192.168.18.3:3001/" + version + "/inner-card-input/",
994
1002
  paymentModalUrl: "http://192.168.18.3:3002/" + version + "/inner-payment-modal/",
@@ -996,7 +1004,7 @@ var stageConfig = {
996
1004
  bizumUrl: "http://192.168.18.3:3004/" + version + "/inner-bizum/",
997
1005
  bizumButtonUrl: "http://192.168.18.3:3005/" + version + "/inner-bizum-button/",
998
1006
  googlePayUrl: "http://192.168.18.3:3006/" + version + "/inner-google-pay/",
999
- paymentRequestUrl: "https://monei-payment-request.eu.ngrok.io/" + version + "/inner-payment-request/",
1007
+ paymentRequestUrl: "https://monei-local.ngrok.io/" + version + "/inner-payment-request/",
1000
1008
  click2PayUrl: "http://192.168.18.3:3008/inner-click2pay/",
1001
1009
  click2PayButtonUrl: "http://192.168.18.3:3009/inner-click2pay-button/",
1002
1010
  cofidisUrl: "http://192.168.18.3:3010/" + version + "/inner-cofidis/",
@@ -1005,8 +1013,8 @@ var stageConfig = {
1005
1013
  cofidisLoanUrl: "http://192.168.18.3:3013/" + version + "/inner-cofidis-loan/",
1006
1014
  cofidisLoanButtonUrl: "http://192.168.18.3:3014/" + version + "/inner-cofidis-loan-button/",
1007
1015
  cofidisLoanWidgetUrl: "http://192.168.18.3:3015/" + version + "/inner-cofidis-loan-widget/",
1008
- apiUrl: 'https://api.microapps-staging.com/v1',
1009
- secureDomain: 'https://secure.microapps-staging.com'
1016
+ apiUrl: 'https://api.monei.com/v1',
1017
+ secureDomain: 'https://secure.monei.com'
1010
1018
  },
1011
1019
  dev: {
1012
1020
  apiUrl: 'https://api.microapps-staging.com/v1',
@@ -14221,6 +14229,14 @@ var options = {
14221
14229
  type: zoid.PROP_TYPE.OBJECT,
14222
14230
  alias: 'innerStyle',
14223
14231
  required: false
14232
+ },
14233
+ __getConfig: {
14234
+ type: zoid.PROP_TYPE.FUNCTION,
14235
+ required: false,
14236
+ value: function value(_ref2) {
14237
+ var props = _ref2.props;
14238
+ return getPaymentMethods.bind(null, props);
14239
+ }
14224
14240
  }
14225
14241
  },
14226
14242
  validate: validateComponentProps,
@@ -14241,9 +14257,9 @@ var options = {
14241
14257
 
14242
14258
  return containerTemplate(params);
14243
14259
  },
14244
- prerenderTemplate: function prerenderTemplate(_ref2) {
14245
- var doc = _ref2.doc,
14246
- props = _ref2.props;
14260
+ prerenderTemplate: function prerenderTemplate(_ref3) {
14261
+ var doc = _ref3.doc,
14262
+ props = _ref3.props;
14247
14263
  var html = doc.createElement('html');
14248
14264
  var body = doc.createElement('body');
14249
14265
  body.style.margin = '0';
@@ -14311,6 +14327,15 @@ var options$1 = {
14311
14327
  type: zoid.PROP_TYPE.OBJECT,
14312
14328
  required: false
14313
14329
  },
14330
+ allowedPaymentMethods: {
14331
+ type: zoid.PROP_TYPE.ARRAY,
14332
+ required: false
14333
+ },
14334
+ customDomain: {
14335
+ type: zoid.PROP_TYPE.STRING,
14336
+ "default": config.secureDomain,
14337
+ required: false
14338
+ },
14314
14339
  billingDetails: {
14315
14340
  type: zoid.PROP_TYPE.OBJECT,
14316
14341
  required: false
@@ -14433,7 +14458,7 @@ var onLoadPaypal = /*#__PURE__*/function () {
14433
14458
  switch (_context2.prev = _context2.next) {
14434
14459
  case 0:
14435
14460
  _context2.next = 2;
14436
- return loadScript(src, {
14461
+ return loadScript(src, props.cspNonce, {
14437
14462
  namespace: namespace,
14438
14463
  cspNonce: props.cspNonce
14439
14464
  });
@@ -14720,6 +14745,10 @@ var options$3 = {
14720
14745
  type: zoid.PROP_TYPE.STRING,
14721
14746
  required: false
14722
14747
  },
14748
+ phoneNumber: {
14749
+ type: zoid.PROP_TYPE.STRING,
14750
+ required: false
14751
+ },
14723
14752
  onError: {
14724
14753
  type: zoid.PROP_TYPE.FUNCTION,
14725
14754
  required: false
@@ -14791,6 +14820,10 @@ var options$4 = {
14791
14820
  type: zoid.PROP_TYPE.STRING,
14792
14821
  required: false
14793
14822
  },
14823
+ phoneNumber: {
14824
+ type: zoid.PROP_TYPE.STRING,
14825
+ required: false
14826
+ },
14794
14827
  onError: {
14795
14828
  type: zoid.PROP_TYPE.FUNCTION,
14796
14829
  required: false
@@ -14830,9 +14863,10 @@ var options$4 = {
14830
14863
  return function (_ref3) {
14831
14864
  var amount = _ref3.amount,
14832
14865
  currency = _ref3.currency;
14833
- var bizumModal = new BizumModal(_extends({}, props, {
14866
+ var bizumModal = new BizumModal(_extends({
14834
14867
  amount: amount,
14835
- currency: currency,
14868
+ currency: currency
14869
+ }, props, {
14836
14870
  onClose: function onClose() {
14837
14871
  window.onpopstate = null;
14838
14872
  document.body.style.overflow = '';
@@ -15754,10 +15788,24 @@ var PaymentRequest = /*#__PURE__*/zoid.create(options$c);
15754
15788
  (function (NextActionType) {
15755
15789
  NextActionType["CONFIRM"] = "CONFIRM";
15756
15790
  NextActionType["FRICTIONLESS_CHALLENGE"] = "FRICTIONLESS_CHALLENGE";
15791
+ NextActionType["BIZUM_CHALLENGE"] = "BIZUM_CHALLENGE";
15757
15792
  NextActionType["CHALLENGE"] = "CHALLENGE";
15758
15793
  NextActionType["COMPLETE"] = "COMPLETE";
15759
15794
  })(exports.NextActionType || (exports.NextActionType = {}));
15760
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
+ })(exports.CardBrand || (exports.CardBrand = {}));
15808
+
15761
15809
  var api = _api;
15762
15810
  var utils = _utils;
15763
15811