@monei-js/components 1.7.7 → 1.7.8

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.
@@ -914,8 +914,34 @@ var getLanguage = function getLanguage() {
914
914
  return '';
915
915
  };
916
916
 
917
+ var safe = function safe(fn) {
918
+ try {
919
+ var _fn;
920
+
921
+ return String((_fn = fn()) != null ? _fn : '');
922
+ } catch (_unused) {
923
+ return '';
924
+ }
925
+ };
926
+
917
927
  var getClientEnv = function getClientEnv() {
918
- var env = [window.screen.colorDepth, window.screen.height, window.screen.width, new Date().getTimezoneOffset(), getLanguage()].join('|');
928
+ var env = [window.screen.colorDepth, window.screen.height, window.screen.width, new Date().getTimezoneOffset(), getLanguage(), safe(function () {
929
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
930
+ }), safe(function () {
931
+ return window.devicePixelRatio;
932
+ }), safe(function () {
933
+ return navigator.hardwareConcurrency;
934
+ }), safe(function () {
935
+ return navigator.deviceMemory;
936
+ }), safe(function () {
937
+ return navigator.maxTouchPoints;
938
+ }), safe(function () {
939
+ return navigator.platform;
940
+ }), safe(function () {
941
+ var _navigator$languages;
942
+
943
+ return (_navigator$languages = navigator.languages) == null ? void 0 : _navigator$languages.join(',');
944
+ })].join('|');
919
945
  return window.btoa(env);
920
946
  };
921
947
  var withError = /*#__PURE__*/function () {
@@ -1016,14 +1042,14 @@ var stageConfig = {
1016
1042
  cofidisLoanUrl: "http://localhost:3013/" + version + "/inner-cofidis-loan/",
1017
1043
  cofidisLoanButtonUrl: "http://localhost:3014/" + version + "/inner-cofidis-loan-button/",
1018
1044
  cofidisLoanWidgetUrl: "http://localhost:3015/" + version + "/inner-cofidis-loan-widget/",
1019
- apiUrl: 'https://api.monei.com/v1',
1020
- secureDomain: 'https://secure.monei.com',
1021
- rootDomain: 'monei.com'
1045
+ apiUrl: 'https://api.monei-dev.com/v1',
1046
+ secureDomain: 'https://secure.monei-dev.com',
1047
+ rootDomain: 'monei-dev.com'
1022
1048
  },
1023
1049
  dev: {
1024
- apiUrl: 'https://api.microapps-staging.com/v1',
1025
- secureDomain: 'https://secure.microapps-staging.com',
1026
- rootDomain: 'microapps-staging.com'
1050
+ apiUrl: 'https://api.monei-dev.com/v1',
1051
+ secureDomain: 'https://secure.monei-dev.com',
1052
+ rootDomain: 'monei-dev.com'
1027
1053
  },
1028
1054
  prod: {
1029
1055
  apiUrl: 'https://api.monei.com/v1',
@@ -1149,12 +1175,12 @@ var getPaymentMethods = /*#__PURE__*/function () {
1149
1175
  }();
1150
1176
  var createToken = /*#__PURE__*/function () {
1151
1177
  var _ref6 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(_ref5) {
1152
- var paymentMethod, paymentId, sessionId, amount, currency, accountId, body;
1178
+ var paymentMethod, paymentId, sessionId, amount, currency, accountId, transactionType, body;
1153
1179
  return runtime_1.wrap(function _callee3$(_context3) {
1154
1180
  while (1) {
1155
1181
  switch (_context3.prev = _context3.next) {
1156
1182
  case 0:
1157
- paymentMethod = _ref5.paymentMethod, paymentId = _ref5.paymentId, sessionId = _ref5.sessionId, amount = _ref5.amount, currency = _ref5.currency, accountId = _ref5.accountId;
1183
+ paymentMethod = _ref5.paymentMethod, paymentId = _ref5.paymentId, sessionId = _ref5.sessionId, amount = _ref5.amount, currency = _ref5.currency, accountId = _ref5.accountId, transactionType = _ref5.transactionType;
1158
1184
 
1159
1185
  if (!paymentId) {
1160
1186
  _context3.next = 5;
@@ -1179,7 +1205,8 @@ var createToken = /*#__PURE__*/function () {
1179
1205
  paymentMethod: paymentMethod,
1180
1206
  sessionId: sessionId,
1181
1207
  amount: amount,
1182
- currency: currency
1208
+ currency: currency,
1209
+ transactionType: transactionType
1183
1210
  };
1184
1211
  _context3.next = 10;
1185
1212
  break;
@@ -15161,7 +15188,7 @@ var namespace = 'monei-paypal';
15161
15188
 
15162
15189
  var onLoadPaypal = /*#__PURE__*/function () {
15163
15190
  var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(props, state, src) {
15164
- var script, defaultStyle, token;
15191
+ var script, defaultStyle, style, token;
15165
15192
  return runtime_1.wrap(function _callee2$(_context2) {
15166
15193
  while (1) {
15167
15194
  switch (_context2.prev = _context2.next) {
@@ -15179,8 +15206,14 @@ var onLoadPaypal = /*#__PURE__*/function () {
15179
15206
  layout: 'horizontal',
15180
15207
  tagline: false
15181
15208
  };
15209
+ style = _extends({}, defaultStyle, props.style);
15210
+
15211
+ if (typeof style.height === 'string') {
15212
+ style.height = parseInt(style.height.replace('px', ''));
15213
+ }
15214
+
15182
15215
  props.onLoad == null ? void 0 : props.onLoad(true);
15183
- _context2.next = 8;
15216
+ _context2.next = 10;
15184
15217
  return window[namespace].Buttons({
15185
15218
  createOrder: function () {
15186
15219
  var _createOrder = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
@@ -15198,6 +15231,7 @@ var onLoadPaypal = /*#__PURE__*/function () {
15198
15231
  sessionId: props.sessionId,
15199
15232
  amount: props.amount,
15200
15233
  currency: props.currency,
15234
+ transactionType: props.transactionType,
15201
15235
  paymentMethod: {
15202
15236
  paypal: {}
15203
15237
  }
@@ -15246,10 +15280,10 @@ var onLoadPaypal = /*#__PURE__*/function () {
15246
15280
 
15247
15281
  if (!shouldOpen) return actions.reject();
15248
15282
  },
15249
- style: _extends({}, defaultStyle, props.style)
15283
+ style: style
15250
15284
  }).render(state.__container);
15251
15285
 
15252
- case 8:
15286
+ case 10:
15253
15287
  case "end":
15254
15288
  return _context2.stop();
15255
15289
  }
@@ -15277,9 +15311,6 @@ var options$2 = {
15277
15311
  return undefined;
15278
15312
  },
15279
15313
  containerTemplate: function containerTemplate$1(params) {
15280
- console.log({
15281
- params: params
15282
- });
15283
15314
  params.state.__container = params.container;
15284
15315
 
15285
15316
  if (!params.props.accountId && !params.props.paymentId) {
@@ -15289,7 +15320,6 @@ var options$2 = {
15289
15320
  var container = containerTemplate(params);
15290
15321
 
15291
15322
  params.event.on(zoid.EVENT.DESTROY, function () {
15292
- console.log('destroy');
15293
15323
  window[namespace].Buttons.instances.forEach(function (instance) {
15294
15324
  instance.close();
15295
15325
  });
@@ -15553,7 +15583,7 @@ var options$4 = {
15553
15583
  url: config.bizumButtonUrl,
15554
15584
  dimensions: {
15555
15585
  width: '100%',
15556
- height: '45px'
15586
+ height: 'auto'
15557
15587
  },
15558
15588
  autoResize: {
15559
15589
  width: false,
@@ -16505,7 +16535,7 @@ var options$c = {
16505
16535
  url: config.paymentRequestUrl,
16506
16536
  dimensions: {
16507
16537
  width: '100%',
16508
- height: '0'
16538
+ height: 'auto'
16509
16539
  },
16510
16540
  autoResize: {
16511
16541
  width: false,