@funnelfox/billing 0.5.0-beta.2 → 0.5.0-beta.4
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/chunk-index.cjs.js +30 -24
- package/dist/chunk-index.cjs2.js +35 -11
- package/dist/chunk-index.es.js +24 -18
- package/dist/chunk-index.es2.js +35 -11
- package/dist/funnelfox-billing.cjs.js +133 -34
- package/dist/funnelfox-billing.esm.js +133 -34
- package/dist/funnelfox-billing.js +193 -64
- package/dist/funnelfox-billing.min.js +1 -1
- package/package.json +3 -3
- package/src/types.d.ts +36 -17
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
/**
|
|
220
220
|
* @fileoverview Constants for Funnefox SDK
|
|
221
221
|
*/
|
|
222
|
-
const SDK_VERSION = '0.5.0-beta.
|
|
222
|
+
const SDK_VERSION = '0.5.0-beta.4';
|
|
223
223
|
const DEFAULTS = {
|
|
224
224
|
BASE_URL: 'https://billing.funnelfox.com',
|
|
225
225
|
REGION: 'default',
|
|
@@ -251,6 +251,7 @@
|
|
|
251
251
|
PURCHASE_FAILURE: 'purchase-failure',
|
|
252
252
|
PURCHASE_COMPLETED: 'purchase-completed',
|
|
253
253
|
PURCHASE_CANCELLED: 'purchase-cancelled',
|
|
254
|
+
METHODS_AVAILABLE: 'methods-available',
|
|
254
255
|
};
|
|
255
256
|
const API_ENDPOINTS = {
|
|
256
257
|
CREATE_CLIENT_SESSION: '/v1/checkout/create_client_session',
|
|
@@ -297,6 +298,12 @@
|
|
|
297
298
|
({
|
|
298
299
|
paddingLeft: inputStyle.input.base.paddingHorizontal + 'px',
|
|
299
300
|
paddingRight: inputStyle.input.base.paddingHorizontal + 'px'});
|
|
301
|
+
const DEFAULT_PAYMENT_METHOD_ORDER = [
|
|
302
|
+
exports.PaymentMethod.APPLE_PAY,
|
|
303
|
+
exports.PaymentMethod.GOOGLE_PAY,
|
|
304
|
+
exports.PaymentMethod.PAYPAL,
|
|
305
|
+
exports.PaymentMethod.PAYMENT_CARD,
|
|
306
|
+
];
|
|
300
307
|
|
|
301
308
|
/**
|
|
302
309
|
* @fileoverview Primer SDK integration wrapper
|
|
@@ -307,6 +314,7 @@
|
|
|
307
314
|
this.destroyCallbacks = [];
|
|
308
315
|
this.headless = null;
|
|
309
316
|
this.availableMethods = [];
|
|
317
|
+
this.paymentMethodsInterfaces = [];
|
|
310
318
|
}
|
|
311
319
|
isPrimerAvailable() {
|
|
312
320
|
return (typeof window !== 'undefined' &&
|
|
@@ -339,9 +347,39 @@
|
|
|
339
347
|
disableButtons(disabled) {
|
|
340
348
|
if (!this.paymentMethodsInterfaces)
|
|
341
349
|
return;
|
|
342
|
-
for (const
|
|
343
|
-
|
|
344
|
-
}
|
|
350
|
+
for (const paymentMethodInterface of this.paymentMethodsInterfaces) {
|
|
351
|
+
paymentMethodInterface.setDisabled(disabled);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
waitForPayPalReady() {
|
|
355
|
+
return new Promise((resolve, reject) => {
|
|
356
|
+
let counter = 0;
|
|
357
|
+
const checkPayPalEnabler = async () => {
|
|
358
|
+
/**
|
|
359
|
+
* Wait 1000 seconds for PayPal SDK to initialize
|
|
360
|
+
*/
|
|
361
|
+
await new Promise(resolve => {
|
|
362
|
+
setTimeout(() => {
|
|
363
|
+
resolve();
|
|
364
|
+
}, 1000);
|
|
365
|
+
});
|
|
366
|
+
/**
|
|
367
|
+
* @link https://github.com/krakenjs/zoid/issues/334
|
|
368
|
+
*/
|
|
369
|
+
// @ts-expect-error paymentMethod is private property
|
|
370
|
+
const isPayPalReady = !!window?.paypalPrimer?.Buttons?.instances?.[0];
|
|
371
|
+
if (++counter < 20 && !isPayPalReady) {
|
|
372
|
+
setTimeout(checkPayPalEnabler, 0);
|
|
373
|
+
}
|
|
374
|
+
else if (!isPayPalReady) {
|
|
375
|
+
reject(new PrimerError('PayPal paypal_js_sdk_v5_unhandled_exception was detected', exports.PaymentMethod.PAYPAL));
|
|
376
|
+
}
|
|
377
|
+
else {
|
|
378
|
+
resolve();
|
|
379
|
+
}
|
|
380
|
+
};
|
|
381
|
+
checkPayPalEnabler();
|
|
382
|
+
});
|
|
345
383
|
}
|
|
346
384
|
async renderButton(allowedPaymentMethod, { htmlNode, onMethodRenderError, onMethodRender, }) {
|
|
347
385
|
let button;
|
|
@@ -356,6 +394,9 @@
|
|
|
356
394
|
}
|
|
357
395
|
button = pmManager.createButton();
|
|
358
396
|
await button.render(htmlNode, {});
|
|
397
|
+
if (allowedPaymentMethod === exports.PaymentMethod.PAYPAL) {
|
|
398
|
+
await this.waitForPayPalReady();
|
|
399
|
+
}
|
|
359
400
|
this.destroyCallbacks.push(() => button.clean());
|
|
360
401
|
onMethodRender(allowedPaymentMethod);
|
|
361
402
|
return {
|
|
@@ -377,20 +418,24 @@
|
|
|
377
418
|
!options.onInputChange) {
|
|
378
419
|
throw new PrimerError('Card elements, onSubmit, and onInputChange are required for PAYMENT_CARD method');
|
|
379
420
|
}
|
|
380
|
-
|
|
421
|
+
const cardInterface = await this.renderCardCheckoutWithElements(options.cardElements, {
|
|
381
422
|
onSubmit: options.onSubmit,
|
|
382
423
|
onInputChange: options.onInputChange,
|
|
383
424
|
onMethodRenderError: options.onMethodRenderError,
|
|
384
425
|
onMethodRender: options.onMethodRender,
|
|
385
426
|
});
|
|
427
|
+
this.paymentMethodsInterfaces.push(cardInterface);
|
|
428
|
+
return cardInterface;
|
|
386
429
|
}
|
|
387
430
|
else {
|
|
388
431
|
try {
|
|
389
|
-
|
|
432
|
+
const buttonInterface = await this.renderButton(method, {
|
|
390
433
|
htmlNode,
|
|
391
434
|
onMethodRenderError: options.onMethodRenderError,
|
|
392
435
|
onMethodRender: options.onMethodRender,
|
|
393
436
|
});
|
|
437
|
+
this.paymentMethodsInterfaces.push(buttonInterface);
|
|
438
|
+
return buttonInterface;
|
|
394
439
|
}
|
|
395
440
|
catch (error) {
|
|
396
441
|
throw new PrimerError('Failed to initialize Primer checkout', error);
|
|
@@ -465,8 +510,8 @@
|
|
|
465
510
|
]);
|
|
466
511
|
const onDestroy = () => {
|
|
467
512
|
pmManager.removeHostedInputs();
|
|
468
|
-
elements.cardholderName
|
|
469
|
-
elements.button
|
|
513
|
+
elements.cardholderName?.removeEventListener('change', cardHolderOnChange);
|
|
514
|
+
elements.button?.removeEventListener('click', onSubmitHandler);
|
|
470
515
|
};
|
|
471
516
|
this.destroyCallbacks.push(onDestroy);
|
|
472
517
|
onMethodRender(exports.PaymentMethod.PAYMENT_CARD);
|
|
@@ -475,7 +520,12 @@
|
|
|
475
520
|
cardNumberInput.setDisabled(disabled);
|
|
476
521
|
expiryInput.setDisabled(disabled);
|
|
477
522
|
cvvInput.setDisabled(disabled);
|
|
478
|
-
elements.button
|
|
523
|
+
if (elements.button) {
|
|
524
|
+
elements.button.disabled = disabled;
|
|
525
|
+
}
|
|
526
|
+
if (elements.cardholderName) {
|
|
527
|
+
elements.cardholderName.disabled = disabled;
|
|
528
|
+
}
|
|
479
529
|
},
|
|
480
530
|
submit: () => onSubmitHandler(),
|
|
481
531
|
destroy: () => {
|
|
@@ -514,12 +564,13 @@
|
|
|
514
564
|
});
|
|
515
565
|
}
|
|
516
566
|
async renderCheckout(clientToken, checkoutOptions, checkoutRenderOptions) {
|
|
517
|
-
const { cardElements, paymentButtonElements, container, onSubmit, onInputChange, onMethodRender, onMethodRenderError, } = checkoutRenderOptions;
|
|
567
|
+
const { cardElements, paymentButtonElements, container, onSubmit, onInputChange, onMethodRender, onMethodRenderError, onMethodsAvailable, } = checkoutRenderOptions;
|
|
518
568
|
await this.initializeHeadlessCheckout(clientToken, checkoutOptions);
|
|
519
|
-
|
|
569
|
+
onMethodsAvailable?.(this.availableMethods);
|
|
570
|
+
await Promise.all(this.availableMethods.map(method => {
|
|
520
571
|
if (method === exports.PaymentMethod.PAYMENT_CARD) {
|
|
521
572
|
// For card, use the main container
|
|
522
|
-
|
|
573
|
+
return this.initMethod(method, container, {
|
|
523
574
|
cardElements,
|
|
524
575
|
onSubmit,
|
|
525
576
|
onInputChange,
|
|
@@ -535,12 +586,12 @@
|
|
|
535
586
|
};
|
|
536
587
|
// For buttons, use the specific button container element
|
|
537
588
|
const buttonElement = buttonElementsMap[method];
|
|
538
|
-
|
|
589
|
+
return this.initMethod(method, buttonElement, {
|
|
539
590
|
onMethodRender,
|
|
540
591
|
onMethodRenderError,
|
|
541
592
|
});
|
|
542
593
|
}
|
|
543
|
-
}
|
|
594
|
+
}));
|
|
544
595
|
this.isInitialized = true;
|
|
545
596
|
}
|
|
546
597
|
wrapTokenizeHandler(handler) {
|
|
@@ -836,12 +887,6 @@
|
|
|
836
887
|
constructor(config) {
|
|
837
888
|
super();
|
|
838
889
|
this.counter = 0;
|
|
839
|
-
this.paymentMethodOrder = [
|
|
840
|
-
exports.PaymentMethod.APPLE_PAY,
|
|
841
|
-
exports.PaymentMethod.GOOGLE_PAY,
|
|
842
|
-
exports.PaymentMethod.PAYPAL,
|
|
843
|
-
exports.PaymentMethod.PAYMENT_CARD,
|
|
844
|
-
];
|
|
845
890
|
this.handleInputChange = (inputName, error) => {
|
|
846
891
|
this.emit(EVENTS.INPUT_ERROR, { name: inputName, error });
|
|
847
892
|
};
|
|
@@ -898,8 +943,12 @@
|
|
|
898
943
|
this._setState('ready');
|
|
899
944
|
}
|
|
900
945
|
};
|
|
946
|
+
this.handleMethodsAvailable = (methods) => {
|
|
947
|
+
this.emit(EVENTS.METHODS_AVAILABLE, methods);
|
|
948
|
+
};
|
|
901
949
|
this.onLoaderChangeWithRace = (state) => {
|
|
902
950
|
const isLoading = !!(state ? ++this.counter : --this.counter);
|
|
951
|
+
this.primerWrapper.disableButtons(isLoading);
|
|
903
952
|
this.emit(EVENTS.LOADER_CHANGE, isLoading);
|
|
904
953
|
};
|
|
905
954
|
this.id = generateId('checkout_');
|
|
@@ -967,14 +1016,32 @@
|
|
|
967
1016
|
timeout: DEFAULTS.REQUEST_TIMEOUT,
|
|
968
1017
|
retryAttempts: DEFAULTS.RETRY_ATTEMPTS,
|
|
969
1018
|
});
|
|
970
|
-
const
|
|
1019
|
+
const sessionParams = {
|
|
971
1020
|
priceId: this.checkoutConfig.priceId,
|
|
972
1021
|
externalId: this.checkoutConfig.customer.externalId,
|
|
973
1022
|
email: this.checkoutConfig.customer.email,
|
|
974
1023
|
region: this.region || DEFAULTS.REGION,
|
|
975
1024
|
clientMetadata: this.checkoutConfig.clientMetadata,
|
|
976
1025
|
countryCode: this.checkoutConfig.customer.countryCode,
|
|
977
|
-
}
|
|
1026
|
+
};
|
|
1027
|
+
const cacheKey = [
|
|
1028
|
+
this.orgId,
|
|
1029
|
+
this.checkoutConfig.priceId,
|
|
1030
|
+
this.checkoutConfig.customer.externalId,
|
|
1031
|
+
this.checkoutConfig.customer.email,
|
|
1032
|
+
].join('-');
|
|
1033
|
+
let sessionResponse;
|
|
1034
|
+
// Return cached response if payload hasn't changed
|
|
1035
|
+
const cachedResponse = await CheckoutInstance.sessionCache.get(cacheKey);
|
|
1036
|
+
if (cachedResponse) {
|
|
1037
|
+
sessionResponse = cachedResponse;
|
|
1038
|
+
}
|
|
1039
|
+
else {
|
|
1040
|
+
const sessionRequest = this.apiClient.createClientSession(sessionParams);
|
|
1041
|
+
// Cache the successful response
|
|
1042
|
+
CheckoutInstance.sessionCache.set(cacheKey, sessionRequest);
|
|
1043
|
+
sessionResponse = await sessionRequest;
|
|
1044
|
+
}
|
|
978
1045
|
const sessionData = this.apiClient.processSessionResponse(sessionResponse);
|
|
979
1046
|
this.orderId = sessionData.orderId;
|
|
980
1047
|
this.clientToken = sessionData.clientToken;
|
|
@@ -1021,9 +1088,8 @@
|
|
|
1021
1088
|
let checkoutOptions;
|
|
1022
1089
|
if (!this.checkoutConfig.cardSelectors ||
|
|
1023
1090
|
!this.checkoutConfig.paymentButtonSelectors) {
|
|
1024
|
-
|
|
1025
|
-
this.paymentMethodOrder
|
|
1026
|
-
}
|
|
1091
|
+
this.checkoutConfig.paymentMethodOrder =
|
|
1092
|
+
this.checkoutConfig.paymentMethodOrder || DEFAULT_PAYMENT_METHOD_ORDER;
|
|
1027
1093
|
const defaultSkinCheckoutOptions = await this.getDefaultSkinCheckoutOptions();
|
|
1028
1094
|
if (!defaultSkinCheckoutOptions.cardElements ||
|
|
1029
1095
|
!defaultSkinCheckoutOptions.paymentButtonElements) {
|
|
@@ -1035,14 +1101,14 @@
|
|
|
1035
1101
|
checkoutOptions = this.getCheckoutOptions(defaultSkinCheckoutOptions);
|
|
1036
1102
|
}
|
|
1037
1103
|
else {
|
|
1104
|
+
if (this.checkoutConfig.paymentMethodOrder) {
|
|
1105
|
+
// eslint-disable-next-line no-console
|
|
1106
|
+
console.warn('paymentMethodOrder is using only for default skin and will be ignored if you are using custom checkout');
|
|
1107
|
+
}
|
|
1038
1108
|
cardElements = this.convertCardSelectorsToElements(this.checkoutConfig.cardSelectors, containerElement);
|
|
1039
1109
|
paymentButtonElements = this.convertPaymentButtonSelectorsToElements(this.checkoutConfig.paymentButtonSelectors);
|
|
1040
1110
|
checkoutOptions = this.getCheckoutOptions({});
|
|
1041
1111
|
}
|
|
1042
|
-
if (this.checkoutConfig.paymentMethodOrder) {
|
|
1043
|
-
// eslint-disable-next-line no-console
|
|
1044
|
-
console.warn('paymentMethodOrder is using only for default skin and will be ignored if you are using custom checkout');
|
|
1045
|
-
}
|
|
1046
1112
|
await this.primerWrapper.renderCheckout(this.clientToken, checkoutOptions, {
|
|
1047
1113
|
container: containerElement,
|
|
1048
1114
|
cardElements,
|
|
@@ -1050,6 +1116,8 @@
|
|
|
1050
1116
|
onSubmit: this.handleSubmit,
|
|
1051
1117
|
onInputChange: this.handleInputChange,
|
|
1052
1118
|
onMethodRender: this.handleMethodRender,
|
|
1119
|
+
onMethodsAvailable: this.handleMethodsAvailable,
|
|
1120
|
+
onMethodRenderError: this.handleMethodRenderError,
|
|
1053
1121
|
});
|
|
1054
1122
|
}
|
|
1055
1123
|
async _processPaymentResult(result, primerHandler) {
|
|
@@ -1130,6 +1198,8 @@
|
|
|
1130
1198
|
}
|
|
1131
1199
|
try {
|
|
1132
1200
|
this._setState('updating');
|
|
1201
|
+
// Invalidate session cache
|
|
1202
|
+
CheckoutInstance.sessionCache.clear();
|
|
1133
1203
|
await this.apiClient.updateClientSession({
|
|
1134
1204
|
orderId: this.orderId,
|
|
1135
1205
|
clientToken: this.clientToken,
|
|
@@ -1199,7 +1269,7 @@
|
|
|
1199
1269
|
async getDefaultSkinCheckoutOptions() {
|
|
1200
1270
|
const skinFactory = (await Promise.resolve().then(function () { return index; }))
|
|
1201
1271
|
.default;
|
|
1202
|
-
const skin = await skinFactory(this.
|
|
1272
|
+
const skin = await skinFactory(this.checkoutConfig);
|
|
1203
1273
|
this.on(EVENTS.INPUT_ERROR, skin.onInputError);
|
|
1204
1274
|
this.on(EVENTS.STATUS_CHANGE, skin.onStatusChange);
|
|
1205
1275
|
this.on(EVENTS.ERROR, (error) => skin.onError(error));
|
|
@@ -1210,13 +1280,16 @@
|
|
|
1210
1280
|
this.on(EVENTS.START_PURCHASE, skin.onStartPurchase);
|
|
1211
1281
|
this.on(EVENTS.PURCHASE_FAILURE, skin.onPurchaseFailure);
|
|
1212
1282
|
this.on(EVENTS.PURCHASE_COMPLETED, skin.onPurchaseCompleted);
|
|
1283
|
+
this.on(EVENTS.METHODS_AVAILABLE, skin.onMethodsAvailable);
|
|
1213
1284
|
return skin.getCheckoutOptions();
|
|
1214
1285
|
}
|
|
1215
1286
|
async getCardDefaultSkinCheckoutOptions(node) {
|
|
1216
1287
|
const CardSkin = (await Promise.resolve().then(function () { return index$1; })).default;
|
|
1217
|
-
const skin = new CardSkin(node);
|
|
1288
|
+
const skin = new CardSkin(node, this.checkoutConfig);
|
|
1218
1289
|
skin.init();
|
|
1219
1290
|
this.on(EVENTS.INPUT_ERROR, skin.onInputError);
|
|
1291
|
+
this.on(EVENTS.METHOD_RENDER, skin.onMethodRender);
|
|
1292
|
+
this.on(EVENTS.SUCCESS, skin.onDestroy);
|
|
1220
1293
|
return skin.getCheckoutOptions();
|
|
1221
1294
|
}
|
|
1222
1295
|
showInitializingLoader() {
|
|
@@ -1226,6 +1299,7 @@
|
|
|
1226
1299
|
hideLoader();
|
|
1227
1300
|
}
|
|
1228
1301
|
}
|
|
1302
|
+
CheckoutInstance.sessionCache = new Map();
|
|
1229
1303
|
|
|
1230
1304
|
/**
|
|
1231
1305
|
* @fileoverview Public API with configuration and orchestration logic
|
|
@@ -1281,6 +1355,28 @@
|
|
|
1281
1355
|
});
|
|
1282
1356
|
return apiClient.processSessionResponse(sessionResponse);
|
|
1283
1357
|
}
|
|
1358
|
+
async function silentPurchase(options) {
|
|
1359
|
+
const { priceId, externalId, clientMetadata, orgId, baseUrl } = options;
|
|
1360
|
+
const apiClient = new APIClient({
|
|
1361
|
+
baseUrl: baseUrl,
|
|
1362
|
+
orgId: orgId,
|
|
1363
|
+
timeout: DEFAULTS.REQUEST_TIMEOUT,
|
|
1364
|
+
retryAttempts: DEFAULTS.RETRY_ATTEMPTS,
|
|
1365
|
+
});
|
|
1366
|
+
const response = await apiClient.oneClick({
|
|
1367
|
+
pp_ident: priceId,
|
|
1368
|
+
external_id: externalId,
|
|
1369
|
+
client_metadata: clientMetadata,
|
|
1370
|
+
});
|
|
1371
|
+
if (response.status !== 'success' &&
|
|
1372
|
+
response.error.some(({ code }) => code === 'double_purchase')) {
|
|
1373
|
+
throw new APIError('This product was already purchased');
|
|
1374
|
+
}
|
|
1375
|
+
else if (response.status !== 'success') {
|
|
1376
|
+
return false;
|
|
1377
|
+
}
|
|
1378
|
+
return true;
|
|
1379
|
+
}
|
|
1284
1380
|
async function initMethod(method, element, options) {
|
|
1285
1381
|
const checkoutInstance = new CheckoutInstance({
|
|
1286
1382
|
orgId: options.orgId,
|
|
@@ -1293,6 +1389,11 @@
|
|
|
1293
1389
|
},
|
|
1294
1390
|
container: '',
|
|
1295
1391
|
clientMetadata: options.meta,
|
|
1392
|
+
card: options.card,
|
|
1393
|
+
style: options.style,
|
|
1394
|
+
applePay: options.applePay,
|
|
1395
|
+
paypal: options.paypal,
|
|
1396
|
+
googlePay: options.googlePay,
|
|
1296
1397
|
},
|
|
1297
1398
|
});
|
|
1298
1399
|
checkoutInstance._ensureNotDestroyed();
|
|
@@ -1309,7 +1410,6 @@
|
|
|
1309
1410
|
if (method === exports.PaymentMethod.PAYMENT_CARD) {
|
|
1310
1411
|
const cardDefaultOptions = await checkoutInstance['getCardDefaultSkinCheckoutOptions'](element);
|
|
1311
1412
|
const checkoutOptions = checkoutInstance['getCheckoutOptions']({
|
|
1312
|
-
style: options.styles,
|
|
1313
1413
|
...cardDefaultOptions,
|
|
1314
1414
|
});
|
|
1315
1415
|
await checkoutInstance.primerWrapper.initializeHeadlessCheckout(checkoutInstance.clientToken, checkoutOptions);
|
|
@@ -1321,9 +1421,7 @@
|
|
|
1321
1421
|
onMethodRenderError: checkoutInstance['handleMethodRenderError'],
|
|
1322
1422
|
});
|
|
1323
1423
|
}
|
|
1324
|
-
await checkoutInstance.primerWrapper.initializeHeadlessCheckout(checkoutInstance.clientToken, checkoutInstance['getCheckoutOptions']({
|
|
1325
|
-
style: options.styles,
|
|
1326
|
-
}));
|
|
1424
|
+
await checkoutInstance.primerWrapper.initializeHeadlessCheckout(checkoutInstance.clientToken, checkoutInstance['getCheckoutOptions']({}));
|
|
1327
1425
|
return checkoutInstance.primerWrapper.initMethod(method, element, {
|
|
1328
1426
|
onMethodRender: checkoutInstance['handleMethodRender'],
|
|
1329
1427
|
onMethodRenderError: checkoutInstance['handleMethodRenderError'],
|
|
@@ -1338,6 +1436,7 @@
|
|
|
1338
1436
|
createCheckout: createCheckout,
|
|
1339
1437
|
createClientSession: createClientSession,
|
|
1340
1438
|
initMethod: initMethod,
|
|
1439
|
+
silentPurchase: silentPurchase,
|
|
1341
1440
|
};
|
|
1342
1441
|
if (typeof window !== 'undefined') {
|
|
1343
1442
|
window.Billing = Billing;
|
|
@@ -1345,22 +1444,22 @@
|
|
|
1345
1444
|
|
|
1346
1445
|
var template$1 = "<div class=\"ff-skin-default\" id=\"ff-payment-method-containers\">\n <div id=\"success-screen\" style=\"display: none\">\n <div class=\"success\">\n <img alt=\"Loading\" src=\"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIHZpZXdCb3g9IjAgMCA1MCA1MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTI1IDAuMTExMzI4QzIwLjA3NzQgMC4xMTEzMjggMTUuMjY1NCAxLjU3MTA0IDExLjE3MjUgNC4zMDU4NkM3LjA3OTUyIDcuMDQwNjkgMy44ODk0NSAxMC45Mjc4IDIuMDA1NjYgMTUuNDc1N0MwLjEyMTg4MyAyMC4wMjM1IC0wLjM3MSAyNS4wMjc4IDAuNTg5MzQzIDI5Ljg1NThDMS41NDk2OSAzNC42ODM4IDMuOTIwMTIgMzkuMTE4NSA3LjQwMDkgNDIuNTk5M0MxMC44ODE3IDQ2LjA4MDEgMTUuMzE2NCA0OC40NTA1IDIwLjE0NDQgNDkuNDEwOUMyNC45NzI0IDUwLjM3MTIgMjkuOTc2NyA0OS44NzgzIDM0LjUyNDYgNDcuOTk0NkMzOS4wNzI0IDQ2LjExMDggNDIuOTU5NSA0Mi45MjA3IDQ1LjY5NDQgMzguODI3N0M0OC40MjkyIDM0LjczNDggNDkuODg4OSAyOS45MjI4IDQ5Ljg4ODkgMjUuMDAwMkM0OS44ODg5IDE4LjM5OTMgNDcuMjY2NyAxMi4wNjg3IDQyLjU5OTEgNy40MDExMkMzNy45MzE1IDIuNzMzNTQgMzEuNjAwOSAwLjExMTMyOCAyNSAwLjExMTMyOFpNNDEuMjU1NiAxNi42NDY5TDIwLjgxNTYgMzcuMDcxM0w4Ljc0NDQ0IDI1LjAwMDJDOC4zMzE4OCAyNC41ODc3IDguMTAwMTEgMjQuMDI4MSA4LjEwMDExIDIzLjQ0NDdDOC4xMDAxMSAyMi44NjEyIDguMzMxODggMjIuMzAxNyA4Ljc0NDQ0IDIxLjg4OTFDOS4xNTcgMjEuNDc2NSA5LjcxNjU1IDIxLjI0NDggMTAuMyAyMS4yNDQ4QzEwLjg4MzQgMjEuMjQ0OCAxMS40NDMgMjEuNDc2NSAxMS44NTU2IDIxLjg4OTFMMjAuODQ2NyAzMC44ODAyTDM4LjE3NTYgMTMuNTY2OUMzOC4zNzk4IDEzLjM2MjYgMzguNjIyMyAxMy4yMDA2IDM4Ljg4OTIgMTMuMDlDMzkuMTU2MiAxMi45Nzk1IDM5LjQ0MjIgMTIuOTIyNiAzOS43MzExIDEyLjkyMjZDNDAuMDIgMTIuOTIyNiA0MC4zMDYxIDEyLjk3OTUgNDAuNTczIDEzLjA5QzQwLjgzOTkgMTMuMjAwNiA0MS4wODI0IDEzLjM2MjYgNDEuMjg2NyAxMy41NjY5QzQxLjQ5MDkgMTMuNzcxMiA0MS42NTMgMTQuMDEzNyA0MS43NjM1IDE0LjI4MDZDNDEuODc0MSAxNC41NDc1IDQxLjkzMSAxNC44MzM1IDQxLjkzMSAxNS4xMjI0QzQxLjkzMSAxNS40MTEzIDQxLjg3NDEgMTUuNjk3NCA0MS43NjM1IDE1Ljk2NDNDNDEuNjUzIDE2LjIzMTIgNDEuNDkwOSAxNi40NzM3IDQxLjI4NjcgMTYuNjc4TDQxLjI1NTYgMTYuNjQ2OVoiIGZpbGw9IiM4RURGQzIiLz4KPC9zdmc+Cg==\">\n <div>Payment completed successfully</div>\n </div>\n </div>\n</div>\n";
|
|
1347
1446
|
|
|
1348
|
-
var cardTemplate = "<!-- Card Payments Section -->\n<div class=\"ff-payment-method-card ff-payment-method-payment-card\">\n <label class=\"ff-payment-method-label\">\n <input type=\"radio\" name=\"payment-method\" value=\"
|
|
1447
|
+
var cardTemplate = "<!-- Card Payments Section -->\n<div class=\"ff-payment-method-card ff-payment-method-payment-card\">\n <label class=\"ff-payment-method-label\">\n <input type=\"radio\" name=\"payment-method\" value=\"PAYMENT_CARD\" class=\"ff-payment-method-radio\">\n <div class=\"ff-payment-method-header\">\n <div class=\"ff-card-logos\">\n <img class=\"payment-method-icon\" style=\"max-height: 30px\" src=\"https://assets.fnlfx.com/common/checkout/cards.webp\" alt=\"visa, mastercard\">\n </div>\n </div>\n </label>\n <div class=\"ff-payment-method-content\">\n <div class=\"ff-card-form-container ff-payment-container\" id=\"cardForm\">\n <div class=\"loader-container\">\n <div class=\"loader\"></div>\n </div>\n <div class=\"payment-errors-container\"></div>\n <button class=\"ff-card-form-submit-button\" id=\"submitButton\">\n Continue\n </button>\n <p class=\"ff-security-message\">\n Your payment information is secure with SSL/TLS encryption\n </p>\n </div>\n </div>\n</div>\n";
|
|
1349
1448
|
|
|
1350
|
-
var paypalTemplate = "<div class=\"ff-payment-method-card ff-payment-method-paypal\">\n <label class=\"ff-payment-method-label\">\n <input type=\"radio\" name=\"payment-method\" value=\"
|
|
1449
|
+
var paypalTemplate = "<div class=\"ff-payment-method-card ff-payment-method-paypal\">\n <label class=\"ff-payment-method-label\">\n <input type=\"radio\" name=\"payment-method\" value=\"PAYPAL\" class=\"ff-payment-method-radio\">\n <div class=\"ff-payment-method-header\">\n <div class=\"ff-payment-logo ff-paypal-logo\">\n <img class=\"payment-method-icon\" style=\"max-height: 22px\" src=\"https://assets.fnlfx.com/common/checkout/paypal.webp\" alt=\"PayPal logo\">\n </div>\n </div>\n </label>\n <div class=\"ff-payment-method-content\">\n <ul class=\"ff-payment-features\">\n <li class=\"ff-payment-feature\">\n <svg width=\"13\" height=\"11\" viewBox=\"0 0 13 11\" fill=\"none\">\n <path stroke=\"#F8545D\" d=\"M11.1997 1.80133L6.99269 8.63774C6.68226 9.14218 5.9932 9.24721 5.54659 8.85815L2.19971 5.94254\" stroke-width=\"2.66667\" stroke-linecap=\"round\"></path>\n </svg>\n <span> Fast, convenient payment option </span>\n </li>\n <li class=\"ff-payment-feature\">\n <svg width=\"13\" height=\"11\" viewBox=\"0 0 13 11\" fill=\"none\">\n <path stroke=\"#F8545D\" d=\"M11.1997 1.80133L6.99269 8.63774C6.68226 9.14218 5.9932 9.24721 5.54659 8.85815L2.19971 5.94254\" stroke-width=\"2.66667\" stroke-linecap=\"round\"></path>\n </svg>\n <span> Keeps your financial info safe with end-to-end encryption </span>\n </li>\n <li class=\"ff-payment-feature\">\n <svg width=\"13\" height=\"11\" viewBox=\"0 0 13 11\" fill=\"none\">\n <path stroke=\"#F8545D\" d=\"M11.1997 1.80133L6.99269 8.63774C6.68226 9.14218 5.9932 9.24721 5.54659 8.85815L2.19971 5.94254\" stroke-width=\"2.66667\" stroke-linecap=\"round\"></path>\n </svg>\n <span> Backed by PayPal’s industry-leading fraud protection </span>\n </li>\n </ul>\n <div class=\"ff-paypal-button-container ff-payment-container\" id=\"paypalButton\"></div>\n <div class=\"loader-container payment-button-loader\">\n <div class=\"loader\"></div>\n </div>\n <div class=\"payment-errors-container\"></div>\n <p class=\"ff-security-message\">\n Your payment information is secure with SSL/TLS encryption\n </p>\n </div>\n</div>\n";
|
|
1351
1450
|
|
|
1352
|
-
var googlePayTemplate = "<!-- Google Pay Section -->\n<div class=\"ff-payment-method-card ff-payment-method-google-pay\">\n <label class=\"ff-payment-method-label\">\n <input type=\"radio\" name=\"payment-method\" value=\"
|
|
1451
|
+
var googlePayTemplate = "<!-- Google Pay Section -->\n<div class=\"ff-payment-method-card ff-payment-method-google-pay\">\n <label class=\"ff-payment-method-label\">\n <input type=\"radio\" name=\"payment-method\" value=\"GOOGLE_PAY\" class=\"ff-payment-method-radio\" checked=\"checked\">\n <div class=\"ff-payment-method-header\">\n <div class=\"ff-payment-logo ff-google-pay-logo\">\n <svg class=\"payment-method-icon\" height=\"26\" viewBox=\"0 0 59 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M27.3601 11.6862V18.4674H25.208V1.72177H30.9132C32.3591 1.72177 33.592 2.20374 34.6008 3.16768C35.632 4.13162 36.1476 5.30852 36.1476 6.69838C36.1476 8.12187 35.632 9.29877 34.6008 10.2515C33.6032 11.2042 32.3703 11.675 30.9132 11.675H27.3601V11.6862ZM27.3601 3.78415V9.62382H30.958C31.8099 9.62382 32.5272 9.3324 33.0876 8.76076C33.6593 8.18912 33.9507 7.49419 33.9507 6.70959C33.9507 5.9362 33.6593 5.25248 33.0876 4.68084C32.5272 4.08678 31.8211 3.79536 30.958 3.79536H27.3601V3.78415Z\" fill=\"currentColor\"/>\n <path d=\"M41.7742 6.63107C43.3658 6.63107 44.6212 7.057 45.5403 7.90885C46.4594 8.7607 46.9189 9.9264 46.9189 11.4059V18.4673H44.8677V16.8757H44.7781C43.8926 18.1871 42.7045 18.8372 41.225 18.8372C39.9584 18.8372 38.9048 18.4673 38.0529 17.7164C37.2011 16.9654 36.7751 16.0351 36.7751 14.9142C36.7751 13.7261 37.2235 12.7846 38.1202 12.0896C39.0169 11.3835 40.2162 11.036 41.7069 11.036C42.9847 11.036 44.0383 11.2714 44.8565 11.7422V11.249C44.8565 10.498 44.5651 9.87035 43.9711 9.34355C43.377 8.81674 42.6821 8.55895 41.8863 8.55895C40.6869 8.55895 39.7342 9.06333 39.0393 10.0833L37.145 8.8952C38.1874 7.38205 39.7342 6.63107 41.7742 6.63107ZM38.9944 14.9478C38.9944 15.5083 39.2298 15.979 39.7118 16.3489C40.1826 16.7188 40.743 16.9093 41.3819 16.9093C42.2898 16.9093 43.0968 16.5731 43.8029 15.9006C44.5091 15.228 44.8677 14.4435 44.8677 13.5356C44.1952 13.0088 43.2649 12.7397 42.0656 12.7397C41.1913 12.7397 40.4628 12.9527 39.8799 13.3674C39.2859 13.8046 38.9944 14.3314 38.9944 14.9478Z\" fill=\"currentColor\"/>\n <path d=\"M58.6207 7.00095L51.4472 23.5H49.2279L51.8955 17.7276L47.1655 7.00095H49.5081L52.9155 15.228H52.9604L56.2781 7.00095H58.6207Z\" fill=\"currentColor\"/>\n <path d=\"M18.8001 10.3187C18.8001 9.61709 18.7373 8.94569 18.6208 8.30008H9.6001V11.9989L14.7953 12C14.5846 13.2307 13.9064 14.2799 12.8674 14.9793V17.379H15.9598C17.7655 15.7078 18.8001 13.2375 18.8001 10.3187Z\" fill=\"#4285F4\"/>\n <path d=\"M12.8685 14.9793C12.0076 15.5599 10.8991 15.8995 9.60228 15.8995C7.09717 15.8995 4.97202 14.2115 4.21096 11.9361H1.021V14.411C2.60141 17.5472 5.84965 19.6992 9.60228 19.6992C12.1959 19.6992 14.3749 18.8462 15.9609 17.3779L12.8685 14.9793Z\" fill=\"#34A853\"/>\n <path d=\"M3.91043 10.1002C3.91043 9.46129 4.01691 8.8437 4.21082 8.26309V5.78824H1.02086C0.367396 7.08507 -0.000244141 8.54891 -0.000244141 10.1002C-0.000244141 11.6514 0.368516 13.1153 1.02086 14.4121L4.21082 11.9373C4.01691 11.3567 3.91043 10.7391 3.91043 10.1002Z\" fill=\"#FABB05\"/>\n <path d=\"M9.60228 4.29974C11.0179 4.29974 12.2856 4.78731 13.2865 5.74004L16.027 3.00179C14.3626 1.45164 12.1926 0.500031 9.60228 0.500031C5.85077 0.500031 2.60141 2.65208 1.021 5.78824L4.21096 8.26309C4.97202 5.98775 7.09717 4.29974 9.60228 4.29974Z\" fill=\"#E94235\"/>\n </svg>\n </div>\n </div>\n </label>\n <div class=\"ff-payment-method-content\">\n <ul class=\"ff-payment-features\">\n <li class=\"ff-payment-feature\">\n <svg width=\"13\" height=\"11\" viewBox=\"0 0 13 11\" fill=\"none\">\n <path stroke=\"#F8545D\" d=\"M11.1997 1.80133L6.99269 8.63774C6.68226 9.14218 5.9932 9.24721 5.54659 8.85815L2.19971 5.94254\" stroke-width=\"2.66667\" stroke-linecap=\"round\"></path>\n </svg>\n <span>Easy and private payments with Face/Touch ID</span>\n </li>\n <li class=\"ff-payment-feature\">\n <svg width=\"13\" height=\"11\" viewBox=\"0 0 13 11\" fill=\"none\">\n <path stroke=\"#F8545D\" d=\"M11.1997 1.80133L6.99269 8.63774C6.68226 9.14218 5.9932 9.24721 5.54659 8.85815L2.19971 5.94254\" stroke-width=\"2.66667\" stroke-linecap=\"round\"></path>\n </svg>\n <span>Keeps your financial info safe with end-to-end encryption</span>\n </li>\n <li class=\"ff-payment-feature\">\n <svg width=\"13\" height=\"11\" viewBox=\"0 0 13 11\" fill=\"none\">\n <path stroke=\"#F8545D\" d=\"M11.1997 1.80133L6.99269 8.63774C6.68226 9.14218 5.9932 9.24721 5.54659 8.85815L2.19971 5.94254\" stroke-width=\"2.66667\" stroke-linecap=\"round\"></path>\n </svg>\n <span>Protected by Google Pay's unique Device Account Number</span>\n </li>\n </ul>\n <div class=\"ff-google-pay-button-container ff-payment-container\" id=\"googlePayButton\"></div>\n <div class=\"loader-container payment-button-loader\">\n <div class=\"loader\"></div>\n </div>\n <div class=\"payment-errors-container\"></div>\n <p class=\"ff-security-message\">\n Your payment information is secure with SSL/TLS encryption\n </p>\n </div>\n</div>\n";
|
|
1353
1452
|
|
|
1354
|
-
var applePayTemplate = "<!-- Apple Pay Section -->\n<div class=\"ff-payment-method-card ff-payment-method-apple-pay\">\n <label class=\"ff-payment-method-label\">\n <input type=\"radio\" name=\"payment-method\" value=\"
|
|
1453
|
+
var applePayTemplate = "<!-- Apple Pay Section -->\n<div class=\"ff-payment-method-card ff-payment-method-apple-pay\">\n <label class=\"ff-payment-method-label\">\n <input type=\"radio\" name=\"payment-method\" value=\"APPLE_PAY\" class=\"ff-payment-method-radio\">\n <div class=\"ff-payment-method-header\">\n <div class=\"ff-payment-logo ff-apple-pay-logo\">\n <svg class=\"payment-method-icon\" height=\"26\" viewBox=\"0 0 63 26\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8.41022 4.82398C9.5916 4.92293 10.773 4.23026 11.5113 3.35205C12.2374 2.4491 12.7173 1.23692 12.5943 0C11.5483 0.0494767 10.2561 0.692674 9.51777 1.59562C8.84093 2.37488 8.26255 3.63654 8.41022 4.82398ZM22.4638 20.7555V1.47193H29.6628C33.3793 1.47193 35.9758 4.04471 35.9758 7.80494C35.9758 11.5652 33.33 14.1627 29.5644 14.1627H25.4418V20.7555H22.4638ZM12.5819 5.05898C11.5411 4.99877 10.5914 5.37358 9.82438 5.67633C9.33075 5.87116 8.91274 6.03614 8.59472 6.03614C8.23784 6.03614 7.80257 5.86234 7.31387 5.66719C6.6735 5.4115 5.94138 5.11916 5.17364 5.13319C3.41387 5.15793 1.77716 6.15983 0.878819 7.75545C-0.967091 10.9467 0.398882 15.6717 2.18326 18.2693C3.05699 19.5556 4.10301 20.9657 5.48129 20.9163C6.08765 20.8933 6.52383 20.7072 6.97524 20.5147C7.49492 20.293 8.0348 20.0628 8.87776 20.0628C9.69151 20.0628 10.2078 20.287 10.7033 20.5023C11.1746 20.707 11.6271 20.9036 12.2989 20.8915C13.7264 20.8668 14.6247 19.6051 15.4984 18.3187C16.4413 16.9381 16.8557 15.5906 16.9186 15.3861C16.9222 15.3745 16.9246 15.3665 16.9259 15.3625C16.9244 15.361 16.9128 15.3556 16.8922 15.3462C16.577 15.2011 14.1679 14.0926 14.1448 11.1199C14.1216 8.62473 16.0556 7.36054 16.3601 7.16153C16.3786 7.14944 16.3911 7.14125 16.3968 7.137C15.1662 5.30636 13.2464 5.10845 12.5819 5.05898ZM41.4153 20.9039C43.2858 20.9039 45.0209 19.9515 45.8085 18.4424H45.8701V20.7555H48.6266V11.157C48.6266 8.37393 46.4115 6.5804 43.0027 6.5804C39.8401 6.5804 37.5019 8.39866 37.4158 10.8972H40.0985C40.32 9.70979 41.4153 8.93054 42.9166 8.93054C44.7379 8.93054 45.7593 9.78401 45.7593 11.3549V12.4186L42.0429 12.6413C38.5849 12.8516 36.7143 14.274 36.7143 16.7479C36.7143 19.2464 38.6464 20.9039 41.4153 20.9039ZM42.215 18.6156C40.6275 18.6156 39.6184 17.8487 39.6184 16.6736C39.6184 15.4615 40.5906 14.7564 42.4488 14.6451L45.7591 14.4348V15.5233C45.7591 17.3292 44.2332 18.6156 42.215 18.6156ZM57.7699 21.51C56.5762 24.8868 55.2103 26 52.306 26C52.0845 26 51.3461 25.9753 51.1739 25.9258V23.6127C51.3585 23.6375 51.8138 23.6622 52.0476 23.6622C53.3643 23.6622 54.1027 23.1056 54.558 21.6584L54.8288 20.8049L49.7833 6.76594H52.8967L56.4039 18.1579H56.4655L59.9727 6.76594H63L57.7699 21.51ZM25.4416 3.99524H28.875C31.4592 3.99524 32.936 5.38059 32.936 7.81731C32.936 10.254 31.4592 11.6518 28.8627 11.6518H25.4416V3.99524Z\" fill=\"currentColor\"/>\n </svg>\n </div>\n </div>\n </label>\n <div class=\"ff-payment-method-content\">\n <ul class=\"ff-payment-features\">\n <li class=\"ff-payment-feature\">\n <svg width=\"13\" height=\"11\" viewBox=\"0 0 13 11\" fill=\"none\">\n <path stroke=\"#F8545D\" d=\"M11.1997 1.80133L6.99269 8.63774C6.68226 9.14218 5.9932 9.24721 5.54659 8.85815L2.19971 5.94254\" stroke-width=\"2.66667\" stroke-linecap=\"round\"></path>\n </svg>\n <span>Easy and private payments with Face/Touch ID</span>\n </li>\n <li class=\"ff-payment-feature\">\n <svg width=\"13\" height=\"11\" viewBox=\"0 0 13 11\" fill=\"none\">\n <path stroke=\"#F8545D\" d=\"M11.1997 1.80133L6.99269 8.63774C6.68226 9.14218 5.9932 9.24721 5.54659 8.85815L2.19971 5.94254\" stroke-width=\"2.66667\" stroke-linecap=\"round\"></path>\n </svg>\n <span>Keeps your financial info safe with end-to-end encryption</span>\n </li>\n <li class=\"ff-payment-feature\">\n <svg width=\"13\" height=\"11\" viewBox=\"0 0 13 11\" fill=\"none\">\n <path stroke=\"#F8545D\" d=\"M11.1997 1.80133L6.99269 8.63774C6.68226 9.14218 5.9932 9.24721 5.54659 8.85815L2.19971 5.94254\" stroke-width=\"2.66667\" stroke-linecap=\"round\"></path>\n </svg>\n <span>Protected by Apple Pay’s unique Device Account Numbe</span>\n </li>\n </ul>\n <div class=\"ff-apple-pay-button-container ff-payment-container\" id=\"applePayButton\"></div>\n <div class=\"loader-container payment-button-loader\">\n <div class=\"loader\"></div>\n </div>\n <div class=\"payment-errors-container\"></div>\n <p class=\"ff-security-message\">\n Your payment information is secure with Apple Pay encryption\n </p>\n </div>\n</div>\n";
|
|
1355
1454
|
|
|
1356
|
-
if(typeof document!=="undefined")document.head.appendChild(document.createElement("style")).textContent="/* Main container */\n.ff-skin-default {\n display: flex;\n flex-direction: column;\n text-align: left;\n gap: 8px;\n width: 100%;\n max-width: 400px;\n margin: 0 auto;\n}\n\n/* Payment method cards */\n.ff-payment-method-card {\n display: none;\n border: 1px solid #e0e0e0;\n border-radius: 8px;\n background-color: #ffffff;\n padding: 20px;\n transition: border-color 0.2s ease;\n height: auto;\n box-shadow: 0px 0px 10px 0px #eee;\n}\n\n.ff-payment-method-card.visible {\n display: block;\n}\n\n.payment-errors-container {\n background-color: #d1000033;\n color: #d10000;\n font-size: 14px;\n padding: 16px 12px;\n border-radius: 8px;\n}\n.payment-errors-container:empty {\n display: none;\n}\n\n/* Label wrapper */\n.ff-payment-method-label {\n display: flex;\n align-items: flex-start;\n gap: 16px;\n cursor: pointer;\n width: 100%;\n}\n\n/* Custom radio button styling */\n.ff-payment-method-radio {\n appearance: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n width: 24px;\n height: 24px;\n min-width: 24px;\n min-height: 24px;\n border: 1px solid #9e9e9e;\n border-radius: 50%;\n background-color: #ffffff;\n cursor: pointer;\n position: relative;\n margin: 0;\n flex-shrink: 0;\n transition: border-color 0.2s ease;\n}\n\n.ff-card-form-submit-button {\n display: block;\n cursor: pointer;\n width: 100%;\n padding: 16px 0;\n border-radius: 16px;\n background-color: #000000;\n color: #ffffff;\n border: none;\n font-size: 16px;\n margin: 0;\n}\n\n.ff-payment-method-radio:checked {\n border-color: #e32f41;\n background-color: #ffffff;\n}\n\n.ff-payment-method-radio:checked::after {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 16px;\n height: 16px;\n border-radius: 50%;\n background-color: #e32f41;\n}\n\n/* Payment method content */\n.ff-payment-method-content {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 16px;\n max-height: 0;\n height: 0;\n overflow: hidden;\n opacity: 0;\n transition:\n opacity 0.3s ease,\n margin-top 0.3s ease;\n margin-top: 0;\n}\n\n.ff-payment-method-card.expanded .ff-payment-method-content {\n max-height: 2000px;\n height: auto;\n opacity: 1;\n margin-top: 16px;\n}\n.ff-payment-method-card.expanded .ff-payment-method-label {\n margin-bottom: 16px;\n}\n\n/* Payment method header */\n.ff-payment-method-header {\n display: flex;\n align-items: center;\n}\n\n/* Google Pay Logo */\n.ff-google-pay-logo {\n display: flex;\n align-items: center;\n gap: 4px;\n font-weight: 500;\n font-size: 18px;\n}\n\n/* Payment features list */\n.ff-payment-features {\n list-style: none;\n padding: 0;\n margin: 0;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.ff-payment-feature {\n display: flex;\n align-items: baseline;\n text-align: left;\n gap: 8px;\n}\n\n.ff-checkmark-icon {\n width: 20px;\n height: 20px;\n min-width: 20px;\n color: #e32f41;\n flex-shrink: 0;\n margin-top: 2px;\n}\n\n.ff-payment-feature span {\n color: #333333;\n font-size: 14px;\n line-height: 1.5;\n}\n\n/* Google Pay button container */\n.ff-google-pay-button-container {\n display: flex;\n justify-content: center;\n}\n\n/* hack for FFB-169 */\n.ff-google-pay-button-container button, .ff-apple-pay-button-container button {\n height: 54px !important;\n border-radius: 28px !important;\n}\n\n/* Security message */\n.ff-security-message {\n text-align: center;\n color: #999999;\n font-size: 14px;\n padding: 0;\n margin: 0\n}\n\n/* Card logos container */\n.ff-card-logos {\n display: flex;\n align-items: center;\n gap: 12px;\n flex-wrap: wrap;\n}\n\n/* Card form container */\n.ff-card-form-container {\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.loader-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgba(255, 255, 255);\n z-index: 2;\n}\n\n.payment-button-loader {\n position: relative;\n height: 50px;\n}\n\n.loader {\n width: 24px;\n height: 24px;\n border: 4px solid #e32f41;\n border-top: 4px solid transparent;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n}\n\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n/* Responsive adjustments */\n@media (max-width: 768px) {\n .ff-payment-method-card {\n padding: 16px;\n }\n\n .ff-payment-method-label {\n gap: 12px;\n }\n\n .ff-card-logos {\n gap: 8px;\n }\n}\n\n.ff-payment-container {\n position: relative;\n}\n\n.success {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 16px;\n}\n";
|
|
1455
|
+
if(typeof document!=="undefined")document.head.appendChild(document.createElement("style")).textContent="/* Main container */\n.ff-skin-default {\n display: flex;\n flex-direction: column;\n text-align: left;\n gap: 8px;\n width: 100%;\n max-width: 400px;\n margin: 0 auto;\n}\n\n/* Payment method cards */\n.ff-payment-method-card {\n display: none;\n border: 1px solid #e0e0e0;\n border-radius: 8px;\n background-color: #ffffff;\n padding: 20px;\n transition: border-color 0.2s ease;\n height: auto;\n box-shadow: 0px 0px 10px 0px #eee;\n}\n\n.ff-payment-method-card.visible {\n display: block;\n}\n\n.payment-errors-container {\n background-color: #d1000033;\n color: #d10000;\n font-size: 14px;\n padding: 16px 12px;\n border-radius: 8px;\n}\n.payment-errors-container:empty {\n display: none;\n}\n\n/* Label wrapper */\n.ff-payment-method-label {\n display: flex;\n align-items: flex-start;\n gap: 16px;\n cursor: pointer;\n width: 100%;\n}\n\n/* Custom radio button styling */\n.ff-payment-method-radio {\n appearance: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n width: 24px;\n height: 24px;\n min-width: 24px;\n min-height: 24px;\n border: 1px solid #9e9e9e;\n border-radius: 50%;\n background-color: #ffffff;\n cursor: pointer;\n position: relative;\n margin: 0;\n flex-shrink: 0;\n transition: border-color 0.2s ease;\n}\n\n.ff-card-form-submit-button {\n display: block;\n cursor: pointer;\n width: 100%;\n padding: 16px 0;\n border-radius: 16px;\n background-color: #000000;\n color: #ffffff;\n border: none;\n font-size: 16px;\n margin: 12px 0 16px;\n}\n\n.ff-payment-method-radio:checked {\n border-color: #e32f41;\n background-color: #ffffff;\n}\n\n.ff-payment-method-radio:checked::after {\n content: '';\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 16px;\n height: 16px;\n border-radius: 50%;\n background-color: #e32f41;\n}\n\n/* Payment method content */\n.ff-payment-method-content {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 16px;\n max-height: 0;\n height: 0;\n overflow: hidden;\n opacity: 0;\n transition:\n opacity 0.3s ease,\n margin-top 0.3s ease;\n margin-top: 0;\n}\n\n.ff-payment-method-card.expanded .ff-payment-method-content {\n max-height: 2000px;\n height: auto;\n opacity: 1;\n margin-top: 16px;\n}\n.ff-payment-method-card.expanded .ff-payment-method-label {\n margin-bottom: 16px;\n}\n\n/* Payment method header */\n.ff-payment-method-header {\n display: flex;\n align-items: center;\n}\n\n/* Google Pay Logo */\n.ff-google-pay-logo {\n display: flex;\n align-items: center;\n gap: 4px;\n font-weight: 500;\n font-size: 18px;\n}\n\n/* Payment features list */\n.ff-payment-features {\n list-style: none;\n padding: 0;\n margin: 0;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.ff-payment-feature {\n display: flex;\n align-items: baseline;\n text-align: left;\n gap: 8px;\n}\n\n.ff-checkmark-icon {\n width: 20px;\n height: 20px;\n min-width: 20px;\n color: #e32f41;\n flex-shrink: 0;\n margin-top: 2px;\n}\n\n.ff-payment-feature span {\n color: #333333;\n font-size: 14px;\n line-height: 1.5;\n}\n\n/* Google Pay button container */\n.ff-google-pay-button-container {\n display: flex;\n justify-content: center;\n}\n\n/* hack for FFB-169 */\n.ff-google-pay-button-container button, .ff-apple-pay-button-container button {\n height: 54px !important;\n border-radius: 28px !important;\n}\n\n/* Security message */\n.ff-security-message {\n text-align: center;\n color: #999999;\n font-size: 14px;\n padding: 0;\n margin: 0\n}\n\n/* Card logos container */\n.ff-card-logos {\n display: flex;\n align-items: center;\n gap: 12px;\n flex-wrap: wrap;\n}\n\n/* Card form container */\n.ff-card-form-container {\n position: relative;\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.loader-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center;\n background-color: rgba(255, 255, 255);\n z-index: 2;\n}\n\n.payment-button-loader {\n position: relative;\n height: 50px;\n}\n\n.loader {\n width: 24px;\n height: 24px;\n border: 4px solid #e32f41;\n border-top: 4px solid transparent;\n border-radius: 50%;\n animation: spin 1s linear infinite;\n}\n\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n/* Responsive adjustments */\n@media (max-width: 768px) {\n .ff-payment-method-card {\n padding: 16px;\n }\n\n .ff-payment-method-label {\n gap: 12px;\n }\n\n .ff-card-logos {\n gap: 8px;\n }\n}\n\n.ff-payment-container {\n position: relative;\n}\n\n.success {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 16px;\n}\n";
|
|
1357
1456
|
|
|
1358
|
-
var template = "<div>\n <label class=\"ff-card-form-label\" for=\"cardNumberInput\">Card number</label>\n <div id=\"cardNumberInput\"></div>\n <div class=\"errorContainer\"></div>\n</div>\n<div class=\"card-form-row\">\n <div>\n <label class=\"ff-card-form-label\" for=\"expiryInput\">Expiration date</label>\n <div id=\"expiryInput\"></div>\n <div class=\"errorContainer\"></div>\n </div>\n <div>\n <label class=\"ff-card-form-label\" for=\"cvvInput\">Security code</label>\n <div id=\"cvvInput\">\n <svg width=\"200\" height=\"200\" viewBox=\"0 0 200 200\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect width=\"200\" height=\"200\" fill=\"transparent\"/>\n <g clip-path=\"url(#clip0_0_1)\">\n <path d=\"M157.555 23C168.279 23.0002 177 31.7394 177 42.4854V80.5889C171.946 72.0151 164.749 64.8558 156.146 59.8457H166.394V42.4854C166.393 37.6004 162.43 33.6291 157.555 33.6289H27.4453C22.5704 33.6291 18.6066 37.6004 18.6064 42.4854V59.8457H97.8535C88.9153 65.0512 81.4954 72.5771 76.4189 81.5986H18.6064V127.515C18.6066 132.4 22.5704 136.371 27.4453 136.371H75.3281C77.2742 140.177 79.6285 143.739 82.333 147H27.4453C16.7215 147 8.00019 138.261 8 127.515V42.4854C8.0002 31.7394 16.7215 23.0002 27.4453 23H157.555Z\" fill=\"#93939A\"/>\n <mask id=\"path-2-outside-1_0_1\" maskUnits=\"userSpaceOnUse\" x=\"68.5012\" y=\"52.0311\" width=\"135\" height=\"135\" fill=\"black\">\n <rect fill=\"white\" x=\"68.5012\" y=\"52.0311\" width=\"135\" height=\"135\"/>\n <path d=\"M190.242 160.457L170.136 140.351C166.533 145.552 162.023 150.063 156.821 153.666L176.927 173.772C178.693 175.538 181.088 176.53 183.585 176.53C186.082 176.53 188.477 175.538 190.242 173.772C192.008 172.007 193 169.612 193 167.115C193 164.618 192.008 162.223 190.242 160.457ZM126.436 157.901C116.955 157.901 107.688 155.089 99.8048 149.822C91.922 144.555 85.7781 137.069 82.15 128.31C78.5219 119.551 77.5727 109.913 79.4222 100.614C81.2718 91.3158 85.8371 82.7746 92.5409 76.0708C99.2447 69.367 107.786 64.8017 117.084 62.9521C126.383 61.1026 136.021 62.0518 144.78 65.6799C153.539 69.308 161.025 75.4519 166.292 83.3347C171.559 91.2175 174.371 100.485 174.371 109.966C174.371 122.679 169.32 134.871 160.331 143.861C151.341 152.85 139.149 157.901 126.436 157.901ZM163.719 109.966C163.719 102.592 161.532 95.3838 157.435 89.2527C153.339 83.1216 147.516 78.343 140.703 75.5212C133.891 72.6994 126.395 71.9611 119.162 73.3996C111.93 74.8382 105.287 78.389 100.073 83.6031C94.8591 88.8171 91.3083 95.4602 89.8697 102.692C88.4312 109.924 89.1695 117.421 91.9913 124.233C94.8131 131.046 99.5918 136.869 105.723 140.965C111.854 145.062 119.062 147.248 126.436 147.248C136.324 147.248 145.807 143.32 152.799 136.329C159.791 129.337 163.719 119.854 163.719 109.966ZM133.645 102.757C133.398 102.51 133.104 102.313 132.781 102.179C132.458 102.046 132.112 101.977 131.762 101.977C131.412 101.977 131.066 102.046 130.743 102.179C130.42 102.313 130.126 102.51 129.879 102.757L126.436 106.2L122.993 102.757C122.49 102.272 121.818 102.003 121.119 102.01C120.421 102.016 119.753 102.296 119.26 102.789C118.766 103.283 118.486 103.951 118.48 104.649C118.474 105.348 118.742 106.02 119.227 106.523L122.67 109.966L119.227 113.409C118.973 113.655 118.77 113.949 118.63 114.274C118.491 114.598 118.417 114.948 118.414 115.301C118.411 115.655 118.479 116.006 118.612 116.333C118.746 116.66 118.944 116.958 119.194 117.208C119.444 117.458 119.741 117.655 120.069 117.789C120.396 117.923 120.747 117.991 121.1 117.988C121.454 117.985 121.803 117.911 122.128 117.771C122.453 117.632 122.747 117.429 122.993 117.175L126.436 113.732L129.879 117.175C130.382 117.66 131.054 117.928 131.752 117.922C132.451 117.916 133.119 117.636 133.612 117.142C134.106 116.648 134.386 115.981 134.392 115.282C134.398 114.584 134.13 113.911 133.645 113.409L130.202 109.966L133.645 106.523C133.892 106.275 134.088 105.982 134.222 105.659C134.356 105.336 134.425 104.989 134.425 104.64C134.425 104.29 134.356 103.944 134.222 103.621C134.088 103.298 133.892 103.004 133.645 102.757ZM112.34 102.757C112.093 102.51 111.8 102.313 111.477 102.179C111.154 102.046 110.807 101.977 110.458 101.977C110.108 101.977 109.762 102.046 109.439 102.179C109.116 102.313 108.822 102.51 108.575 102.757L105.132 106.2L101.688 102.757C101.186 102.272 100.513 102.003 99.8151 102.01C99.1169 102.016 98.4489 102.296 97.9552 102.789C97.4614 103.283 97.1814 103.951 97.1753 104.649C97.1692 105.348 97.4377 106.02 97.9227 106.523L101.366 109.966L97.9227 113.409C97.6684 113.655 97.4655 113.949 97.326 114.274C97.1864 114.598 97.1129 114.948 97.1098 115.301C97.1068 115.655 97.1742 116.006 97.3081 116.333C97.442 116.66 97.6397 116.958 97.8897 117.208C98.1398 117.458 98.4371 117.655 98.7644 117.789C99.0917 117.923 99.4423 117.991 99.7959 117.988C100.15 117.985 100.499 117.911 100.824 117.771C101.149 117.632 101.443 117.429 101.688 117.175L105.132 113.732L108.575 117.175C109.077 117.66 109.75 117.928 110.448 117.922C111.146 117.916 111.814 117.636 112.308 117.142C112.802 116.648 113.082 115.981 113.088 115.282C113.094 114.584 112.826 113.911 112.34 113.409L108.897 109.966L112.34 106.523C112.588 106.275 112.784 105.982 112.918 105.659C113.052 105.336 113.121 104.989 113.121 104.64C113.121 104.29 113.052 103.944 112.918 103.621C112.784 103.298 112.588 103.004 112.34 102.757ZM151.506 109.966L154.949 106.523C155.434 106.02 155.703 105.348 155.697 104.649C155.691 103.951 155.41 103.283 154.917 102.789C154.423 102.296 153.755 102.016 153.057 102.01C152.359 102.003 151.686 102.272 151.184 102.757L147.74 106.2L144.297 102.757C143.795 102.272 143.122 102.003 142.424 102.01C141.726 102.016 141.058 102.296 140.564 102.789C140.07 103.283 139.79 103.951 139.784 104.649C139.778 105.348 140.046 106.02 140.531 106.523L143.974 109.966L140.531 113.409C140.277 113.655 140.074 113.949 139.935 114.274C139.795 114.598 139.722 114.948 139.719 115.301C139.715 115.655 139.783 116.006 139.917 116.333C140.051 116.66 140.248 116.958 140.498 117.208C140.748 117.458 141.046 117.655 141.373 117.789C141.7 117.923 142.051 117.991 142.405 117.988C142.758 117.985 143.108 117.911 143.433 117.771C143.757 117.632 144.051 117.429 144.297 117.175L147.74 113.732L151.184 117.175C151.686 117.66 152.359 117.928 153.057 117.922C153.755 117.916 154.423 117.636 154.917 117.142C155.41 116.648 155.691 115.981 155.697 115.282C155.703 114.584 155.434 113.911 154.949 113.409L151.506 109.966Z\"/>\n </mask>\n <path d=\"M190.242 160.457L170.136 140.351C166.533 145.552 162.023 150.063 156.821 153.666L176.927 173.772C178.693 175.538 181.088 176.53 183.585 176.53C186.082 176.53 188.477 175.538 190.242 173.772C192.008 172.007 193 169.612 193 167.115C193 164.618 192.008 162.223 190.242 160.457ZM126.436 157.901C116.955 157.901 107.688 155.089 99.8048 149.822C91.922 144.555 85.7781 137.069 82.15 128.31C78.5219 119.551 77.5727 109.913 79.4222 100.614C81.2718 91.3158 85.8371 82.7746 92.5409 76.0708C99.2447 69.367 107.786 64.8017 117.084 62.9521C126.383 61.1026 136.021 62.0518 144.78 65.6799C153.539 69.308 161.025 75.4519 166.292 83.3347C171.559 91.2175 174.371 100.485 174.371 109.966C174.371 122.679 169.32 134.871 160.331 143.861C151.341 152.85 139.149 157.901 126.436 157.901ZM163.719 109.966C163.719 102.592 161.532 95.3838 157.435 89.2527C153.339 83.1216 147.516 78.343 140.703 75.5212C133.891 72.6994 126.395 71.9611 119.162 73.3996C111.93 74.8382 105.287 78.389 100.073 83.6031C94.8591 88.8171 91.3083 95.4602 89.8697 102.692C88.4312 109.924 89.1695 117.421 91.9913 124.233C94.8131 131.046 99.5918 136.869 105.723 140.965C111.854 145.062 119.062 147.248 126.436 147.248C136.324 147.248 145.807 143.32 152.799 136.329C159.791 129.337 163.719 119.854 163.719 109.966ZM133.645 102.757C133.398 102.51 133.104 102.313 132.781 102.179C132.458 102.046 132.112 101.977 131.762 101.977C131.412 101.977 131.066 102.046 130.743 102.179C130.42 102.313 130.126 102.51 129.879 102.757L126.436 106.2L122.993 102.757C122.49 102.272 121.818 102.003 121.119 102.01C120.421 102.016 119.753 102.296 119.26 102.789C118.766 103.283 118.486 103.951 118.48 104.649C118.474 105.348 118.742 106.02 119.227 106.523L122.67 109.966L119.227 113.409C118.973 113.655 118.77 113.949 118.63 114.274C118.491 114.598 118.417 114.948 118.414 115.301C118.411 115.655 118.479 116.006 118.612 116.333C118.746 116.66 118.944 116.958 119.194 117.208C119.444 117.458 119.741 117.655 120.069 117.789C120.396 117.923 120.747 117.991 121.1 117.988C121.454 117.985 121.803 117.911 122.128 117.771C122.453 117.632 122.747 117.429 122.993 117.175L126.436 113.732L129.879 117.175C130.382 117.66 131.054 117.928 131.752 117.922C132.451 117.916 133.119 117.636 133.612 117.142C134.106 116.648 134.386 115.981 134.392 115.282C134.398 114.584 134.13 113.911 133.645 113.409L130.202 109.966L133.645 106.523C133.892 106.275 134.088 105.982 134.222 105.659C134.356 105.336 134.425 104.989 134.425 104.64C134.425 104.29 134.356 103.944 134.222 103.621C134.088 103.298 133.892 103.004 133.645 102.757ZM112.34 102.757C112.093 102.51 111.8 102.313 111.477 102.179C111.154 102.046 110.807 101.977 110.458 101.977C110.108 101.977 109.762 102.046 109.439 102.179C109.116 102.313 108.822 102.51 108.575 102.757L105.132 106.2L101.688 102.757C101.186 102.272 100.513 102.003 99.8151 102.01C99.1169 102.016 98.4489 102.296 97.9552 102.789C97.4614 103.283 97.1814 103.951 97.1753 104.649C97.1692 105.348 97.4377 106.02 97.9227 106.523L101.366 109.966L97.9227 113.409C97.6684 113.655 97.4655 113.949 97.326 114.274C97.1864 114.598 97.1129 114.948 97.1098 115.301C97.1068 115.655 97.1742 116.006 97.3081 116.333C97.442 116.66 97.6397 116.958 97.8897 117.208C98.1398 117.458 98.4371 117.655 98.7644 117.789C99.0917 117.923 99.4423 117.991 99.7959 117.988C100.15 117.985 100.499 117.911 100.824 117.771C101.149 117.632 101.443 117.429 101.688 117.175L105.132 113.732L108.575 117.175C109.077 117.66 109.75 117.928 110.448 117.922C111.146 117.916 111.814 117.636 112.308 117.142C112.802 116.648 113.082 115.981 113.088 115.282C113.094 114.584 112.826 113.911 112.34 113.409L108.897 109.966L112.34 106.523C112.588 106.275 112.784 105.982 112.918 105.659C113.052 105.336 113.121 104.989 113.121 104.64C113.121 104.29 113.052 103.944 112.918 103.621C112.784 103.298 112.588 103.004 112.34 102.757ZM151.506 109.966L154.949 106.523C155.434 106.02 155.703 105.348 155.697 104.649C155.691 103.951 155.41 103.283 154.917 102.789C154.423 102.296 153.755 102.016 153.057 102.01C152.359 102.003 151.686 102.272 151.184 102.757L147.74 106.2L144.297 102.757C143.795 102.272 143.122 102.003 142.424 102.01C141.726 102.016 141.058 102.296 140.564 102.789C140.07 103.283 139.79 103.951 139.784 104.649C139.778 105.348 140.046 106.02 140.531 106.523L143.974 109.966L140.531 113.409C140.277 113.655 140.074 113.949 139.935 114.274C139.795 114.598 139.722 114.948 139.719 115.301C139.715 115.655 139.783 116.006 139.917 116.333C140.051 116.66 140.248 116.958 140.498 117.208C140.748 117.458 141.046 117.655 141.373 117.789C141.7 117.923 142.051 117.991 142.405 117.988C142.758 117.985 143.108 117.911 143.433 117.771C143.757 117.632 144.051 117.429 144.297 117.175L147.74 113.732L151.184 117.175C151.686 117.66 152.359 117.928 153.057 117.922C153.755 117.916 154.423 117.636 154.917 117.142C155.41 116.648 155.691 115.981 155.697 115.282C155.703 114.584 155.434 113.911 154.949 113.409L151.506 109.966Z\" fill=\"#93939A\"/>\n <path d=\"M190.242 160.457L170.136 140.351C166.533 145.552 162.023 150.063 156.821 153.666L176.927 173.772C178.693 175.538 181.088 176.53 183.585 176.53C186.082 176.53 188.477 175.538 190.242 173.772C192.008 172.007 193 169.612 193 167.115C193 164.618 192.008 162.223 190.242 160.457ZM126.436 157.901C116.955 157.901 107.688 155.089 99.8048 149.822C91.922 144.555 85.7781 137.069 82.15 128.31C78.5219 119.551 77.5727 109.913 79.4222 100.614C81.2718 91.3158 85.8371 82.7746 92.5409 76.0708C99.2447 69.367 107.786 64.8017 117.084 62.9521C126.383 61.1026 136.021 62.0518 144.78 65.6799C153.539 69.308 161.025 75.4519 166.292 83.3347C171.559 91.2175 174.371 100.485 174.371 109.966C174.371 122.679 169.32 134.871 160.331 143.861C151.341 152.85 139.149 157.901 126.436 157.901ZM163.719 109.966C163.719 102.592 161.532 95.3838 157.435 89.2527C153.339 83.1216 147.516 78.343 140.703 75.5212C133.891 72.6994 126.395 71.9611 119.162 73.3996C111.93 74.8382 105.287 78.389 100.073 83.6031C94.8591 88.8171 91.3083 95.4602 89.8697 102.692C88.4312 109.924 89.1695 117.421 91.9913 124.233C94.8131 131.046 99.5918 136.869 105.723 140.965C111.854 145.062 119.062 147.248 126.436 147.248C136.324 147.248 145.807 143.32 152.799 136.329C159.791 129.337 163.719 119.854 163.719 109.966ZM133.645 102.757C133.398 102.51 133.104 102.313 132.781 102.179C132.458 102.046 132.112 101.977 131.762 101.977C131.412 101.977 131.066 102.046 130.743 102.179C130.42 102.313 130.126 102.51 129.879 102.757L126.436 106.2L122.993 102.757C122.49 102.272 121.818 102.003 121.119 102.01C120.421 102.016 119.753 102.296 119.26 102.789C118.766 103.283 118.486 103.951 118.48 104.649C118.474 105.348 118.742 106.02 119.227 106.523L122.67 109.966L119.227 113.409C118.973 113.655 118.77 113.949 118.63 114.274C118.491 114.598 118.417 114.948 118.414 115.301C118.411 115.655 118.479 116.006 118.612 116.333C118.746 116.66 118.944 116.958 119.194 117.208C119.444 117.458 119.741 117.655 120.069 117.789C120.396 117.923 120.747 117.991 121.1 117.988C121.454 117.985 121.803 117.911 122.128 117.771C122.453 117.632 122.747 117.429 122.993 117.175L126.436 113.732L129.879 117.175C130.382 117.66 131.054 117.928 131.752 117.922C132.451 117.916 133.119 117.636 133.612 117.142C134.106 116.648 134.386 115.981 134.392 115.282C134.398 114.584 134.13 113.911 133.645 113.409L130.202 109.966L133.645 106.523C133.892 106.275 134.088 105.982 134.222 105.659C134.356 105.336 134.425 104.989 134.425 104.64C134.425 104.29 134.356 103.944 134.222 103.621C134.088 103.298 133.892 103.004 133.645 102.757ZM112.34 102.757C112.093 102.51 111.8 102.313 111.477 102.179C111.154 102.046 110.807 101.977 110.458 101.977C110.108 101.977 109.762 102.046 109.439 102.179C109.116 102.313 108.822 102.51 108.575 102.757L105.132 106.2L101.688 102.757C101.186 102.272 100.513 102.003 99.8151 102.01C99.1169 102.016 98.4489 102.296 97.9552 102.789C97.4614 103.283 97.1814 103.951 97.1753 104.649C97.1692 105.348 97.4377 106.02 97.9227 106.523L101.366 109.966L97.9227 113.409C97.6684 113.655 97.4655 113.949 97.326 114.274C97.1864 114.598 97.1129 114.948 97.1098 115.301C97.1068 115.655 97.1742 116.006 97.3081 116.333C97.442 116.66 97.6397 116.958 97.8897 117.208C98.1398 117.458 98.4371 117.655 98.7644 117.789C99.0917 117.923 99.4423 117.991 99.7959 117.988C100.15 117.985 100.499 117.911 100.824 117.771C101.149 117.632 101.443 117.429 101.688 117.175L105.132 113.732L108.575 117.175C109.077 117.66 109.75 117.928 110.448 117.922C111.146 117.916 111.814 117.636 112.308 117.142C112.802 116.648 113.082 115.981 113.088 115.282C113.094 114.584 112.826 113.911 112.34 113.409L108.897 109.966L112.34 106.523C112.588 106.275 112.784 105.982 112.918 105.659C113.052 105.336 113.121 104.989 113.121 104.64C113.121 104.29 113.052 103.944 112.918 103.621C112.784 103.298 112.588 103.004 112.34 102.757ZM151.506 109.966L154.949 106.523C155.434 106.02 155.703 105.348 155.697 104.649C155.691 103.951 155.41 103.283 154.917 102.789C154.423 102.296 153.755 102.016 153.057 102.01C152.359 102.003 151.686 102.272 151.184 102.757L147.74 106.2L144.297 102.757C143.795 102.272 143.122 102.003 142.424 102.01C141.726 102.016 141.058 102.296 140.564 102.789C140.07 103.283 139.79 103.951 139.784 104.649C139.778 105.348 140.046 106.02 140.531 106.523L143.974 109.966L140.531 113.409C140.277 113.655 140.074 113.949 139.935 114.274C139.795 114.598 139.722 114.948 139.719 115.301C139.715 115.655 139.783 116.006 139.917 116.333C140.051 116.66 140.248 116.958 140.498 117.208C140.748 117.458 141.046 117.655 141.373 117.789C141.7 117.923 142.051 117.991 142.405 117.988C142.758 117.985 143.108 117.911 143.433 117.771C143.757 117.632 144.051 117.429 144.297 117.175L147.74 113.732L151.184 117.175C151.686 117.66 152.359 117.928 153.057 117.922C153.755 117.916 154.423 117.636 154.917 117.142C155.41 116.648 155.691 115.981 155.697 115.282C155.703 114.584 155.434 113.911 154.949 113.409L151.506 109.966Z\" stroke=\"transparent\" stroke-width=\"20\" mask=\"url(#path-2-outside-1_0_1)\"/>\n </g>\n <defs>\n <clipPath id=\"clip0_0_1\">\n <rect width=\"200\" height=\"200\" fill=\"white\"/>\n </clipPath>\n </defs>\n </svg>\n </div>\n <div class=\"errorContainer\"></div>\n </div>\n</div>\n";
|
|
1457
|
+
var template = "<div>\n <label class=\"ff-card-form-label\" for=\"cardNumberInput\">Card number</label>\n <div id=\"cardNumberInput\"></div>\n <div class=\"errorContainer\"></div>\n</div>\n<div class=\"card-form-row\">\n <div>\n <label class=\"ff-card-form-label\" for=\"expiryInput\">Expiration date</label>\n <div id=\"expiryInput\"></div>\n <div class=\"errorContainer\"></div>\n </div>\n <div>\n <label class=\"ff-card-form-label\" for=\"cvvInput\">Security code</label>\n <div id=\"cvvInput\">\n <svg width=\"200\" height=\"200\" viewBox=\"0 0 200 200\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect width=\"200\" height=\"200\" fill=\"transparent\"/>\n <g clip-path=\"url(#clip0_0_1)\">\n <path d=\"M157.555 23C168.279 23.0002 177 31.7394 177 42.4854V80.5889C171.946 72.0151 164.749 64.8558 156.146 59.8457H166.394V42.4854C166.393 37.6004 162.43 33.6291 157.555 33.6289H27.4453C22.5704 33.6291 18.6066 37.6004 18.6064 42.4854V59.8457H97.8535C88.9153 65.0512 81.4954 72.5771 76.4189 81.5986H18.6064V127.515C18.6066 132.4 22.5704 136.371 27.4453 136.371H75.3281C77.2742 140.177 79.6285 143.739 82.333 147H27.4453C16.7215 147 8.00019 138.261 8 127.515V42.4854C8.0002 31.7394 16.7215 23.0002 27.4453 23H157.555Z\" fill=\"#93939A\"/>\n <mask id=\"path-2-outside-1_0_1\" maskUnits=\"userSpaceOnUse\" x=\"68.5012\" y=\"52.0311\" width=\"135\" height=\"135\" fill=\"black\">\n <rect fill=\"white\" x=\"68.5012\" y=\"52.0311\" width=\"135\" height=\"135\"/>\n <path d=\"M190.242 160.457L170.136 140.351C166.533 145.552 162.023 150.063 156.821 153.666L176.927 173.772C178.693 175.538 181.088 176.53 183.585 176.53C186.082 176.53 188.477 175.538 190.242 173.772C192.008 172.007 193 169.612 193 167.115C193 164.618 192.008 162.223 190.242 160.457ZM126.436 157.901C116.955 157.901 107.688 155.089 99.8048 149.822C91.922 144.555 85.7781 137.069 82.15 128.31C78.5219 119.551 77.5727 109.913 79.4222 100.614C81.2718 91.3158 85.8371 82.7746 92.5409 76.0708C99.2447 69.367 107.786 64.8017 117.084 62.9521C126.383 61.1026 136.021 62.0518 144.78 65.6799C153.539 69.308 161.025 75.4519 166.292 83.3347C171.559 91.2175 174.371 100.485 174.371 109.966C174.371 122.679 169.32 134.871 160.331 143.861C151.341 152.85 139.149 157.901 126.436 157.901ZM163.719 109.966C163.719 102.592 161.532 95.3838 157.435 89.2527C153.339 83.1216 147.516 78.343 140.703 75.5212C133.891 72.6994 126.395 71.9611 119.162 73.3996C111.93 74.8382 105.287 78.389 100.073 83.6031C94.8591 88.8171 91.3083 95.4602 89.8697 102.692C88.4312 109.924 89.1695 117.421 91.9913 124.233C94.8131 131.046 99.5918 136.869 105.723 140.965C111.854 145.062 119.062 147.248 126.436 147.248C136.324 147.248 145.807 143.32 152.799 136.329C159.791 129.337 163.719 119.854 163.719 109.966ZM133.645 102.757C133.398 102.51 133.104 102.313 132.781 102.179C132.458 102.046 132.112 101.977 131.762 101.977C131.412 101.977 131.066 102.046 130.743 102.179C130.42 102.313 130.126 102.51 129.879 102.757L126.436 106.2L122.993 102.757C122.49 102.272 121.818 102.003 121.119 102.01C120.421 102.016 119.753 102.296 119.26 102.789C118.766 103.283 118.486 103.951 118.48 104.649C118.474 105.348 118.742 106.02 119.227 106.523L122.67 109.966L119.227 113.409C118.973 113.655 118.77 113.949 118.63 114.274C118.491 114.598 118.417 114.948 118.414 115.301C118.411 115.655 118.479 116.006 118.612 116.333C118.746 116.66 118.944 116.958 119.194 117.208C119.444 117.458 119.741 117.655 120.069 117.789C120.396 117.923 120.747 117.991 121.1 117.988C121.454 117.985 121.803 117.911 122.128 117.771C122.453 117.632 122.747 117.429 122.993 117.175L126.436 113.732L129.879 117.175C130.382 117.66 131.054 117.928 131.752 117.922C132.451 117.916 133.119 117.636 133.612 117.142C134.106 116.648 134.386 115.981 134.392 115.282C134.398 114.584 134.13 113.911 133.645 113.409L130.202 109.966L133.645 106.523C133.892 106.275 134.088 105.982 134.222 105.659C134.356 105.336 134.425 104.989 134.425 104.64C134.425 104.29 134.356 103.944 134.222 103.621C134.088 103.298 133.892 103.004 133.645 102.757ZM112.34 102.757C112.093 102.51 111.8 102.313 111.477 102.179C111.154 102.046 110.807 101.977 110.458 101.977C110.108 101.977 109.762 102.046 109.439 102.179C109.116 102.313 108.822 102.51 108.575 102.757L105.132 106.2L101.688 102.757C101.186 102.272 100.513 102.003 99.8151 102.01C99.1169 102.016 98.4489 102.296 97.9552 102.789C97.4614 103.283 97.1814 103.951 97.1753 104.649C97.1692 105.348 97.4377 106.02 97.9227 106.523L101.366 109.966L97.9227 113.409C97.6684 113.655 97.4655 113.949 97.326 114.274C97.1864 114.598 97.1129 114.948 97.1098 115.301C97.1068 115.655 97.1742 116.006 97.3081 116.333C97.442 116.66 97.6397 116.958 97.8897 117.208C98.1398 117.458 98.4371 117.655 98.7644 117.789C99.0917 117.923 99.4423 117.991 99.7959 117.988C100.15 117.985 100.499 117.911 100.824 117.771C101.149 117.632 101.443 117.429 101.688 117.175L105.132 113.732L108.575 117.175C109.077 117.66 109.75 117.928 110.448 117.922C111.146 117.916 111.814 117.636 112.308 117.142C112.802 116.648 113.082 115.981 113.088 115.282C113.094 114.584 112.826 113.911 112.34 113.409L108.897 109.966L112.34 106.523C112.588 106.275 112.784 105.982 112.918 105.659C113.052 105.336 113.121 104.989 113.121 104.64C113.121 104.29 113.052 103.944 112.918 103.621C112.784 103.298 112.588 103.004 112.34 102.757ZM151.506 109.966L154.949 106.523C155.434 106.02 155.703 105.348 155.697 104.649C155.691 103.951 155.41 103.283 154.917 102.789C154.423 102.296 153.755 102.016 153.057 102.01C152.359 102.003 151.686 102.272 151.184 102.757L147.74 106.2L144.297 102.757C143.795 102.272 143.122 102.003 142.424 102.01C141.726 102.016 141.058 102.296 140.564 102.789C140.07 103.283 139.79 103.951 139.784 104.649C139.778 105.348 140.046 106.02 140.531 106.523L143.974 109.966L140.531 113.409C140.277 113.655 140.074 113.949 139.935 114.274C139.795 114.598 139.722 114.948 139.719 115.301C139.715 115.655 139.783 116.006 139.917 116.333C140.051 116.66 140.248 116.958 140.498 117.208C140.748 117.458 141.046 117.655 141.373 117.789C141.7 117.923 142.051 117.991 142.405 117.988C142.758 117.985 143.108 117.911 143.433 117.771C143.757 117.632 144.051 117.429 144.297 117.175L147.74 113.732L151.184 117.175C151.686 117.66 152.359 117.928 153.057 117.922C153.755 117.916 154.423 117.636 154.917 117.142C155.41 116.648 155.691 115.981 155.697 115.282C155.703 114.584 155.434 113.911 154.949 113.409L151.506 109.966Z\"/>\n </mask>\n <path d=\"M190.242 160.457L170.136 140.351C166.533 145.552 162.023 150.063 156.821 153.666L176.927 173.772C178.693 175.538 181.088 176.53 183.585 176.53C186.082 176.53 188.477 175.538 190.242 173.772C192.008 172.007 193 169.612 193 167.115C193 164.618 192.008 162.223 190.242 160.457ZM126.436 157.901C116.955 157.901 107.688 155.089 99.8048 149.822C91.922 144.555 85.7781 137.069 82.15 128.31C78.5219 119.551 77.5727 109.913 79.4222 100.614C81.2718 91.3158 85.8371 82.7746 92.5409 76.0708C99.2447 69.367 107.786 64.8017 117.084 62.9521C126.383 61.1026 136.021 62.0518 144.78 65.6799C153.539 69.308 161.025 75.4519 166.292 83.3347C171.559 91.2175 174.371 100.485 174.371 109.966C174.371 122.679 169.32 134.871 160.331 143.861C151.341 152.85 139.149 157.901 126.436 157.901ZM163.719 109.966C163.719 102.592 161.532 95.3838 157.435 89.2527C153.339 83.1216 147.516 78.343 140.703 75.5212C133.891 72.6994 126.395 71.9611 119.162 73.3996C111.93 74.8382 105.287 78.389 100.073 83.6031C94.8591 88.8171 91.3083 95.4602 89.8697 102.692C88.4312 109.924 89.1695 117.421 91.9913 124.233C94.8131 131.046 99.5918 136.869 105.723 140.965C111.854 145.062 119.062 147.248 126.436 147.248C136.324 147.248 145.807 143.32 152.799 136.329C159.791 129.337 163.719 119.854 163.719 109.966ZM133.645 102.757C133.398 102.51 133.104 102.313 132.781 102.179C132.458 102.046 132.112 101.977 131.762 101.977C131.412 101.977 131.066 102.046 130.743 102.179C130.42 102.313 130.126 102.51 129.879 102.757L126.436 106.2L122.993 102.757C122.49 102.272 121.818 102.003 121.119 102.01C120.421 102.016 119.753 102.296 119.26 102.789C118.766 103.283 118.486 103.951 118.48 104.649C118.474 105.348 118.742 106.02 119.227 106.523L122.67 109.966L119.227 113.409C118.973 113.655 118.77 113.949 118.63 114.274C118.491 114.598 118.417 114.948 118.414 115.301C118.411 115.655 118.479 116.006 118.612 116.333C118.746 116.66 118.944 116.958 119.194 117.208C119.444 117.458 119.741 117.655 120.069 117.789C120.396 117.923 120.747 117.991 121.1 117.988C121.454 117.985 121.803 117.911 122.128 117.771C122.453 117.632 122.747 117.429 122.993 117.175L126.436 113.732L129.879 117.175C130.382 117.66 131.054 117.928 131.752 117.922C132.451 117.916 133.119 117.636 133.612 117.142C134.106 116.648 134.386 115.981 134.392 115.282C134.398 114.584 134.13 113.911 133.645 113.409L130.202 109.966L133.645 106.523C133.892 106.275 134.088 105.982 134.222 105.659C134.356 105.336 134.425 104.989 134.425 104.64C134.425 104.29 134.356 103.944 134.222 103.621C134.088 103.298 133.892 103.004 133.645 102.757ZM112.34 102.757C112.093 102.51 111.8 102.313 111.477 102.179C111.154 102.046 110.807 101.977 110.458 101.977C110.108 101.977 109.762 102.046 109.439 102.179C109.116 102.313 108.822 102.51 108.575 102.757L105.132 106.2L101.688 102.757C101.186 102.272 100.513 102.003 99.8151 102.01C99.1169 102.016 98.4489 102.296 97.9552 102.789C97.4614 103.283 97.1814 103.951 97.1753 104.649C97.1692 105.348 97.4377 106.02 97.9227 106.523L101.366 109.966L97.9227 113.409C97.6684 113.655 97.4655 113.949 97.326 114.274C97.1864 114.598 97.1129 114.948 97.1098 115.301C97.1068 115.655 97.1742 116.006 97.3081 116.333C97.442 116.66 97.6397 116.958 97.8897 117.208C98.1398 117.458 98.4371 117.655 98.7644 117.789C99.0917 117.923 99.4423 117.991 99.7959 117.988C100.15 117.985 100.499 117.911 100.824 117.771C101.149 117.632 101.443 117.429 101.688 117.175L105.132 113.732L108.575 117.175C109.077 117.66 109.75 117.928 110.448 117.922C111.146 117.916 111.814 117.636 112.308 117.142C112.802 116.648 113.082 115.981 113.088 115.282C113.094 114.584 112.826 113.911 112.34 113.409L108.897 109.966L112.34 106.523C112.588 106.275 112.784 105.982 112.918 105.659C113.052 105.336 113.121 104.989 113.121 104.64C113.121 104.29 113.052 103.944 112.918 103.621C112.784 103.298 112.588 103.004 112.34 102.757ZM151.506 109.966L154.949 106.523C155.434 106.02 155.703 105.348 155.697 104.649C155.691 103.951 155.41 103.283 154.917 102.789C154.423 102.296 153.755 102.016 153.057 102.01C152.359 102.003 151.686 102.272 151.184 102.757L147.74 106.2L144.297 102.757C143.795 102.272 143.122 102.003 142.424 102.01C141.726 102.016 141.058 102.296 140.564 102.789C140.07 103.283 139.79 103.951 139.784 104.649C139.778 105.348 140.046 106.02 140.531 106.523L143.974 109.966L140.531 113.409C140.277 113.655 140.074 113.949 139.935 114.274C139.795 114.598 139.722 114.948 139.719 115.301C139.715 115.655 139.783 116.006 139.917 116.333C140.051 116.66 140.248 116.958 140.498 117.208C140.748 117.458 141.046 117.655 141.373 117.789C141.7 117.923 142.051 117.991 142.405 117.988C142.758 117.985 143.108 117.911 143.433 117.771C143.757 117.632 144.051 117.429 144.297 117.175L147.74 113.732L151.184 117.175C151.686 117.66 152.359 117.928 153.057 117.922C153.755 117.916 154.423 117.636 154.917 117.142C155.41 116.648 155.691 115.981 155.697 115.282C155.703 114.584 155.434 113.911 154.949 113.409L151.506 109.966Z\" fill=\"#93939A\"/>\n <path d=\"M190.242 160.457L170.136 140.351C166.533 145.552 162.023 150.063 156.821 153.666L176.927 173.772C178.693 175.538 181.088 176.53 183.585 176.53C186.082 176.53 188.477 175.538 190.242 173.772C192.008 172.007 193 169.612 193 167.115C193 164.618 192.008 162.223 190.242 160.457ZM126.436 157.901C116.955 157.901 107.688 155.089 99.8048 149.822C91.922 144.555 85.7781 137.069 82.15 128.31C78.5219 119.551 77.5727 109.913 79.4222 100.614C81.2718 91.3158 85.8371 82.7746 92.5409 76.0708C99.2447 69.367 107.786 64.8017 117.084 62.9521C126.383 61.1026 136.021 62.0518 144.78 65.6799C153.539 69.308 161.025 75.4519 166.292 83.3347C171.559 91.2175 174.371 100.485 174.371 109.966C174.371 122.679 169.32 134.871 160.331 143.861C151.341 152.85 139.149 157.901 126.436 157.901ZM163.719 109.966C163.719 102.592 161.532 95.3838 157.435 89.2527C153.339 83.1216 147.516 78.343 140.703 75.5212C133.891 72.6994 126.395 71.9611 119.162 73.3996C111.93 74.8382 105.287 78.389 100.073 83.6031C94.8591 88.8171 91.3083 95.4602 89.8697 102.692C88.4312 109.924 89.1695 117.421 91.9913 124.233C94.8131 131.046 99.5918 136.869 105.723 140.965C111.854 145.062 119.062 147.248 126.436 147.248C136.324 147.248 145.807 143.32 152.799 136.329C159.791 129.337 163.719 119.854 163.719 109.966ZM133.645 102.757C133.398 102.51 133.104 102.313 132.781 102.179C132.458 102.046 132.112 101.977 131.762 101.977C131.412 101.977 131.066 102.046 130.743 102.179C130.42 102.313 130.126 102.51 129.879 102.757L126.436 106.2L122.993 102.757C122.49 102.272 121.818 102.003 121.119 102.01C120.421 102.016 119.753 102.296 119.26 102.789C118.766 103.283 118.486 103.951 118.48 104.649C118.474 105.348 118.742 106.02 119.227 106.523L122.67 109.966L119.227 113.409C118.973 113.655 118.77 113.949 118.63 114.274C118.491 114.598 118.417 114.948 118.414 115.301C118.411 115.655 118.479 116.006 118.612 116.333C118.746 116.66 118.944 116.958 119.194 117.208C119.444 117.458 119.741 117.655 120.069 117.789C120.396 117.923 120.747 117.991 121.1 117.988C121.454 117.985 121.803 117.911 122.128 117.771C122.453 117.632 122.747 117.429 122.993 117.175L126.436 113.732L129.879 117.175C130.382 117.66 131.054 117.928 131.752 117.922C132.451 117.916 133.119 117.636 133.612 117.142C134.106 116.648 134.386 115.981 134.392 115.282C134.398 114.584 134.13 113.911 133.645 113.409L130.202 109.966L133.645 106.523C133.892 106.275 134.088 105.982 134.222 105.659C134.356 105.336 134.425 104.989 134.425 104.64C134.425 104.29 134.356 103.944 134.222 103.621C134.088 103.298 133.892 103.004 133.645 102.757ZM112.34 102.757C112.093 102.51 111.8 102.313 111.477 102.179C111.154 102.046 110.807 101.977 110.458 101.977C110.108 101.977 109.762 102.046 109.439 102.179C109.116 102.313 108.822 102.51 108.575 102.757L105.132 106.2L101.688 102.757C101.186 102.272 100.513 102.003 99.8151 102.01C99.1169 102.016 98.4489 102.296 97.9552 102.789C97.4614 103.283 97.1814 103.951 97.1753 104.649C97.1692 105.348 97.4377 106.02 97.9227 106.523L101.366 109.966L97.9227 113.409C97.6684 113.655 97.4655 113.949 97.326 114.274C97.1864 114.598 97.1129 114.948 97.1098 115.301C97.1068 115.655 97.1742 116.006 97.3081 116.333C97.442 116.66 97.6397 116.958 97.8897 117.208C98.1398 117.458 98.4371 117.655 98.7644 117.789C99.0917 117.923 99.4423 117.991 99.7959 117.988C100.15 117.985 100.499 117.911 100.824 117.771C101.149 117.632 101.443 117.429 101.688 117.175L105.132 113.732L108.575 117.175C109.077 117.66 109.75 117.928 110.448 117.922C111.146 117.916 111.814 117.636 112.308 117.142C112.802 116.648 113.082 115.981 113.088 115.282C113.094 114.584 112.826 113.911 112.34 113.409L108.897 109.966L112.34 106.523C112.588 106.275 112.784 105.982 112.918 105.659C113.052 105.336 113.121 104.989 113.121 104.64C113.121 104.29 113.052 103.944 112.918 103.621C112.784 103.298 112.588 103.004 112.34 102.757ZM151.506 109.966L154.949 106.523C155.434 106.02 155.703 105.348 155.697 104.649C155.691 103.951 155.41 103.283 154.917 102.789C154.423 102.296 153.755 102.016 153.057 102.01C152.359 102.003 151.686 102.272 151.184 102.757L147.74 106.2L144.297 102.757C143.795 102.272 143.122 102.003 142.424 102.01C141.726 102.016 141.058 102.296 140.564 102.789C140.07 103.283 139.79 103.951 139.784 104.649C139.778 105.348 140.046 106.02 140.531 106.523L143.974 109.966L140.531 113.409C140.277 113.655 140.074 113.949 139.935 114.274C139.795 114.598 139.722 114.948 139.719 115.301C139.715 115.655 139.783 116.006 139.917 116.333C140.051 116.66 140.248 116.958 140.498 117.208C140.748 117.458 141.046 117.655 141.373 117.789C141.7 117.923 142.051 117.991 142.405 117.988C142.758 117.985 143.108 117.911 143.433 117.771C143.757 117.632 144.051 117.429 144.297 117.175L147.74 113.732L151.184 117.175C151.686 117.66 152.359 117.928 153.057 117.922C153.755 117.916 154.423 117.636 154.917 117.142C155.41 116.648 155.691 115.981 155.697 115.282C155.703 114.584 155.434 113.911 154.949 113.409L151.506 109.966Z\" stroke=\"transparent\" stroke-width=\"20\" mask=\"url(#path-2-outside-1_0_1)\"/>\n </g>\n <defs>\n <clipPath id=\"clip0_0_1\">\n <rect width=\"200\" height=\"200\" fill=\"white\"/>\n </clipPath>\n </defs>\n </svg>\n </div>\n <div class=\"errorContainer\"></div>\n </div>\n</div>\n<div>\n <label class=\"ff-card-form-label\" for=\"cardHolderInput\">Card holder</label>\n <input class=\"ff-card-form-cardholder-input\" id=\"cardHolderInput\" placeholder=\"Card holder\">\n <div class=\"errorContainer\"></div>\n</div>\n";
|
|
1359
1458
|
|
|
1360
|
-
if(typeof document!=="undefined")document.head.appendChild(document.createElement("style")).textContent="\n\n.ff-card-form-label {\n display: block;\n font-size: 16px;\n margin-bottom: 5px;\n }\n \n .card-form-row {\n display: flex;\n flex-direction: row;\n gap: 10px;\n }\n \n .ff-card-form-cardholder-input {\n padding-left: 10px;\n padding-right: 10px;\n box-sizing: border-box;\n height: 36px;\n width: 100%;\n font-size: 1rem;\n background-color: transparent;\n border: 1px solid rgb(0 0 0 / 10%);\n border-radius: 6px;\n transition: all 0.3s ease;\n box-shadow: none;\n }\n .ff-card-form-cardholder-input.error {\n border-color: #e32f41;\n }\n \n .errorContainer {\n color: #d10000;\n font-size: 16px;\n }\n\n #cvvInput {\n position: relative;\n }\n \n #cvvInput > svg {\n z-index: 1;\n position: absolute;\n top: 5px;\n right: 5px;\n width: 26px;\n height: 26px;\n }";
|
|
1459
|
+
if(typeof document!=="undefined")document.head.appendChild(document.createElement("style")).textContent="\n\n.ff-card-form-label {\n display: block;\n font-size: 16px;\n margin-bottom: 5px;\n }\n \n .card-form-row {\n display: flex;\n flex-direction: row;\n gap: 10px;\n }\n \n .ff-card-form-cardholder-input {\n margin: 0 0 3px;\n padding-left: 10px;\n padding-right: 10px;\n box-sizing: border-box;\n height: 36px;\n width: 100%;\n font-size: 1rem;\n background-color: transparent;\n border: 1px solid rgb(0 0 0 / 10%);\n border-radius: 6px;\n transition: all 0.3s ease;\n box-shadow: none;\n outline: none;\n }\n .ff-card-form-cardholder-input.error {\n border-color: #e32f41;\n }\n \n .errorContainer:not(:empty) {\n color: #d10000;\n font-size: 16px;\n line-height: 1;\n margin: 0 0 10px;\n }\n\n #cvvInput {\n position: relative;\n }\n \n #cvvInput > svg {\n z-index: 1;\n position: absolute;\n top: 5px;\n right: 5px;\n width: 26px;\n height: 26px;\n }";
|
|
1361
1460
|
|
|
1362
1461
|
class CardSkin {
|
|
1363
|
-
constructor(containerEl) {
|
|
1462
|
+
constructor(containerEl, checkoutConfig) {
|
|
1364
1463
|
this.onInputError = (event) => {
|
|
1365
1464
|
const { name, error } = event;
|
|
1366
1465
|
const cardInputElements = this.getCardInputElements();
|
|
@@ -1368,34 +1467,58 @@
|
|
|
1368
1467
|
cardNumber: cardInputElements.cardNumber.parentElement,
|
|
1369
1468
|
expiryDate: cardInputElements.expiryDate.parentElement,
|
|
1370
1469
|
cvv: cardInputElements.cvv.parentElement,
|
|
1470
|
+
cardholderName: cardInputElements.cardholderName?.parentElement,
|
|
1371
1471
|
};
|
|
1372
1472
|
const errorContainer = elementsMap[name]?.querySelector('.errorContainer');
|
|
1373
1473
|
if (errorContainer) {
|
|
1374
1474
|
errorContainer.textContent = error || '';
|
|
1375
1475
|
}
|
|
1476
|
+
if (name === 'cardholderName') {
|
|
1477
|
+
if (error) {
|
|
1478
|
+
cardInputElements.cardholderName?.classList?.add('error');
|
|
1479
|
+
}
|
|
1480
|
+
else {
|
|
1481
|
+
cardInputElements.cardholderName?.classList?.remove('error');
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
};
|
|
1485
|
+
this.onMethodRender = () => {
|
|
1486
|
+
this.containerEl.style.display = 'block';
|
|
1487
|
+
};
|
|
1488
|
+
this.onDestroy = () => {
|
|
1489
|
+
this.containerEl.remove();
|
|
1376
1490
|
};
|
|
1377
1491
|
if (!containerEl) {
|
|
1378
1492
|
throw new Error('Container element not found');
|
|
1379
1493
|
}
|
|
1380
1494
|
this.containerEl = containerEl;
|
|
1381
|
-
|
|
1382
|
-
this.
|
|
1383
|
-
cardNumber: document.createElement('div'),
|
|
1384
|
-
expiryDate: document.createElement('div'),
|
|
1385
|
-
cvv: document.createElement('div'),
|
|
1386
|
-
};
|
|
1495
|
+
this.checkoutConfig = checkoutConfig;
|
|
1496
|
+
this.containerEl.style.display = 'none';
|
|
1387
1497
|
}
|
|
1388
1498
|
wireCardInputs() {
|
|
1389
1499
|
const cardNumber = this.containerEl.querySelector('#cardNumberInput');
|
|
1390
1500
|
const expiryDate = this.containerEl.querySelector('#expiryInput');
|
|
1391
1501
|
const cvv = this.containerEl.querySelector('#cvvInput');
|
|
1392
|
-
|
|
1502
|
+
const hasCardholderInput = !!this.checkoutConfig?.card?.cardholderName;
|
|
1503
|
+
let cardholderName = undefined;
|
|
1504
|
+
if (hasCardholderInput) {
|
|
1505
|
+
cardholderName =
|
|
1506
|
+
this.containerEl.querySelector('#cardHolderInput');
|
|
1507
|
+
}
|
|
1508
|
+
else {
|
|
1509
|
+
this.containerEl.querySelector('#cardHolderInput').parentElement.style.display = 'none';
|
|
1510
|
+
}
|
|
1511
|
+
if (!cardNumber ||
|
|
1512
|
+
!expiryDate ||
|
|
1513
|
+
!cvv ||
|
|
1514
|
+
(hasCardholderInput && !cardholderName)) {
|
|
1393
1515
|
throw new Error('One or more card input elements are missing in the default skin');
|
|
1394
1516
|
}
|
|
1395
1517
|
this.cardInputElements = {
|
|
1396
1518
|
cardNumber,
|
|
1397
1519
|
expiryDate,
|
|
1398
1520
|
cvv,
|
|
1521
|
+
cardholderName,
|
|
1399
1522
|
};
|
|
1400
1523
|
}
|
|
1401
1524
|
async init() {
|
|
@@ -1422,7 +1545,7 @@
|
|
|
1422
1545
|
cardElements: this.getCardInputElements(),
|
|
1423
1546
|
card: {
|
|
1424
1547
|
cardholderName: {
|
|
1425
|
-
required:
|
|
1548
|
+
required: !!this.checkoutConfig?.card?.cardholderName,
|
|
1426
1549
|
},
|
|
1427
1550
|
},
|
|
1428
1551
|
};
|
|
@@ -1441,9 +1564,8 @@
|
|
|
1441
1564
|
[exports.PaymentMethod.APPLE_PAY]: applePayTemplate,
|
|
1442
1565
|
};
|
|
1443
1566
|
class DefaultSkin {
|
|
1444
|
-
constructor(
|
|
1567
|
+
constructor(checkoutConfig) {
|
|
1445
1568
|
this.onLoaderChange = (isLoading) => {
|
|
1446
|
-
this.primerWrapper.disableButtons(isLoading);
|
|
1447
1569
|
document
|
|
1448
1570
|
.querySelectorAll(`${this.containerSelector} .loader-container`)
|
|
1449
1571
|
?.forEach(loaderEl => {
|
|
@@ -1497,10 +1619,17 @@
|
|
|
1497
1619
|
this.onMethodRender = (paymentMethod) => {
|
|
1498
1620
|
const methodKey = paymentMethod.replace('_', '-').toLowerCase();
|
|
1499
1621
|
const methodContainer = this.containerEl.querySelector(`.ff-payment-method-${methodKey}`);
|
|
1622
|
+
if (paymentMethod === exports.PaymentMethod.PAYMENT_CARD) {
|
|
1623
|
+
this.cardInstance.onMethodRender();
|
|
1624
|
+
}
|
|
1500
1625
|
if (methodContainer) {
|
|
1501
1626
|
methodContainer.classList.add('visible');
|
|
1502
1627
|
}
|
|
1503
1628
|
};
|
|
1629
|
+
this.onMethodsAvailable = (methods) => {
|
|
1630
|
+
this.availableMethods = methods;
|
|
1631
|
+
this.initAccordion();
|
|
1632
|
+
};
|
|
1504
1633
|
this.onStartPurchase = (paymentMethod) => {
|
|
1505
1634
|
this.currentPurchaseMethod = paymentMethod;
|
|
1506
1635
|
};
|
|
@@ -1513,14 +1642,14 @@
|
|
|
1513
1642
|
this.onPurchaseCompleted = () => {
|
|
1514
1643
|
this.currentPurchaseMethod = null;
|
|
1515
1644
|
};
|
|
1516
|
-
this.containerSelector =
|
|
1517
|
-
this.paymentMethodOrder = paymentMethodOrder;
|
|
1518
|
-
const containerEl = document.querySelector(containerSelector);
|
|
1645
|
+
this.containerSelector = checkoutConfig.container;
|
|
1646
|
+
this.paymentMethodOrder = checkoutConfig.paymentMethodOrder;
|
|
1647
|
+
const containerEl = document.querySelector(this.containerSelector);
|
|
1519
1648
|
if (!containerEl) {
|
|
1520
|
-
throw new Error(`Container element not found for selector: ${containerSelector}`);
|
|
1649
|
+
throw new Error(`Container element not found for selector: ${this.containerSelector}`);
|
|
1521
1650
|
}
|
|
1522
1651
|
this.containerEl = containerEl;
|
|
1523
|
-
this.
|
|
1652
|
+
this.checkoutConfig = checkoutConfig;
|
|
1524
1653
|
}
|
|
1525
1654
|
initAccordion() {
|
|
1526
1655
|
const paymentMethodCards = this.containerEl.querySelectorAll('.ff-payment-method-card');
|
|
@@ -1536,12 +1665,13 @@
|
|
|
1536
1665
|
}
|
|
1537
1666
|
});
|
|
1538
1667
|
};
|
|
1539
|
-
const checkedRadio = Array.from(radioButtons)
|
|
1668
|
+
const checkedRadio = Array.from(radioButtons).find(radio => this.availableMethods.includes(radio.value));
|
|
1540
1669
|
if (!checkedRadio) {
|
|
1541
1670
|
throw new Error('Default skin accordion initialization error: No radio button found');
|
|
1542
1671
|
}
|
|
1543
1672
|
setTimeout(() => {
|
|
1544
|
-
checkedRadio.
|
|
1673
|
+
checkedRadio.checked = true;
|
|
1674
|
+
handleAccordion(checkedRadio);
|
|
1545
1675
|
}, 0);
|
|
1546
1676
|
radioButtons.forEach(radio => {
|
|
1547
1677
|
radio.addEventListener('change', () => {
|
|
@@ -1568,9 +1698,8 @@
|
|
|
1568
1698
|
this.paymentMethodOrder.forEach(paymentMethod => {
|
|
1569
1699
|
paymentMethodContainers.insertAdjacentHTML('beforeend', paymentMethodTemplates[paymentMethod]);
|
|
1570
1700
|
});
|
|
1571
|
-
this.cardInstance = new CardSkin(document.querySelector('#cardForm'));
|
|
1701
|
+
this.cardInstance = new CardSkin(document.querySelector('#cardForm'), this.checkoutConfig);
|
|
1572
1702
|
this.cardInstance.init();
|
|
1573
|
-
this.initAccordion();
|
|
1574
1703
|
this.wireCardInputs();
|
|
1575
1704
|
}
|
|
1576
1705
|
renderCardForm() {
|
|
@@ -1618,8 +1747,8 @@
|
|
|
1618
1747
|
};
|
|
1619
1748
|
}
|
|
1620
1749
|
}
|
|
1621
|
-
const createDefaultSkin = async (
|
|
1622
|
-
const skin = new DefaultSkin(
|
|
1750
|
+
const createDefaultSkin = async (checkoutConfig) => {
|
|
1751
|
+
const skin = new DefaultSkin(checkoutConfig);
|
|
1623
1752
|
await skin['init']();
|
|
1624
1753
|
return skin;
|
|
1625
1754
|
};
|