@monei-js/components 1.3.0 → 1.5.1

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.
@@ -975,6 +975,12 @@ var globalConfig = {
975
975
  paypalUrl: domain + "/" + version + "/inner-paypal/",
976
976
  bizumUrl: domain + "/" + version + "/inner-bizum/",
977
977
  bizumButtonUrl: domain + "/" + version + "/inner-bizum-button/",
978
+ cofidisUrl: domain + "/" + version + "/inner-cofidis/",
979
+ cofidisButtonUrl: domain + "/" + version + "/inner-cofidis-button/",
980
+ cofidisWidgetUrl: domain + "/" + version + "/inner-cofidis-widget/",
981
+ cofidisLoanUrl: domain + "/" + version + "/inner-cofidis-loan/",
982
+ cofidisLoanButtonUrl: domain + "/" + version + "/inner-cofidis-loan-button/",
983
+ cofidisLoanWidgetUrl: domain + "/" + version + "/inner-cofidis-loan-widget/",
978
984
  googlePayUrl: domain + "/" + version + "/inner-google-pay/",
979
985
  paymentRequestUrl: domain + "/" + version + "/inner-payment-request/",
980
986
  click2PayUrl: domain + "/" + version + "/inner-click2pay/",
@@ -985,14 +991,20 @@ var stageConfig = {
985
991
  paymentPageUrl: "http://192.168.18.3:8080/",
986
992
  posPaymentPageUrl: "http://192.168.18.3:8080/",
987
993
  cardInputUrl: "http://192.168.18.3:3001/" + version + "/inner-card-input/",
988
- paymentModalUrl: "https://monei-payment-modal.eu.ngrok.io/" + version + "/inner-payment-modal/",
994
+ paymentModalUrl: "http://192.168.18.3:3002/" + version + "/inner-payment-modal/",
989
995
  paypalUrl: "http://192.168.18.3:3003/" + version + "/inner-paypal/",
990
996
  bizumUrl: "http://192.168.18.3:3004/" + version + "/inner-bizum/",
991
997
  bizumButtonUrl: "http://192.168.18.3:3005/" + version + "/inner-bizum-button/",
992
998
  googlePayUrl: "http://192.168.18.3:3006/" + version + "/inner-google-pay/",
993
999
  paymentRequestUrl: "https://monei-payment-request.eu.ngrok.io/" + version + "/inner-payment-request/",
994
- click2PayUrl: "http://192.168.18.3:3007/inner-click2pay/",
995
- click2PayButtonUrl: "http://192.168.18.3:3008/inner-click2pay-button/",
1000
+ click2PayUrl: "http://192.168.18.3:3008/inner-click2pay/",
1001
+ click2PayButtonUrl: "http://192.168.18.3:3009/inner-click2pay-button/",
1002
+ cofidisUrl: "http://192.168.18.3:3010/" + version + "/inner-cofidis/",
1003
+ cofidisButtonUrl: "http://192.168.18.3:3011/" + version + "/inner-cofidis-button/",
1004
+ cofidisWidgetUrl: "http://192.168.18.3:3012/" + version + "/inner-cofidis-widget/",
1005
+ cofidisLoanUrl: "http://192.168.18.3:3013/" + version + "/inner-cofidis-loan/",
1006
+ cofidisLoanButtonUrl: "http://192.168.18.3:3014/" + version + "/inner-cofidis-loan-button/",
1007
+ cofidisLoanWidgetUrl: "http://192.168.18.3:3015/" + version + "/inner-cofidis-loan-widget/",
996
1008
  apiUrl: 'https://api.microapps-staging.com/v1',
997
1009
  secureDomain: 'https://secure.microapps-staging.com'
998
1010
  },
@@ -1311,6 +1323,52 @@ var createApplePaySession = /*#__PURE__*/function () {
1311
1323
  return _ref14.apply(this, arguments);
1312
1324
  };
1313
1325
  }();
1326
+ var calculateFinancing = /*#__PURE__*/function () {
1327
+ var _ref15 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(req) {
1328
+ return runtime_1.wrap(function _callee9$(_context9) {
1329
+ while (1) {
1330
+ switch (_context9.prev = _context9.next) {
1331
+ case 0:
1332
+ return _context9.abrupt("return", request("/cofidis/calculate-financing", {
1333
+ method: 'POST',
1334
+ body: req
1335
+ }));
1336
+
1337
+ case 1:
1338
+ case "end":
1339
+ return _context9.stop();
1340
+ }
1341
+ }
1342
+ }, _callee9);
1343
+ }));
1344
+
1345
+ return function calculateFinancing(_x10) {
1346
+ return _ref15.apply(this, arguments);
1347
+ };
1348
+ }();
1349
+ var validateBizumPhone = /*#__PURE__*/function () {
1350
+ var _ref16 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(req) {
1351
+ return runtime_1.wrap(function _callee10$(_context10) {
1352
+ while (1) {
1353
+ switch (_context10.prev = _context10.next) {
1354
+ case 0:
1355
+ return _context10.abrupt("return", request("/bizum/validate-phone", {
1356
+ method: 'POST',
1357
+ body: req
1358
+ }));
1359
+
1360
+ case 1:
1361
+ case "end":
1362
+ return _context10.stop();
1363
+ }
1364
+ }
1365
+ }, _callee10);
1366
+ }));
1367
+
1368
+ return function validateBizumPhone(_x11) {
1369
+ return _ref16.apply(this, arguments);
1370
+ };
1371
+ }();
1314
1372
 
1315
1373
  var _api = {
1316
1374
  __proto__: null,
@@ -1320,7 +1378,9 @@ var _api = {
1320
1378
  confirmPayment: confirmPayment,
1321
1379
  createPayment: createPayment,
1322
1380
  sendPaymentReceipt: sendPaymentReceipt,
1323
- createApplePaySession: createApplePaySession
1381
+ createApplePaySession: createApplePaySession,
1382
+ calculateFinancing: calculateFinancing,
1383
+ validateBizumPhone: validateBizumPhone
1324
1384
  };
1325
1385
 
1326
1386
  var postRobot = createCommonjsModule(function (module, exports) {
@@ -14668,7 +14728,7 @@ var options$3 = {
14668
14728
  type: zoid.PROP_TYPE.FUNCTION,
14669
14729
  required: false
14670
14730
  },
14671
- onSuccess: {
14731
+ onSubmit: {
14672
14732
  type: zoid.PROP_TYPE.FUNCTION,
14673
14733
  required: false
14674
14734
  },
@@ -14767,8 +14827,12 @@ var options$4 = {
14767
14827
  var props = _ref2.props;
14768
14828
  var rootNode = document.createElement('div');
14769
14829
  document.body.appendChild(rootNode);
14770
- return function () {
14830
+ return function (_ref3) {
14831
+ var amount = _ref3.amount,
14832
+ currency = _ref3.currency;
14771
14833
  var bizumModal = new BizumModal(_extends({}, props, {
14834
+ amount: amount,
14835
+ currency: currency,
14772
14836
  onClose: function onClose() {
14773
14837
  window.onpopstate = null;
14774
14838
  document.body.style.overflow = '';
@@ -14794,46 +14858,179 @@ var options$4 = {
14794
14858
  };
14795
14859
  var Bizum = /*#__PURE__*/zoid.create(options$4);
14796
14860
 
14861
+ var EVENT$1;
14862
+
14863
+ (function (EVENT) {
14864
+ EVENT["BEFORE_CLOSE"] = "BEFORE_CLOSE";
14865
+ })(EVENT$1 || (EVENT$1 = {}));
14866
+
14867
+ function containerTemplate$2(_ref) {
14868
+ var uid = _ref.uid,
14869
+ frame = _ref.frame,
14870
+ prerenderFrame = _ref.prerenderFrame,
14871
+ doc = _ref.doc,
14872
+ props = _ref.props,
14873
+ event = _ref.event,
14874
+ _ref$dimensions = _ref.dimensions,
14875
+ width = _ref$dimensions.width,
14876
+ height = _ref$dimensions.height;
14877
+
14878
+ if (!frame || !prerenderFrame) {
14879
+ return;
14880
+ }
14881
+
14882
+ var div = doc.createElement('div');
14883
+ var backdrop = doc.createElement('div');
14884
+ div.setAttribute('id', uid);
14885
+ backdrop.classList.add('backdrop');
14886
+ div.appendChild(backdrop);
14887
+ var style = doc.createElement('style');
14888
+
14889
+ if (props.cspNonce) {
14890
+ style.setAttribute('nonce', props.cspNonce);
14891
+ }
14892
+
14893
+ style.appendChild(doc.createTextNode("\n #" + uid + " {\n position: fixed;\n overflow: hidden;\n display: block;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n width: " + width + ";\n height: " + height + ";\n z-index: 99999;\n }\n #" + uid + " > .backdrop {\n position: fixed;\n display: block;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(40, 40, 40, 0.7);\n transition: opacity 0.35s ease-in-out;\n opacity: 0;\n will-change: opacity;\n }\n #" + uid + " > .backdrop." + CLASS.VISIBLE + " {\n opacity: 1;\n }\n #" + uid + " > iframe {\n display: inline-block;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n transition: all .2s ease-in-out;\n }\n #" + uid + " > iframe." + CLASS.INVISIBLE + " {\n opacity: 0;\n }\n #" + uid + " > iframe." + CLASS.VISIBLE + " {\n opacity: 1;\n }\n "));
14894
+ div.appendChild(frame);
14895
+ div.appendChild(prerenderFrame);
14896
+ div.appendChild(style);
14897
+ prerenderFrame.classList.add(CLASS.VISIBLE);
14898
+ frame.classList.add(CLASS.INVISIBLE);
14899
+ setTimeout(function () {
14900
+ backdrop.classList.add(CLASS.VISIBLE);
14901
+ }, 1);
14902
+ event.on(zoid.EVENT.RENDERED, function () {
14903
+ prerenderFrame.classList.remove(CLASS.VISIBLE);
14904
+ prerenderFrame.classList.add(CLASS.INVISIBLE);
14905
+ frame.classList.remove(CLASS.INVISIBLE);
14906
+ frame.classList.add(CLASS.VISIBLE);
14907
+ setTimeout(function () {
14908
+ belter$3.destroyElement(prerenderFrame);
14909
+ }, 1);
14910
+ });
14911
+ event.on(EVENT$1.BEFORE_CLOSE, function () {
14912
+ backdrop.classList.remove(CLASS.VISIBLE);
14913
+ });
14914
+ event.on(zoid.EVENT.RESIZE, function (_ref2) {
14915
+ var newWidth = _ref2.width,
14916
+ newHeight = _ref2.height;
14917
+
14918
+ if (typeof newWidth === 'number') {
14919
+ div.style.width = belter$3.toCSS(newWidth);
14920
+ }
14921
+
14922
+ if (typeof newHeight === 'number') {
14923
+ div.style.height = belter$3.toCSS(newHeight);
14924
+ }
14925
+ });
14926
+ return div;
14927
+ }
14928
+
14797
14929
  // @ts-ignore
14798
14930
  var options$5 = {
14799
- tag: 'monei-google-pay',
14800
- url: config.googlePayUrl,
14931
+ tag: 'monei-cofidis',
14932
+ url: config.cofidisUrl,
14801
14933
  dimensions: {
14802
14934
  width: '100%',
14803
- height: '0'
14935
+ height: '100%'
14804
14936
  },
14805
14937
  autoResize: {
14806
14938
  width: false,
14807
- height: true
14939
+ height: false
14808
14940
  },
14809
- validate: validateComponentProps,
14810
- containerTemplate: containerTemplate,
14811
14941
  prerenderTemplate: function prerenderTemplate() {
14812
14942
  return undefined;
14813
14943
  },
14944
+ containerTemplate: containerTemplate$2,
14814
14945
  props: {
14815
- accountId: {
14946
+ paymentId: {
14816
14947
  type: zoid.PROP_TYPE.STRING,
14817
14948
  required: false
14818
14949
  },
14819
- sessionId: {
14950
+ amount: {
14951
+ type: zoid.PROP_TYPE.NUMBER,
14952
+ required: false
14953
+ },
14954
+ currency: {
14820
14955
  type: zoid.PROP_TYPE.STRING,
14821
14956
  required: false
14822
14957
  },
14823
- paymentId: {
14958
+ language: {
14824
14959
  type: zoid.PROP_TYPE.STRING,
14825
14960
  required: false
14826
14961
  },
14962
+ onError: {
14963
+ type: zoid.PROP_TYPE.FUNCTION,
14964
+ required: false
14965
+ },
14966
+ onLoad: {
14967
+ type: zoid.PROP_TYPE.FUNCTION,
14968
+ required: false
14969
+ },
14970
+ onSubmit: {
14971
+ type: zoid.PROP_TYPE.FUNCTION,
14972
+ required: false
14973
+ },
14974
+ onOpen: {
14975
+ type: zoid.PROP_TYPE.FUNCTION,
14976
+ required: false
14977
+ },
14978
+ onBeforeClose: {
14979
+ type: zoid.PROP_TYPE.FUNCTION,
14980
+ required: false,
14981
+ "default": function _default(_ref) {
14982
+ var event = _ref.event;
14983
+ return function () {
14984
+ event.trigger(EVENT$1.BEFORE_CLOSE);
14985
+ };
14986
+ }
14987
+ }
14988
+ }
14989
+ };
14990
+ var CofidisModal = /*#__PURE__*/zoid.create(options$5);
14991
+
14992
+ // @ts-ignore
14993
+ var options$6 = {
14994
+ tag: 'monei-cofidis-widget',
14995
+ url: config.cofidisWidgetUrl,
14996
+ dimensions: {
14997
+ width: '100%',
14998
+ height: '46px'
14999
+ },
15000
+ autoResize: {
15001
+ width: false,
15002
+ height: true
15003
+ },
15004
+ prerenderTemplate: function prerenderTemplate() {
15005
+ return undefined;
15006
+ },
15007
+ props: {
15008
+ accountId: {
15009
+ type: zoid.PROP_TYPE.STRING,
15010
+ required: true
15011
+ },
14827
15012
  amount: {
14828
15013
  type: zoid.PROP_TYPE.NUMBER,
14829
15014
  required: false
14830
15015
  },
14831
- currency: {
14832
- type: zoid.PROP_TYPE.STRING,
15016
+ amountInt: {
15017
+ type: zoid.PROP_TYPE.NUMBER,
14833
15018
  required: false
14834
15019
  },
14835
15020
  language: {
14836
15021
  type: zoid.PROP_TYPE.STRING,
15022
+ required: false,
15023
+ "default": function _default() {
15024
+ return 'es';
15025
+ }
15026
+ },
15027
+ showLogo: {
15028
+ type: zoid.PROP_TYPE.BOOLEAN,
15029
+ required: false
15030
+ },
15031
+ style: {
15032
+ type: zoid.PROP_TYPE.OBJECT,
15033
+ alias: 'innerStyle',
14837
15034
  required: false
14838
15035
  },
14839
15036
  onError: {
@@ -14844,11 +15041,60 @@ var options$5 = {
14844
15041
  type: zoid.PROP_TYPE.FUNCTION,
14845
15042
  required: false
14846
15043
  },
14847
- onSubmit: {
15044
+ __onClick: {
15045
+ type: zoid.PROP_TYPE.FUNCTION,
15046
+ required: false,
15047
+ value: function value() {
15048
+ return function (url) {
15049
+ window.open(url, '_blank');
15050
+ };
15051
+ }
15052
+ }
15053
+ }
15054
+ };
15055
+ var CofidisWidget = /*#__PURE__*/zoid.create(options$6);
15056
+
15057
+ var options$7 = {
15058
+ tag: 'monei-cofidis-button',
15059
+ url: config.cofidisButtonUrl,
15060
+ dimensions: {
15061
+ width: '100%',
15062
+ height: '45px'
15063
+ },
15064
+ autoResize: {
15065
+ width: false,
15066
+ height: true
15067
+ },
15068
+ validate: validateComponentProps,
15069
+ containerTemplate: containerTemplate,
15070
+ prerenderTemplate: function prerenderTemplate() {
15071
+ return undefined;
15072
+ },
15073
+ props: {
15074
+ paymentId: {
15075
+ type: zoid.PROP_TYPE.STRING,
15076
+ required: false
15077
+ },
15078
+ language: {
15079
+ type: zoid.PROP_TYPE.STRING,
15080
+ required: false
15081
+ },
15082
+ hint: {
15083
+ type: zoid.PROP_TYPE.BOOLEAN,
15084
+ "default": function _default() {
15085
+ return true;
15086
+ },
15087
+ required: false
15088
+ },
15089
+ onError: {
14848
15090
  type: zoid.PROP_TYPE.FUNCTION,
14849
15091
  required: false
14850
15092
  },
14851
- onBeforeSubmit: {
15093
+ onLoad: {
15094
+ type: zoid.PROP_TYPE.FUNCTION,
15095
+ required: false
15096
+ },
15097
+ onOpen: {
14852
15098
  type: zoid.PROP_TYPE.FUNCTION,
14853
15099
  required: false
14854
15100
  },
@@ -14864,25 +15110,450 @@ var options$5 = {
14864
15110
  var props = _ref.props;
14865
15111
  return getPaymentMethods.bind(null, props);
14866
15112
  }
15113
+ },
15114
+ __onHintClick: {
15115
+ type: zoid.PROP_TYPE.FUNCTION,
15116
+ required: false,
15117
+ value: function value() {
15118
+ return function (url) {
15119
+ window.open(url, '_blank');
15120
+ };
15121
+ }
15122
+ },
15123
+ __onClick: {
15124
+ type: zoid.PROP_TYPE.FUNCTION,
15125
+ required: false,
15126
+ value: function value(_ref2) {
15127
+ var props = _ref2.props;
15128
+ var rootNode = document.createElement('div');
15129
+ document.body.appendChild(rootNode);
15130
+ return function (_ref3) {
15131
+ var amount = _ref3.amount,
15132
+ currency = _ref3.currency,
15133
+ accountId = _ref3.accountId;
15134
+ var cofidisModal = new CofidisModal(_extends({}, props, {
15135
+ amount: amount,
15136
+ currency: currency,
15137
+ accountId: accountId,
15138
+ onClose: function onClose() {
15139
+ window.onpopstate = null;
15140
+ document.body.style.overflow = '';
15141
+ },
15142
+ isOpen: true
15143
+ }));
15144
+ window.history.pushState(null, '', window.location.href);
15145
+
15146
+ window.onpopstate = function () {
15147
+ return cofidisModal.updateProps({
15148
+ isOpen: false
15149
+ });
15150
+ };
15151
+
15152
+ Object.assign(document.body.style, {
15153
+ overflow: 'hidden'
15154
+ });
15155
+ return cofidisModal.render(rootNode);
15156
+ };
15157
+ }
14867
15158
  }
14868
15159
  }
14869
15160
  };
14870
- var GooglePay = /*#__PURE__*/zoid.create(options$5);
15161
+ var Cofidis = /*#__PURE__*/zoid.create(options$7);
14871
15162
 
14872
- var onApplePayButtonClicked = /*#__PURE__*/function () {
14873
- var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(props, request, context) {
14874
- var session;
14875
- return runtime_1.wrap(function _callee3$(_context3) {
14876
- while (1) {
14877
- switch (_context3.prev = _context3.next) {
14878
- case 0:
14879
- session = new window.ApplePaySession(3, request);
15163
+ var EVENT$2;
14880
15164
 
14881
- session.onvalidatemerchant = /*#__PURE__*/function () {
14882
- var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(event) {
14883
- var merchantSession;
14884
- return runtime_1.wrap(function _callee$(_context) {
14885
- while (1) {
15165
+ (function (EVENT) {
15166
+ EVENT["BEFORE_CLOSE"] = "BEFORE_CLOSE";
15167
+ })(EVENT$2 || (EVENT$2 = {}));
15168
+
15169
+ function containerTemplate$3(_ref) {
15170
+ var uid = _ref.uid,
15171
+ frame = _ref.frame,
15172
+ prerenderFrame = _ref.prerenderFrame,
15173
+ doc = _ref.doc,
15174
+ props = _ref.props,
15175
+ event = _ref.event,
15176
+ _ref$dimensions = _ref.dimensions,
15177
+ width = _ref$dimensions.width,
15178
+ height = _ref$dimensions.height;
15179
+
15180
+ if (!frame || !prerenderFrame) {
15181
+ return;
15182
+ }
15183
+
15184
+ var div = doc.createElement('div');
15185
+ var backdrop = doc.createElement('div');
15186
+ div.setAttribute('id', uid);
15187
+ backdrop.classList.add('backdrop');
15188
+ div.appendChild(backdrop);
15189
+ var style = doc.createElement('style');
15190
+
15191
+ if (props.cspNonce) {
15192
+ style.setAttribute('nonce', props.cspNonce);
15193
+ }
15194
+
15195
+ style.appendChild(doc.createTextNode("\n #" + uid + " {\n position: fixed;\n overflow: hidden;\n display: block;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n width: " + width + ";\n height: " + height + ";\n z-index: 99999;\n }\n #" + uid + " > .backdrop {\n position: fixed;\n display: block;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(40, 40, 40, 0.7);\n transition: opacity 0.35s ease-in-out;\n opacity: 0;\n will-change: opacity;\n }\n #" + uid + " > .backdrop." + CLASS.VISIBLE + " {\n opacity: 1;\n }\n #" + uid + " > iframe {\n display: inline-block;\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n transition: all .2s ease-in-out;\n }\n #" + uid + " > iframe." + CLASS.INVISIBLE + " {\n opacity: 0;\n }\n #" + uid + " > iframe." + CLASS.VISIBLE + " {\n opacity: 1;\n }\n "));
15196
+ div.appendChild(frame);
15197
+ div.appendChild(prerenderFrame);
15198
+ div.appendChild(style);
15199
+ prerenderFrame.classList.add(CLASS.VISIBLE);
15200
+ frame.classList.add(CLASS.INVISIBLE);
15201
+ setTimeout(function () {
15202
+ backdrop.classList.add(CLASS.VISIBLE);
15203
+ }, 1);
15204
+ event.on(zoid.EVENT.RENDERED, function () {
15205
+ prerenderFrame.classList.remove(CLASS.VISIBLE);
15206
+ prerenderFrame.classList.add(CLASS.INVISIBLE);
15207
+ frame.classList.remove(CLASS.INVISIBLE);
15208
+ frame.classList.add(CLASS.VISIBLE);
15209
+ setTimeout(function () {
15210
+ belter$3.destroyElement(prerenderFrame);
15211
+ }, 1);
15212
+ });
15213
+ event.on(EVENT$2.BEFORE_CLOSE, function () {
15214
+ backdrop.classList.remove(CLASS.VISIBLE);
15215
+ });
15216
+ event.on(zoid.EVENT.RESIZE, function (_ref2) {
15217
+ var newWidth = _ref2.width,
15218
+ newHeight = _ref2.height;
15219
+
15220
+ if (typeof newWidth === 'number') {
15221
+ div.style.width = belter$3.toCSS(newWidth);
15222
+ }
15223
+
15224
+ if (typeof newHeight === 'number') {
15225
+ div.style.height = belter$3.toCSS(newHeight);
15226
+ }
15227
+ });
15228
+ return div;
15229
+ }
15230
+
15231
+ // @ts-ignore
15232
+ var options$8 = {
15233
+ tag: 'monei-cofidis-loan',
15234
+ url: config.cofidisLoanUrl,
15235
+ dimensions: {
15236
+ width: '100%',
15237
+ height: '100%'
15238
+ },
15239
+ autoResize: {
15240
+ width: false,
15241
+ height: false
15242
+ },
15243
+ prerenderTemplate: function prerenderTemplate() {
15244
+ return undefined;
15245
+ },
15246
+ containerTemplate: containerTemplate$3,
15247
+ props: {
15248
+ paymentId: {
15249
+ type: zoid.PROP_TYPE.STRING,
15250
+ required: false
15251
+ },
15252
+ amount: {
15253
+ type: zoid.PROP_TYPE.NUMBER,
15254
+ required: false
15255
+ },
15256
+ currency: {
15257
+ type: zoid.PROP_TYPE.STRING,
15258
+ required: false
15259
+ },
15260
+ language: {
15261
+ type: zoid.PROP_TYPE.STRING,
15262
+ required: false
15263
+ },
15264
+ onError: {
15265
+ type: zoid.PROP_TYPE.FUNCTION,
15266
+ required: false
15267
+ },
15268
+ onLoad: {
15269
+ type: zoid.PROP_TYPE.FUNCTION,
15270
+ required: false
15271
+ },
15272
+ onSubmit: {
15273
+ type: zoid.PROP_TYPE.FUNCTION,
15274
+ required: false
15275
+ },
15276
+ onOpen: {
15277
+ type: zoid.PROP_TYPE.FUNCTION,
15278
+ required: false
15279
+ },
15280
+ onBeforeClose: {
15281
+ type: zoid.PROP_TYPE.FUNCTION,
15282
+ required: false,
15283
+ "default": function _default(_ref) {
15284
+ var event = _ref.event;
15285
+ return function () {
15286
+ event.trigger(EVENT$2.BEFORE_CLOSE);
15287
+ };
15288
+ }
15289
+ }
15290
+ }
15291
+ };
15292
+ var CofidisLoanModal = /*#__PURE__*/zoid.create(options$8);
15293
+ var CofidisPayModal = CofidisLoanModal;
15294
+
15295
+ // @ts-ignore
15296
+ var options$9 = {
15297
+ tag: 'monei-cofidis-loan-widget',
15298
+ url: config.cofidisLoanWidgetUrl,
15299
+ dimensions: {
15300
+ width: '100%',
15301
+ height: '46px'
15302
+ },
15303
+ autoResize: {
15304
+ width: false,
15305
+ height: true
15306
+ },
15307
+ prerenderTemplate: function prerenderTemplate() {
15308
+ return undefined;
15309
+ },
15310
+ props: {
15311
+ accountId: {
15312
+ type: zoid.PROP_TYPE.STRING,
15313
+ required: true
15314
+ },
15315
+ amount: {
15316
+ type: zoid.PROP_TYPE.NUMBER,
15317
+ required: false
15318
+ },
15319
+ amountInt: {
15320
+ type: zoid.PROP_TYPE.NUMBER,
15321
+ required: false
15322
+ },
15323
+ language: {
15324
+ type: zoid.PROP_TYPE.STRING,
15325
+ required: false,
15326
+ "default": function _default() {
15327
+ return 'es';
15328
+ }
15329
+ },
15330
+ showLogo: {
15331
+ type: zoid.PROP_TYPE.BOOLEAN,
15332
+ required: false
15333
+ },
15334
+ style: {
15335
+ type: zoid.PROP_TYPE.OBJECT,
15336
+ alias: 'innerStyle',
15337
+ required: false
15338
+ },
15339
+ onError: {
15340
+ type: zoid.PROP_TYPE.FUNCTION,
15341
+ required: false
15342
+ },
15343
+ onLoad: {
15344
+ type: zoid.PROP_TYPE.FUNCTION,
15345
+ required: false
15346
+ },
15347
+ __onClick: {
15348
+ type: zoid.PROP_TYPE.FUNCTION,
15349
+ required: false,
15350
+ value: function value() {
15351
+ return function (url) {
15352
+ window.open(url, '_blank');
15353
+ };
15354
+ }
15355
+ }
15356
+ }
15357
+ };
15358
+ var CofidisLoanWidget = /*#__PURE__*/zoid.create(options$9);
15359
+ var CofidisPayWidget = CofidisLoanWidget;
15360
+
15361
+ var options$a = {
15362
+ tag: 'monei-cofidis-loan-button',
15363
+ url: config.cofidisLoanButtonUrl,
15364
+ dimensions: {
15365
+ width: '100%',
15366
+ height: '45px'
15367
+ },
15368
+ autoResize: {
15369
+ width: false,
15370
+ height: true
15371
+ },
15372
+ validate: validateComponentProps,
15373
+ containerTemplate: containerTemplate,
15374
+ prerenderTemplate: function prerenderTemplate() {
15375
+ return undefined;
15376
+ },
15377
+ props: {
15378
+ paymentId: {
15379
+ type: zoid.PROP_TYPE.STRING,
15380
+ required: false
15381
+ },
15382
+ language: {
15383
+ type: zoid.PROP_TYPE.STRING,
15384
+ required: false
15385
+ },
15386
+ hint: {
15387
+ type: zoid.PROP_TYPE.BOOLEAN,
15388
+ "default": function _default() {
15389
+ return true;
15390
+ },
15391
+ required: false
15392
+ },
15393
+ onError: {
15394
+ type: zoid.PROP_TYPE.FUNCTION,
15395
+ required: false
15396
+ },
15397
+ onLoad: {
15398
+ type: zoid.PROP_TYPE.FUNCTION,
15399
+ required: false
15400
+ },
15401
+ onOpen: {
15402
+ type: zoid.PROP_TYPE.FUNCTION,
15403
+ required: false
15404
+ },
15405
+ style: {
15406
+ type: zoid.PROP_TYPE.OBJECT,
15407
+ alias: 'innerStyle',
15408
+ required: false
15409
+ },
15410
+ __getConfig: {
15411
+ type: zoid.PROP_TYPE.FUNCTION,
15412
+ required: false,
15413
+ value: function value(_ref) {
15414
+ var props = _ref.props;
15415
+ return getPaymentMethods.bind(null, props);
15416
+ }
15417
+ },
15418
+ __onHintClick: {
15419
+ type: zoid.PROP_TYPE.FUNCTION,
15420
+ required: false,
15421
+ value: function value() {
15422
+ return function (url) {
15423
+ window.open(url, '_blank');
15424
+ };
15425
+ }
15426
+ },
15427
+ __onClick: {
15428
+ type: zoid.PROP_TYPE.FUNCTION,
15429
+ required: false,
15430
+ value: function value(_ref2) {
15431
+ var props = _ref2.props;
15432
+ var rootNode = document.createElement('div');
15433
+ document.body.appendChild(rootNode);
15434
+ return function (_ref3) {
15435
+ var amount = _ref3.amount,
15436
+ currency = _ref3.currency,
15437
+ accountId = _ref3.accountId;
15438
+ var cofidisModal = new CofidisLoanModal(_extends({}, props, {
15439
+ amount: amount,
15440
+ currency: currency,
15441
+ accountId: accountId,
15442
+ onClose: function onClose() {
15443
+ window.onpopstate = null;
15444
+ document.body.style.overflow = '';
15445
+ },
15446
+ isOpen: true
15447
+ }));
15448
+ window.history.pushState(null, '', window.location.href);
15449
+
15450
+ window.onpopstate = function () {
15451
+ return cofidisModal.updateProps({
15452
+ isOpen: false
15453
+ });
15454
+ };
15455
+
15456
+ Object.assign(document.body.style, {
15457
+ overflow: 'hidden'
15458
+ });
15459
+ return cofidisModal.render(rootNode);
15460
+ };
15461
+ }
15462
+ }
15463
+ }
15464
+ };
15465
+ var CofidisLoan = /*#__PURE__*/zoid.create(options$a);
15466
+ var CofidisPay = CofidisLoan;
15467
+
15468
+ // @ts-ignore
15469
+ var options$b = {
15470
+ tag: 'monei-google-pay',
15471
+ url: config.googlePayUrl,
15472
+ dimensions: {
15473
+ width: '100%',
15474
+ height: '0'
15475
+ },
15476
+ autoResize: {
15477
+ width: false,
15478
+ height: true
15479
+ },
15480
+ validate: validateComponentProps,
15481
+ containerTemplate: containerTemplate,
15482
+ prerenderTemplate: function prerenderTemplate() {
15483
+ return undefined;
15484
+ },
15485
+ props: {
15486
+ accountId: {
15487
+ type: zoid.PROP_TYPE.STRING,
15488
+ required: false
15489
+ },
15490
+ sessionId: {
15491
+ type: zoid.PROP_TYPE.STRING,
15492
+ required: false
15493
+ },
15494
+ paymentId: {
15495
+ type: zoid.PROP_TYPE.STRING,
15496
+ required: false
15497
+ },
15498
+ amount: {
15499
+ type: zoid.PROP_TYPE.NUMBER,
15500
+ required: false
15501
+ },
15502
+ currency: {
15503
+ type: zoid.PROP_TYPE.STRING,
15504
+ required: false
15505
+ },
15506
+ language: {
15507
+ type: zoid.PROP_TYPE.STRING,
15508
+ required: false
15509
+ },
15510
+ onError: {
15511
+ type: zoid.PROP_TYPE.FUNCTION,
15512
+ required: false
15513
+ },
15514
+ onLoad: {
15515
+ type: zoid.PROP_TYPE.FUNCTION,
15516
+ required: false
15517
+ },
15518
+ onSubmit: {
15519
+ type: zoid.PROP_TYPE.FUNCTION,
15520
+ required: false
15521
+ },
15522
+ onBeforeSubmit: {
15523
+ type: zoid.PROP_TYPE.FUNCTION,
15524
+ required: false
15525
+ },
15526
+ style: {
15527
+ type: zoid.PROP_TYPE.OBJECT,
15528
+ alias: 'innerStyle',
15529
+ required: false
15530
+ },
15531
+ __getConfig: {
15532
+ type: zoid.PROP_TYPE.FUNCTION,
15533
+ required: false,
15534
+ value: function value(_ref) {
15535
+ var props = _ref.props;
15536
+ return getPaymentMethods.bind(null, props);
15537
+ }
15538
+ }
15539
+ }
15540
+ };
15541
+ var GooglePay = /*#__PURE__*/zoid.create(options$b);
15542
+
15543
+ var onApplePayButtonClicked = /*#__PURE__*/function () {
15544
+ var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(props, request, context) {
15545
+ var session;
15546
+ return runtime_1.wrap(function _callee3$(_context3) {
15547
+ while (1) {
15548
+ switch (_context3.prev = _context3.next) {
15549
+ case 0:
15550
+ session = new window.ApplePaySession(3, request);
15551
+
15552
+ session.onvalidatemerchant = /*#__PURE__*/function () {
15553
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(event) {
15554
+ var merchantSession;
15555
+ return runtime_1.wrap(function _callee$(_context) {
15556
+ while (1) {
14886
15557
  switch (_context.prev = _context.next) {
14887
15558
  case 0:
14888
15559
  _context.prev = 0;
@@ -14985,7 +15656,7 @@ var onApplePayButtonClicked = /*#__PURE__*/function () {
14985
15656
  };
14986
15657
  }();
14987
15658
 
14988
- var options$6 = {
15659
+ var options$c = {
14989
15660
  tag: 'monei-payment-request',
14990
15661
  url: config.paymentRequestUrl,
14991
15662
  dimensions: {
@@ -15078,7 +15749,7 @@ var options$6 = {
15078
15749
  }
15079
15750
  }
15080
15751
  };
15081
- var PaymentRequest = /*#__PURE__*/zoid.create(options$6);
15752
+ var PaymentRequest = /*#__PURE__*/zoid.create(options$c);
15082
15753
 
15083
15754
  (function (NextActionType) {
15084
15755
  NextActionType["CONFIRM"] = "CONFIRM";
@@ -15093,6 +15764,15 @@ var utils = _utils;
15093
15764
  exports.Bizum = Bizum;
15094
15765
  exports.BizumModal = BizumModal;
15095
15766
  exports.CardInput = CardInput;
15767
+ exports.Cofidis = Cofidis;
15768
+ exports.CofidisLoan = CofidisLoan;
15769
+ exports.CofidisLoanModal = CofidisLoanModal;
15770
+ exports.CofidisLoanWidget = CofidisLoanWidget;
15771
+ exports.CofidisModal = CofidisModal;
15772
+ exports.CofidisPay = CofidisPay;
15773
+ exports.CofidisPayModal = CofidisPayModal;
15774
+ exports.CofidisPayWidget = CofidisPayWidget;
15775
+ exports.CofidisWidget = CofidisWidget;
15096
15776
  exports.GooglePay = GooglePay;
15097
15777
  exports.PayPal = PayPal;
15098
15778
  exports.PaymentModal = PaymentModal;