@monei-js/components 1.4.0 → 1.5.2
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/api.d.ts +4 -1
- package/dist/cardInput/types.d.ts +1 -0
- package/dist/cofidis/types.d.ts +5 -0
- package/dist/cofidisLoan/container.d.ts +4 -0
- package/dist/cofidisLoan/index.d.ts +7 -0
- package/dist/cofidisLoan/modal.d.ts +4 -0
- package/dist/cofidisLoan/types.d.ts +44 -0
- package/dist/cofidisLoan/widget.d.ts +4 -0
- package/dist/components.cjs.development.js +386 -13
- package/dist/components.cjs.development.js.map +1 -1
- package/dist/components.cjs.production.min.js +1 -1
- package/dist/components.cjs.production.min.js.map +1 -1
- package/dist/components.esm.js +383 -14
- package/dist/components.esm.js.map +1 -1
- package/dist/config.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/paymentRequest/types.d.ts +1 -1
- package/dist/types.d.ts +34 -4
- package/package.json +3 -1
package/dist/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CalculateFinancingRequest, CalculateFinancingResponse, CreateApplePaySessionRequest, CreatePaymentRequest, CreateTokenRequest, CreateTokenResponse, GetPaymentMethodsRequest, GetPaymentMethodsResponse, PaymentResult, SendPaymentReceiptRequest } from './types';
|
|
1
|
+
import { CalculateFinancingRequest, CalculateFinancingResponse, CreateApplePaySessionRequest, CreatePaymentRequest, CreateTokenRequest, CreateTokenResponse, GetPaymentMethodsRequest, GetPaymentMethodsResponse, PaymentResult, SendPaymentReceiptRequest, ValidateBizumPhoneRequest } from './types';
|
|
2
2
|
import { ConfirmPaymentParams } from './paymentModal';
|
|
3
3
|
export declare const getPaymentMethods: ({ accountId, paymentId }: GetPaymentMethodsRequest) => Promise<GetPaymentMethodsResponse>;
|
|
4
4
|
export declare const createToken: ({ paymentMethod, paymentId, sessionId, amount, currency, accountId }: CreateTokenRequest) => Promise<CreateTokenResponse>;
|
|
@@ -8,3 +8,6 @@ export declare const createPayment: ({ signature, ...body }: CreatePaymentReques
|
|
|
8
8
|
export declare const sendPaymentReceipt: ({ paymentId, customerEmail, signature, language }: SendPaymentReceiptRequest) => Promise<PaymentResult>;
|
|
9
9
|
export declare const createApplePaySession: (body: CreateApplePaySessionRequest) => Promise<any>;
|
|
10
10
|
export declare const calculateFinancing: (req: CalculateFinancingRequest) => Promise<CalculateFinancingResponse>;
|
|
11
|
+
export declare const validateBizumPhone: (req: ValidateBizumPhoneRequest) => Promise<{
|
|
12
|
+
isValid: boolean;
|
|
13
|
+
}>;
|
package/dist/cofidis/types.d.ts
CHANGED
|
@@ -29,10 +29,15 @@ export interface CofidisWidgetProps {
|
|
|
29
29
|
amountInt?: number;
|
|
30
30
|
accountId: string;
|
|
31
31
|
language?: string;
|
|
32
|
+
showLogo?: boolean;
|
|
32
33
|
style?: {
|
|
33
34
|
base?: CSSObject;
|
|
34
35
|
link?: CSSObject;
|
|
35
36
|
amount?: CSSObject;
|
|
37
|
+
label?: CSSObject;
|
|
38
|
+
terms?: CSSObject;
|
|
39
|
+
logo?: CSSObject;
|
|
40
|
+
content?: CSSObject;
|
|
36
41
|
};
|
|
37
42
|
onError?: (error: any) => void;
|
|
38
43
|
onLoad?: () => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CofidisLoanProps } from './types';
|
|
2
|
+
import { MoneiComponent } from '../../types/component';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export * from './modal';
|
|
5
|
+
export * from './widget';
|
|
6
|
+
export declare const CofidisLoan: MoneiComponent<CofidisLoanProps>;
|
|
7
|
+
export declare const CofidisPay: MoneiComponent<CofidisLoanProps>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { CSSObject } from '../../types/css';
|
|
2
|
+
export interface CofidisLoanProps {
|
|
3
|
+
paymentId?: string;
|
|
4
|
+
language?: string;
|
|
5
|
+
hint?: boolean;
|
|
6
|
+
onError?: (error: any) => void;
|
|
7
|
+
onProps?: (cb: (props: CofidisLoanProps) => void) => Promise<void>;
|
|
8
|
+
onLoad?: (isSupported: boolean) => void;
|
|
9
|
+
onOpen?: () => void;
|
|
10
|
+
onSubmit: (data: {
|
|
11
|
+
token?: string;
|
|
12
|
+
error?: string;
|
|
13
|
+
redirectUrl?: string;
|
|
14
|
+
}) => void;
|
|
15
|
+
fullscreen?: boolean;
|
|
16
|
+
style?: {
|
|
17
|
+
height?: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface CofidisLoanModalProps extends CofidisLoanProps {
|
|
21
|
+
isOpen?: boolean;
|
|
22
|
+
amount: number;
|
|
23
|
+
currency: string;
|
|
24
|
+
accountId: string;
|
|
25
|
+
onError: (error: any) => void;
|
|
26
|
+
}
|
|
27
|
+
export interface CofidisLoanWidgetProps {
|
|
28
|
+
amount?: number;
|
|
29
|
+
amountInt?: number;
|
|
30
|
+
accountId: string;
|
|
31
|
+
language?: string;
|
|
32
|
+
showLogo?: boolean;
|
|
33
|
+
style?: {
|
|
34
|
+
base?: CSSObject;
|
|
35
|
+
link?: CSSObject;
|
|
36
|
+
amount?: CSSObject;
|
|
37
|
+
label?: CSSObject;
|
|
38
|
+
terms?: CSSObject;
|
|
39
|
+
logo?: CSSObject;
|
|
40
|
+
content?: CSSObject;
|
|
41
|
+
};
|
|
42
|
+
onError?: (error: any) => void;
|
|
43
|
+
onLoad?: () => void;
|
|
44
|
+
}
|
|
@@ -900,7 +900,11 @@ var getLanguage = function getLanguage() {
|
|
|
900
900
|
lang = localStorage.getItem('i18nextLng');
|
|
901
901
|
} catch (error) {}
|
|
902
902
|
|
|
903
|
-
|
|
903
|
+
if (lang) {
|
|
904
|
+
return lang.split('-')[0];
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
return '';
|
|
904
908
|
};
|
|
905
909
|
|
|
906
910
|
var getClientEnv = function getClientEnv() {
|
|
@@ -978,6 +982,9 @@ var globalConfig = {
|
|
|
978
982
|
cofidisUrl: domain + "/" + version + "/inner-cofidis/",
|
|
979
983
|
cofidisButtonUrl: domain + "/" + version + "/inner-cofidis-button/",
|
|
980
984
|
cofidisWidgetUrl: domain + "/" + version + "/inner-cofidis-widget/",
|
|
985
|
+
cofidisLoanUrl: domain + "/" + version + "/inner-cofidis-loan/",
|
|
986
|
+
cofidisLoanButtonUrl: domain + "/" + version + "/inner-cofidis-loan-button/",
|
|
987
|
+
cofidisLoanWidgetUrl: domain + "/" + version + "/inner-cofidis-loan-widget/",
|
|
981
988
|
googlePayUrl: domain + "/" + version + "/inner-google-pay/",
|
|
982
989
|
paymentRequestUrl: domain + "/" + version + "/inner-payment-request/",
|
|
983
990
|
click2PayUrl: domain + "/" + version + "/inner-click2pay/",
|
|
@@ -985,7 +992,7 @@ var globalConfig = {
|
|
|
985
992
|
};
|
|
986
993
|
var stageConfig = {
|
|
987
994
|
local: {
|
|
988
|
-
paymentPageUrl: "http://
|
|
995
|
+
paymentPageUrl: "http://localhost:8080/",
|
|
989
996
|
posPaymentPageUrl: "http://192.168.18.3:8080/",
|
|
990
997
|
cardInputUrl: "http://192.168.18.3:3001/" + version + "/inner-card-input/",
|
|
991
998
|
paymentModalUrl: "http://192.168.18.3:3002/" + version + "/inner-payment-modal/",
|
|
@@ -993,14 +1000,17 @@ var stageConfig = {
|
|
|
993
1000
|
bizumUrl: "http://192.168.18.3:3004/" + version + "/inner-bizum/",
|
|
994
1001
|
bizumButtonUrl: "http://192.168.18.3:3005/" + version + "/inner-bizum-button/",
|
|
995
1002
|
googlePayUrl: "http://192.168.18.3:3006/" + version + "/inner-google-pay/",
|
|
996
|
-
paymentRequestUrl: "https://monei-
|
|
1003
|
+
paymentRequestUrl: "https://monei-local.ngrok.io/" + version + "/inner-payment-request/",
|
|
997
1004
|
click2PayUrl: "http://192.168.18.3:3008/inner-click2pay/",
|
|
998
1005
|
click2PayButtonUrl: "http://192.168.18.3:3009/inner-click2pay-button/",
|
|
999
1006
|
cofidisUrl: "http://192.168.18.3:3010/" + version + "/inner-cofidis/",
|
|
1000
1007
|
cofidisButtonUrl: "http://192.168.18.3:3011/" + version + "/inner-cofidis-button/",
|
|
1001
1008
|
cofidisWidgetUrl: "http://192.168.18.3:3012/" + version + "/inner-cofidis-widget/",
|
|
1002
|
-
|
|
1003
|
-
|
|
1009
|
+
cofidisLoanUrl: "http://192.168.18.3:3013/" + version + "/inner-cofidis-loan/",
|
|
1010
|
+
cofidisLoanButtonUrl: "http://192.168.18.3:3014/" + version + "/inner-cofidis-loan-button/",
|
|
1011
|
+
cofidisLoanWidgetUrl: "http://192.168.18.3:3015/" + version + "/inner-cofidis-loan-widget/",
|
|
1012
|
+
apiUrl: 'https://api.monei.com/v1',
|
|
1013
|
+
secureDomain: 'https://secure.monei.com'
|
|
1004
1014
|
},
|
|
1005
1015
|
dev: {
|
|
1006
1016
|
apiUrl: 'https://api.microapps-staging.com/v1',
|
|
@@ -1323,7 +1333,10 @@ var calculateFinancing = /*#__PURE__*/function () {
|
|
|
1323
1333
|
while (1) {
|
|
1324
1334
|
switch (_context9.prev = _context9.next) {
|
|
1325
1335
|
case 0:
|
|
1326
|
-
return _context9.abrupt("return", request("/calculate-financing
|
|
1336
|
+
return _context9.abrupt("return", request("/cofidis/calculate-financing", {
|
|
1337
|
+
method: 'POST',
|
|
1338
|
+
body: req
|
|
1339
|
+
}));
|
|
1327
1340
|
|
|
1328
1341
|
case 1:
|
|
1329
1342
|
case "end":
|
|
@@ -1337,6 +1350,29 @@ var calculateFinancing = /*#__PURE__*/function () {
|
|
|
1337
1350
|
return _ref15.apply(this, arguments);
|
|
1338
1351
|
};
|
|
1339
1352
|
}();
|
|
1353
|
+
var validateBizumPhone = /*#__PURE__*/function () {
|
|
1354
|
+
var _ref16 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(req) {
|
|
1355
|
+
return runtime_1.wrap(function _callee10$(_context10) {
|
|
1356
|
+
while (1) {
|
|
1357
|
+
switch (_context10.prev = _context10.next) {
|
|
1358
|
+
case 0:
|
|
1359
|
+
return _context10.abrupt("return", request("/bizum/validate-phone", {
|
|
1360
|
+
method: 'POST',
|
|
1361
|
+
body: req
|
|
1362
|
+
}));
|
|
1363
|
+
|
|
1364
|
+
case 1:
|
|
1365
|
+
case "end":
|
|
1366
|
+
return _context10.stop();
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
}, _callee10);
|
|
1370
|
+
}));
|
|
1371
|
+
|
|
1372
|
+
return function validateBizumPhone(_x11) {
|
|
1373
|
+
return _ref16.apply(this, arguments);
|
|
1374
|
+
};
|
|
1375
|
+
}();
|
|
1340
1376
|
|
|
1341
1377
|
var _api = {
|
|
1342
1378
|
__proto__: null,
|
|
@@ -1347,7 +1383,8 @@ var _api = {
|
|
|
1347
1383
|
createPayment: createPayment,
|
|
1348
1384
|
sendPaymentReceipt: sendPaymentReceipt,
|
|
1349
1385
|
createApplePaySession: createApplePaySession,
|
|
1350
|
-
calculateFinancing: calculateFinancing
|
|
1386
|
+
calculateFinancing: calculateFinancing,
|
|
1387
|
+
validateBizumPhone: validateBizumPhone
|
|
1351
1388
|
};
|
|
1352
1389
|
|
|
1353
1390
|
var postRobot = createCommonjsModule(function (module, exports) {
|
|
@@ -14188,6 +14225,14 @@ var options = {
|
|
|
14188
14225
|
type: zoid.PROP_TYPE.OBJECT,
|
|
14189
14226
|
alias: 'innerStyle',
|
|
14190
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
|
+
}
|
|
14191
14236
|
}
|
|
14192
14237
|
},
|
|
14193
14238
|
validate: validateComponentProps,
|
|
@@ -14208,9 +14253,9 @@ var options = {
|
|
|
14208
14253
|
|
|
14209
14254
|
return containerTemplate(params);
|
|
14210
14255
|
},
|
|
14211
|
-
prerenderTemplate: function prerenderTemplate(
|
|
14212
|
-
var doc =
|
|
14213
|
-
props =
|
|
14256
|
+
prerenderTemplate: function prerenderTemplate(_ref3) {
|
|
14257
|
+
var doc = _ref3.doc,
|
|
14258
|
+
props = _ref3.props;
|
|
14214
14259
|
var html = doc.createElement('html');
|
|
14215
14260
|
var body = doc.createElement('body');
|
|
14216
14261
|
body.style.margin = '0';
|
|
@@ -14991,6 +15036,10 @@ var options$6 = {
|
|
|
14991
15036
|
return 'es';
|
|
14992
15037
|
}
|
|
14993
15038
|
},
|
|
15039
|
+
showLogo: {
|
|
15040
|
+
type: zoid.PROP_TYPE.BOOLEAN,
|
|
15041
|
+
required: false
|
|
15042
|
+
},
|
|
14994
15043
|
style: {
|
|
14995
15044
|
type: zoid.PROP_TYPE.OBJECT,
|
|
14996
15045
|
alias: 'innerStyle',
|
|
@@ -15123,8 +15172,313 @@ var options$7 = {
|
|
|
15123
15172
|
};
|
|
15124
15173
|
var Cofidis = /*#__PURE__*/zoid.create(options$7);
|
|
15125
15174
|
|
|
15175
|
+
var EVENT$2;
|
|
15176
|
+
|
|
15177
|
+
(function (EVENT) {
|
|
15178
|
+
EVENT["BEFORE_CLOSE"] = "BEFORE_CLOSE";
|
|
15179
|
+
})(EVENT$2 || (EVENT$2 = {}));
|
|
15180
|
+
|
|
15181
|
+
function containerTemplate$3(_ref) {
|
|
15182
|
+
var uid = _ref.uid,
|
|
15183
|
+
frame = _ref.frame,
|
|
15184
|
+
prerenderFrame = _ref.prerenderFrame,
|
|
15185
|
+
doc = _ref.doc,
|
|
15186
|
+
props = _ref.props,
|
|
15187
|
+
event = _ref.event,
|
|
15188
|
+
_ref$dimensions = _ref.dimensions,
|
|
15189
|
+
width = _ref$dimensions.width,
|
|
15190
|
+
height = _ref$dimensions.height;
|
|
15191
|
+
|
|
15192
|
+
if (!frame || !prerenderFrame) {
|
|
15193
|
+
return;
|
|
15194
|
+
}
|
|
15195
|
+
|
|
15196
|
+
var div = doc.createElement('div');
|
|
15197
|
+
var backdrop = doc.createElement('div');
|
|
15198
|
+
div.setAttribute('id', uid);
|
|
15199
|
+
backdrop.classList.add('backdrop');
|
|
15200
|
+
div.appendChild(backdrop);
|
|
15201
|
+
var style = doc.createElement('style');
|
|
15202
|
+
|
|
15203
|
+
if (props.cspNonce) {
|
|
15204
|
+
style.setAttribute('nonce', props.cspNonce);
|
|
15205
|
+
}
|
|
15206
|
+
|
|
15207
|
+
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 "));
|
|
15208
|
+
div.appendChild(frame);
|
|
15209
|
+
div.appendChild(prerenderFrame);
|
|
15210
|
+
div.appendChild(style);
|
|
15211
|
+
prerenderFrame.classList.add(CLASS.VISIBLE);
|
|
15212
|
+
frame.classList.add(CLASS.INVISIBLE);
|
|
15213
|
+
setTimeout(function () {
|
|
15214
|
+
backdrop.classList.add(CLASS.VISIBLE);
|
|
15215
|
+
}, 1);
|
|
15216
|
+
event.on(zoid.EVENT.RENDERED, function () {
|
|
15217
|
+
prerenderFrame.classList.remove(CLASS.VISIBLE);
|
|
15218
|
+
prerenderFrame.classList.add(CLASS.INVISIBLE);
|
|
15219
|
+
frame.classList.remove(CLASS.INVISIBLE);
|
|
15220
|
+
frame.classList.add(CLASS.VISIBLE);
|
|
15221
|
+
setTimeout(function () {
|
|
15222
|
+
belter$3.destroyElement(prerenderFrame);
|
|
15223
|
+
}, 1);
|
|
15224
|
+
});
|
|
15225
|
+
event.on(EVENT$2.BEFORE_CLOSE, function () {
|
|
15226
|
+
backdrop.classList.remove(CLASS.VISIBLE);
|
|
15227
|
+
});
|
|
15228
|
+
event.on(zoid.EVENT.RESIZE, function (_ref2) {
|
|
15229
|
+
var newWidth = _ref2.width,
|
|
15230
|
+
newHeight = _ref2.height;
|
|
15231
|
+
|
|
15232
|
+
if (typeof newWidth === 'number') {
|
|
15233
|
+
div.style.width = belter$3.toCSS(newWidth);
|
|
15234
|
+
}
|
|
15235
|
+
|
|
15236
|
+
if (typeof newHeight === 'number') {
|
|
15237
|
+
div.style.height = belter$3.toCSS(newHeight);
|
|
15238
|
+
}
|
|
15239
|
+
});
|
|
15240
|
+
return div;
|
|
15241
|
+
}
|
|
15242
|
+
|
|
15126
15243
|
// @ts-ignore
|
|
15127
15244
|
var options$8 = {
|
|
15245
|
+
tag: 'monei-cofidis-loan',
|
|
15246
|
+
url: config.cofidisLoanUrl,
|
|
15247
|
+
dimensions: {
|
|
15248
|
+
width: '100%',
|
|
15249
|
+
height: '100%'
|
|
15250
|
+
},
|
|
15251
|
+
autoResize: {
|
|
15252
|
+
width: false,
|
|
15253
|
+
height: false
|
|
15254
|
+
},
|
|
15255
|
+
prerenderTemplate: function prerenderTemplate() {
|
|
15256
|
+
return undefined;
|
|
15257
|
+
},
|
|
15258
|
+
containerTemplate: containerTemplate$3,
|
|
15259
|
+
props: {
|
|
15260
|
+
paymentId: {
|
|
15261
|
+
type: zoid.PROP_TYPE.STRING,
|
|
15262
|
+
required: false
|
|
15263
|
+
},
|
|
15264
|
+
amount: {
|
|
15265
|
+
type: zoid.PROP_TYPE.NUMBER,
|
|
15266
|
+
required: false
|
|
15267
|
+
},
|
|
15268
|
+
currency: {
|
|
15269
|
+
type: zoid.PROP_TYPE.STRING,
|
|
15270
|
+
required: false
|
|
15271
|
+
},
|
|
15272
|
+
language: {
|
|
15273
|
+
type: zoid.PROP_TYPE.STRING,
|
|
15274
|
+
required: false
|
|
15275
|
+
},
|
|
15276
|
+
onError: {
|
|
15277
|
+
type: zoid.PROP_TYPE.FUNCTION,
|
|
15278
|
+
required: false
|
|
15279
|
+
},
|
|
15280
|
+
onLoad: {
|
|
15281
|
+
type: zoid.PROP_TYPE.FUNCTION,
|
|
15282
|
+
required: false
|
|
15283
|
+
},
|
|
15284
|
+
onSubmit: {
|
|
15285
|
+
type: zoid.PROP_TYPE.FUNCTION,
|
|
15286
|
+
required: false
|
|
15287
|
+
},
|
|
15288
|
+
onOpen: {
|
|
15289
|
+
type: zoid.PROP_TYPE.FUNCTION,
|
|
15290
|
+
required: false
|
|
15291
|
+
},
|
|
15292
|
+
onBeforeClose: {
|
|
15293
|
+
type: zoid.PROP_TYPE.FUNCTION,
|
|
15294
|
+
required: false,
|
|
15295
|
+
"default": function _default(_ref) {
|
|
15296
|
+
var event = _ref.event;
|
|
15297
|
+
return function () {
|
|
15298
|
+
event.trigger(EVENT$2.BEFORE_CLOSE);
|
|
15299
|
+
};
|
|
15300
|
+
}
|
|
15301
|
+
}
|
|
15302
|
+
}
|
|
15303
|
+
};
|
|
15304
|
+
var CofidisLoanModal = /*#__PURE__*/zoid.create(options$8);
|
|
15305
|
+
var CofidisPayModal = CofidisLoanModal;
|
|
15306
|
+
|
|
15307
|
+
// @ts-ignore
|
|
15308
|
+
var options$9 = {
|
|
15309
|
+
tag: 'monei-cofidis-loan-widget',
|
|
15310
|
+
url: config.cofidisLoanWidgetUrl,
|
|
15311
|
+
dimensions: {
|
|
15312
|
+
width: '100%',
|
|
15313
|
+
height: '46px'
|
|
15314
|
+
},
|
|
15315
|
+
autoResize: {
|
|
15316
|
+
width: false,
|
|
15317
|
+
height: true
|
|
15318
|
+
},
|
|
15319
|
+
prerenderTemplate: function prerenderTemplate() {
|
|
15320
|
+
return undefined;
|
|
15321
|
+
},
|
|
15322
|
+
props: {
|
|
15323
|
+
accountId: {
|
|
15324
|
+
type: zoid.PROP_TYPE.STRING,
|
|
15325
|
+
required: true
|
|
15326
|
+
},
|
|
15327
|
+
amount: {
|
|
15328
|
+
type: zoid.PROP_TYPE.NUMBER,
|
|
15329
|
+
required: false
|
|
15330
|
+
},
|
|
15331
|
+
amountInt: {
|
|
15332
|
+
type: zoid.PROP_TYPE.NUMBER,
|
|
15333
|
+
required: false
|
|
15334
|
+
},
|
|
15335
|
+
language: {
|
|
15336
|
+
type: zoid.PROP_TYPE.STRING,
|
|
15337
|
+
required: false,
|
|
15338
|
+
"default": function _default() {
|
|
15339
|
+
return 'es';
|
|
15340
|
+
}
|
|
15341
|
+
},
|
|
15342
|
+
showLogo: {
|
|
15343
|
+
type: zoid.PROP_TYPE.BOOLEAN,
|
|
15344
|
+
required: false
|
|
15345
|
+
},
|
|
15346
|
+
style: {
|
|
15347
|
+
type: zoid.PROP_TYPE.OBJECT,
|
|
15348
|
+
alias: 'innerStyle',
|
|
15349
|
+
required: false
|
|
15350
|
+
},
|
|
15351
|
+
onError: {
|
|
15352
|
+
type: zoid.PROP_TYPE.FUNCTION,
|
|
15353
|
+
required: false
|
|
15354
|
+
},
|
|
15355
|
+
onLoad: {
|
|
15356
|
+
type: zoid.PROP_TYPE.FUNCTION,
|
|
15357
|
+
required: false
|
|
15358
|
+
},
|
|
15359
|
+
__onClick: {
|
|
15360
|
+
type: zoid.PROP_TYPE.FUNCTION,
|
|
15361
|
+
required: false,
|
|
15362
|
+
value: function value() {
|
|
15363
|
+
return function (url) {
|
|
15364
|
+
window.open(url, '_blank');
|
|
15365
|
+
};
|
|
15366
|
+
}
|
|
15367
|
+
}
|
|
15368
|
+
}
|
|
15369
|
+
};
|
|
15370
|
+
var CofidisLoanWidget = /*#__PURE__*/zoid.create(options$9);
|
|
15371
|
+
var CofidisPayWidget = CofidisLoanWidget;
|
|
15372
|
+
|
|
15373
|
+
var options$a = {
|
|
15374
|
+
tag: 'monei-cofidis-loan-button',
|
|
15375
|
+
url: config.cofidisLoanButtonUrl,
|
|
15376
|
+
dimensions: {
|
|
15377
|
+
width: '100%',
|
|
15378
|
+
height: '45px'
|
|
15379
|
+
},
|
|
15380
|
+
autoResize: {
|
|
15381
|
+
width: false,
|
|
15382
|
+
height: true
|
|
15383
|
+
},
|
|
15384
|
+
validate: validateComponentProps,
|
|
15385
|
+
containerTemplate: containerTemplate,
|
|
15386
|
+
prerenderTemplate: function prerenderTemplate() {
|
|
15387
|
+
return undefined;
|
|
15388
|
+
},
|
|
15389
|
+
props: {
|
|
15390
|
+
paymentId: {
|
|
15391
|
+
type: zoid.PROP_TYPE.STRING,
|
|
15392
|
+
required: false
|
|
15393
|
+
},
|
|
15394
|
+
language: {
|
|
15395
|
+
type: zoid.PROP_TYPE.STRING,
|
|
15396
|
+
required: false
|
|
15397
|
+
},
|
|
15398
|
+
hint: {
|
|
15399
|
+
type: zoid.PROP_TYPE.BOOLEAN,
|
|
15400
|
+
"default": function _default() {
|
|
15401
|
+
return true;
|
|
15402
|
+
},
|
|
15403
|
+
required: false
|
|
15404
|
+
},
|
|
15405
|
+
onError: {
|
|
15406
|
+
type: zoid.PROP_TYPE.FUNCTION,
|
|
15407
|
+
required: false
|
|
15408
|
+
},
|
|
15409
|
+
onLoad: {
|
|
15410
|
+
type: zoid.PROP_TYPE.FUNCTION,
|
|
15411
|
+
required: false
|
|
15412
|
+
},
|
|
15413
|
+
onOpen: {
|
|
15414
|
+
type: zoid.PROP_TYPE.FUNCTION,
|
|
15415
|
+
required: false
|
|
15416
|
+
},
|
|
15417
|
+
style: {
|
|
15418
|
+
type: zoid.PROP_TYPE.OBJECT,
|
|
15419
|
+
alias: 'innerStyle',
|
|
15420
|
+
required: false
|
|
15421
|
+
},
|
|
15422
|
+
__getConfig: {
|
|
15423
|
+
type: zoid.PROP_TYPE.FUNCTION,
|
|
15424
|
+
required: false,
|
|
15425
|
+
value: function value(_ref) {
|
|
15426
|
+
var props = _ref.props;
|
|
15427
|
+
return getPaymentMethods.bind(null, props);
|
|
15428
|
+
}
|
|
15429
|
+
},
|
|
15430
|
+
__onHintClick: {
|
|
15431
|
+
type: zoid.PROP_TYPE.FUNCTION,
|
|
15432
|
+
required: false,
|
|
15433
|
+
value: function value() {
|
|
15434
|
+
return function (url) {
|
|
15435
|
+
window.open(url, '_blank');
|
|
15436
|
+
};
|
|
15437
|
+
}
|
|
15438
|
+
},
|
|
15439
|
+
__onClick: {
|
|
15440
|
+
type: zoid.PROP_TYPE.FUNCTION,
|
|
15441
|
+
required: false,
|
|
15442
|
+
value: function value(_ref2) {
|
|
15443
|
+
var props = _ref2.props;
|
|
15444
|
+
var rootNode = document.createElement('div');
|
|
15445
|
+
document.body.appendChild(rootNode);
|
|
15446
|
+
return function (_ref3) {
|
|
15447
|
+
var amount = _ref3.amount,
|
|
15448
|
+
currency = _ref3.currency,
|
|
15449
|
+
accountId = _ref3.accountId;
|
|
15450
|
+
var cofidisModal = new CofidisLoanModal(_extends({}, props, {
|
|
15451
|
+
amount: amount,
|
|
15452
|
+
currency: currency,
|
|
15453
|
+
accountId: accountId,
|
|
15454
|
+
onClose: function onClose() {
|
|
15455
|
+
window.onpopstate = null;
|
|
15456
|
+
document.body.style.overflow = '';
|
|
15457
|
+
},
|
|
15458
|
+
isOpen: true
|
|
15459
|
+
}));
|
|
15460
|
+
window.history.pushState(null, '', window.location.href);
|
|
15461
|
+
|
|
15462
|
+
window.onpopstate = function () {
|
|
15463
|
+
return cofidisModal.updateProps({
|
|
15464
|
+
isOpen: false
|
|
15465
|
+
});
|
|
15466
|
+
};
|
|
15467
|
+
|
|
15468
|
+
Object.assign(document.body.style, {
|
|
15469
|
+
overflow: 'hidden'
|
|
15470
|
+
});
|
|
15471
|
+
return cofidisModal.render(rootNode);
|
|
15472
|
+
};
|
|
15473
|
+
}
|
|
15474
|
+
}
|
|
15475
|
+
}
|
|
15476
|
+
};
|
|
15477
|
+
var CofidisLoan = /*#__PURE__*/zoid.create(options$a);
|
|
15478
|
+
var CofidisPay = CofidisLoan;
|
|
15479
|
+
|
|
15480
|
+
// @ts-ignore
|
|
15481
|
+
var options$b = {
|
|
15128
15482
|
tag: 'monei-google-pay',
|
|
15129
15483
|
url: config.googlePayUrl,
|
|
15130
15484
|
dimensions: {
|
|
@@ -15196,7 +15550,7 @@ var options$8 = {
|
|
|
15196
15550
|
}
|
|
15197
15551
|
}
|
|
15198
15552
|
};
|
|
15199
|
-
var GooglePay = /*#__PURE__*/zoid.create(options$
|
|
15553
|
+
var GooglePay = /*#__PURE__*/zoid.create(options$b);
|
|
15200
15554
|
|
|
15201
15555
|
var onApplePayButtonClicked = /*#__PURE__*/function () {
|
|
15202
15556
|
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(props, request, context) {
|
|
@@ -15314,7 +15668,7 @@ var onApplePayButtonClicked = /*#__PURE__*/function () {
|
|
|
15314
15668
|
};
|
|
15315
15669
|
}();
|
|
15316
15670
|
|
|
15317
|
-
var options$
|
|
15671
|
+
var options$c = {
|
|
15318
15672
|
tag: 'monei-payment-request',
|
|
15319
15673
|
url: config.paymentRequestUrl,
|
|
15320
15674
|
dimensions: {
|
|
@@ -15407,7 +15761,7 @@ var options$9 = {
|
|
|
15407
15761
|
}
|
|
15408
15762
|
}
|
|
15409
15763
|
};
|
|
15410
|
-
var PaymentRequest = /*#__PURE__*/zoid.create(options$
|
|
15764
|
+
var PaymentRequest = /*#__PURE__*/zoid.create(options$c);
|
|
15411
15765
|
|
|
15412
15766
|
(function (NextActionType) {
|
|
15413
15767
|
NextActionType["CONFIRM"] = "CONFIRM";
|
|
@@ -15416,6 +15770,19 @@ var PaymentRequest = /*#__PURE__*/zoid.create(options$9);
|
|
|
15416
15770
|
NextActionType["COMPLETE"] = "COMPLETE";
|
|
15417
15771
|
})(exports.NextActionType || (exports.NextActionType = {}));
|
|
15418
15772
|
|
|
15773
|
+
(function (CardBrand) {
|
|
15774
|
+
CardBrand["Visa"] = "visa";
|
|
15775
|
+
CardBrand["Mastercard"] = "mastercard";
|
|
15776
|
+
CardBrand["Amex"] = "amex";
|
|
15777
|
+
CardBrand["Discover"] = "discover";
|
|
15778
|
+
CardBrand["Diners"] = "diners";
|
|
15779
|
+
CardBrand["JCB"] = "jcb";
|
|
15780
|
+
CardBrand["Maestro"] = "maestro";
|
|
15781
|
+
CardBrand["UnionPay"] = "unionpay";
|
|
15782
|
+
CardBrand["Elo"] = "elo";
|
|
15783
|
+
CardBrand["Hipercard"] = "hipercard";
|
|
15784
|
+
})(exports.CardBrand || (exports.CardBrand = {}));
|
|
15785
|
+
|
|
15419
15786
|
var api = _api;
|
|
15420
15787
|
var utils = _utils;
|
|
15421
15788
|
|
|
@@ -15423,7 +15790,13 @@ exports.Bizum = Bizum;
|
|
|
15423
15790
|
exports.BizumModal = BizumModal;
|
|
15424
15791
|
exports.CardInput = CardInput;
|
|
15425
15792
|
exports.Cofidis = Cofidis;
|
|
15793
|
+
exports.CofidisLoan = CofidisLoan;
|
|
15794
|
+
exports.CofidisLoanModal = CofidisLoanModal;
|
|
15795
|
+
exports.CofidisLoanWidget = CofidisLoanWidget;
|
|
15426
15796
|
exports.CofidisModal = CofidisModal;
|
|
15797
|
+
exports.CofidisPay = CofidisPay;
|
|
15798
|
+
exports.CofidisPayModal = CofidisPayModal;
|
|
15799
|
+
exports.CofidisPayWidget = CofidisPayWidget;
|
|
15427
15800
|
exports.CofidisWidget = CofidisWidget;
|
|
15428
15801
|
exports.GooglePay = GooglePay;
|
|
15429
15802
|
exports.PayPal = PayPal;
|