@funnelfox/billing 0.4.5 → 0.5.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-index.cjs.js +29 -55
- package/dist/chunk-index.cjs2.js +84 -0
- package/dist/chunk-index.es.js +24 -50
- package/dist/chunk-index.es2.js +82 -0
- package/dist/funnelfox-billing.cjs.js +293 -112
- package/dist/funnelfox-billing.esm.js +293 -112
- package/dist/funnelfox-billing.js +397 -164
- package/dist/funnelfox-billing.min.js +1 -1
- package/package.json +2 -2
- package/src/types.d.ts +56 -25
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
/**
|
|
220
220
|
* @fileoverview Constants for Funnefox SDK
|
|
221
221
|
*/
|
|
222
|
-
const SDK_VERSION = '0.
|
|
222
|
+
const SDK_VERSION = '0.5.0-beta.1';
|
|
223
223
|
const DEFAULTS = {
|
|
224
224
|
BASE_URL: 'https://billing.funnelfox.com',
|
|
225
225
|
REGION: 'default',
|
|
@@ -246,9 +246,11 @@
|
|
|
246
246
|
INPUT_ERROR: 'input-error',
|
|
247
247
|
LOADER_CHANGE: 'loader-change',
|
|
248
248
|
METHOD_RENDER: 'method-render',
|
|
249
|
+
METHOD_RENDER_ERROR: 'method-render-error',
|
|
249
250
|
START_PURCHASE: 'start-purchase',
|
|
250
251
|
PURCHASE_FAILURE: 'purchase-failure',
|
|
251
252
|
PURCHASE_COMPLETED: 'purchase-completed',
|
|
253
|
+
PURCHASE_CANCELLED: 'purchase-cancelled',
|
|
252
254
|
};
|
|
253
255
|
const API_ENDPOINTS = {
|
|
254
256
|
CREATE_CLIENT_SESSION: '/v1/checkout/create_client_session',
|
|
@@ -324,10 +326,6 @@
|
|
|
324
326
|
const primerOptions = merge({
|
|
325
327
|
paymentHandling: 'MANUAL',
|
|
326
328
|
apiVersion: '2.4',
|
|
327
|
-
paypal: {
|
|
328
|
-
buttonColor: 'blue',
|
|
329
|
-
paymentFlow: 'PREFER_VAULT',
|
|
330
|
-
},
|
|
331
329
|
}, options);
|
|
332
330
|
try {
|
|
333
331
|
const headless = await window.Primer.createHeadless(clientToken, primerOptions);
|
|
@@ -355,9 +353,64 @@
|
|
|
355
353
|
this.paymentMethodsInterfaces[method].setDisabled(disabled);
|
|
356
354
|
}
|
|
357
355
|
}
|
|
358
|
-
async
|
|
356
|
+
async renderButton(allowedPaymentMethod, { container, }) {
|
|
357
|
+
const containerEl = this.validateContainer(container);
|
|
358
|
+
let button;
|
|
359
|
+
this.ensurePrimerAvailable();
|
|
360
|
+
if (!this.headless) {
|
|
361
|
+
throw new PrimerError('Headless checkout not found');
|
|
362
|
+
}
|
|
363
|
+
try {
|
|
364
|
+
const pmManager = await this.headless.createPaymentMethodManager(allowedPaymentMethod);
|
|
365
|
+
if (!pmManager) {
|
|
366
|
+
throw new Error('Payment method manager is not available');
|
|
367
|
+
}
|
|
368
|
+
button = pmManager.createButton();
|
|
369
|
+
await button.render(containerEl, {});
|
|
370
|
+
this.destroyCallbacks.push(() => button.clean());
|
|
371
|
+
}
|
|
372
|
+
catch (error) {
|
|
373
|
+
throw new PrimerError('Failed to initialize Primer checkout', error);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
async initMethod(method, htmlNode, options) {
|
|
377
|
+
if (method === exports.PaymentMethod.PAYMENT_CARD) {
|
|
378
|
+
if (!options.cardElements ||
|
|
379
|
+
!options.onSubmit ||
|
|
380
|
+
!options.onInputChange) {
|
|
381
|
+
throw new PrimerError('Card elements, onSubmit, and onInputChange are required for PAYMENT_CARD method');
|
|
382
|
+
}
|
|
383
|
+
return this.renderCardCheckoutWithElements(options.cardElements, {
|
|
384
|
+
onSubmit: options.onSubmit,
|
|
385
|
+
onInputChange: options.onInputChange,
|
|
386
|
+
onMethodRenderError: options.onMethodRenderError,
|
|
387
|
+
onMethodRender: options.onMethodRender,
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
// For button methods, render directly into htmlNode
|
|
392
|
+
this.ensurePrimerAvailable();
|
|
393
|
+
if (!this.headless) {
|
|
394
|
+
throw new PrimerError('Headless checkout not found');
|
|
395
|
+
}
|
|
396
|
+
try {
|
|
397
|
+
const pmManager = await this.headless.createPaymentMethodManager(method);
|
|
398
|
+
if (!pmManager) {
|
|
399
|
+
throw new Error('Payment method manager is not available');
|
|
400
|
+
}
|
|
401
|
+
const button = pmManager.createButton();
|
|
402
|
+
await button.render(htmlNode, {});
|
|
403
|
+
this.destroyCallbacks.push(() => button.clean());
|
|
404
|
+
options.onMethodRender(method);
|
|
405
|
+
}
|
|
406
|
+
catch (error) {
|
|
407
|
+
options.onMethodRenderError(method);
|
|
408
|
+
throw new PrimerError('Failed to initialize Primer checkout', error);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
async renderCardCheckoutWithElements(elements, { onSubmit, onInputChange, onMethodRenderError, onMethodRender, }) {
|
|
359
413
|
try {
|
|
360
|
-
const elements = this.initializeCardElements(cardSelectors);
|
|
361
414
|
const pmManager = await this.headless.createPaymentMethodManager('PAYMENT_CARD');
|
|
362
415
|
if (!pmManager) {
|
|
363
416
|
throw new Error('Payment method manager is not available');
|
|
@@ -404,7 +457,7 @@
|
|
|
404
457
|
onSubmit(false);
|
|
405
458
|
}
|
|
406
459
|
};
|
|
407
|
-
elements.button
|
|
460
|
+
elements.button?.addEventListener('click', onSubmitHandler);
|
|
408
461
|
await Promise.all([
|
|
409
462
|
cardNumberInput.render(elements.cardNumber, {
|
|
410
463
|
placeholder: '1234 1234 1234 1234',
|
|
@@ -422,10 +475,13 @@
|
|
|
422
475
|
style: inputStyle,
|
|
423
476
|
}),
|
|
424
477
|
]);
|
|
425
|
-
|
|
478
|
+
const onDestroy = () => {
|
|
426
479
|
pmManager.removeHostedInputs();
|
|
427
480
|
elements.cardholderName.removeEventListener('change', cardHolderOnChange);
|
|
428
|
-
|
|
481
|
+
elements.button.removeEventListener('click', onSubmitHandler);
|
|
482
|
+
};
|
|
483
|
+
this.destroyCallbacks.push(onDestroy);
|
|
484
|
+
onMethodRender(exports.PaymentMethod.PAYMENT_CARD);
|
|
429
485
|
return {
|
|
430
486
|
setDisabled: (disabled) => {
|
|
431
487
|
cardNumberInput.setDisabled(disabled);
|
|
@@ -433,38 +489,22 @@
|
|
|
433
489
|
cvvInput.setDisabled(disabled);
|
|
434
490
|
elements.button.disabled = disabled;
|
|
435
491
|
},
|
|
492
|
+
submit: () => onSubmitHandler(),
|
|
493
|
+
destroy: () => {
|
|
494
|
+
this.destroyCallbacks = this.destroyCallbacks.filter(callback => callback !== onDestroy);
|
|
495
|
+
onDestroy();
|
|
496
|
+
},
|
|
436
497
|
};
|
|
437
498
|
}
|
|
438
499
|
catch (error) {
|
|
439
500
|
throw new PrimerError('Failed to initialize Primer checkout', error);
|
|
440
501
|
}
|
|
441
502
|
}
|
|
442
|
-
async
|
|
443
|
-
const containerEl = this.validateContainer(container);
|
|
444
|
-
let button;
|
|
445
|
-
this.ensurePrimerAvailable();
|
|
446
|
-
if (!this.headless) {
|
|
447
|
-
throw new PrimerError('Headless checkout not found');
|
|
448
|
-
}
|
|
449
|
-
try {
|
|
450
|
-
const pmManager = await this.headless.createPaymentMethodManager(allowedPaymentMethod);
|
|
451
|
-
if (!pmManager) {
|
|
452
|
-
throw new Error('Payment method manager is not available');
|
|
453
|
-
}
|
|
454
|
-
button = pmManager.createButton();
|
|
455
|
-
await button.render(containerEl, {});
|
|
456
|
-
this.destroyCallbacks.push(() => button.clean());
|
|
457
|
-
}
|
|
458
|
-
catch (error) {
|
|
459
|
-
throw new PrimerError('Failed to initialize Primer checkout', error);
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
async renderCheckout(clientToken, options) {
|
|
463
|
-
const { cardSelectors, paymentButtonSelectors, container, onTokenizeSuccess, onResumeSuccess, onSubmit, onInputChange, onMethodRender, ...restPrimerOptions } = options;
|
|
503
|
+
async initializeHeadlessCheckout(clientToken, primerOptions) {
|
|
464
504
|
await this.createHeadlessCheckout(clientToken, {
|
|
465
|
-
...
|
|
466
|
-
onTokenizeSuccess: this.wrapTokenizeHandler(onTokenizeSuccess),
|
|
467
|
-
onResumeSuccess: this.wrapResumeHandler(onResumeSuccess),
|
|
505
|
+
...primerOptions,
|
|
506
|
+
onTokenizeSuccess: this.wrapTokenizeHandler(primerOptions.onTokenizeSuccess),
|
|
507
|
+
onResumeSuccess: this.wrapResumeHandler(primerOptions.onResumeSuccess),
|
|
468
508
|
onAvailablePaymentMethodsLoad: (items) => {
|
|
469
509
|
let isApplePayAvailable = false;
|
|
470
510
|
this.availableMethods = ALLOWED_PAYMENT_METHODS.filter(method => {
|
|
@@ -483,25 +523,33 @@
|
|
|
483
523
|
}
|
|
484
524
|
},
|
|
485
525
|
});
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
onInputChange,
|
|
491
|
-
};
|
|
526
|
+
}
|
|
527
|
+
async renderCheckout(clientToken, checkoutOptions, checkoutRenderOptions) {
|
|
528
|
+
const { cardElements, paymentButtonElements, container, onSubmit, onInputChange, onMethodRender, onMethodRenderError, } = checkoutRenderOptions;
|
|
529
|
+
await this.initializeHeadlessCheckout(clientToken, checkoutOptions);
|
|
492
530
|
for (const method of this.availableMethods) {
|
|
493
531
|
if (method === exports.PaymentMethod.PAYMENT_CARD) {
|
|
494
|
-
|
|
495
|
-
|
|
532
|
+
// For card, use the main container
|
|
533
|
+
await this.initMethod(method, container, {
|
|
534
|
+
cardElements,
|
|
535
|
+
onSubmit,
|
|
536
|
+
onInputChange,
|
|
537
|
+
onMethodRender,
|
|
538
|
+
onMethodRenderError,
|
|
539
|
+
});
|
|
496
540
|
}
|
|
497
541
|
else {
|
|
498
|
-
const
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
542
|
+
const buttonElementsMap = {
|
|
543
|
+
[exports.PaymentMethod.PAYPAL]: paymentButtonElements.paypal,
|
|
544
|
+
[exports.PaymentMethod.GOOGLE_PAY]: paymentButtonElements.googlePay,
|
|
545
|
+
[exports.PaymentMethod.APPLE_PAY]: paymentButtonElements.applePay,
|
|
546
|
+
};
|
|
547
|
+
// For buttons, use the specific button container element
|
|
548
|
+
const buttonElement = buttonElementsMap[method];
|
|
549
|
+
await this.initMethod(method, buttonElement, {
|
|
550
|
+
onMethodRender,
|
|
551
|
+
onMethodRenderError,
|
|
552
|
+
});
|
|
505
553
|
}
|
|
506
554
|
}
|
|
507
555
|
this.isInitialized = true;
|
|
@@ -762,6 +810,12 @@
|
|
|
762
810
|
}
|
|
763
811
|
throw new APIError('Invalid payment response format', null, { response });
|
|
764
812
|
}
|
|
813
|
+
async oneClick(payload) {
|
|
814
|
+
return (await this.request(`/billing/${this.orgId}/v1/checkout/one_click`, {
|
|
815
|
+
method: 'POST',
|
|
816
|
+
body: JSON.stringify(payload),
|
|
817
|
+
}));
|
|
818
|
+
}
|
|
765
819
|
}
|
|
766
820
|
|
|
767
821
|
var loaderHtml = "<div class=\"ff-sdk-loader-container\">\n <div class=\"ff-sdk-loader\"></div>\n</div>\n";
|
|
@@ -805,6 +859,9 @@
|
|
|
805
859
|
this.handleMethodRender = (method) => {
|
|
806
860
|
this.emit(EVENTS.METHOD_RENDER, method);
|
|
807
861
|
};
|
|
862
|
+
this.handleMethodRenderError = (method) => {
|
|
863
|
+
this.emit(EVENTS.METHOD_RENDER_ERROR, method);
|
|
864
|
+
};
|
|
808
865
|
this.handleSubmit = (isSubmitting) => {
|
|
809
866
|
this.onLoaderChangeWithRace(isSubmitting);
|
|
810
867
|
this._setState(isSubmitting ? 'processing' : 'ready');
|
|
@@ -877,9 +934,6 @@
|
|
|
877
934
|
this.primerWrapper = new PrimerWrapper();
|
|
878
935
|
this.isDestroyed = false;
|
|
879
936
|
this._setupCallbackBridges();
|
|
880
|
-
this.initialize().then(() => {
|
|
881
|
-
this.checkoutConfig?.onInitialized?.();
|
|
882
|
-
});
|
|
883
937
|
}
|
|
884
938
|
_setupCallbackBridges() {
|
|
885
939
|
if (this.callbacks.onSuccess) {
|
|
@@ -902,25 +956,10 @@
|
|
|
902
956
|
try {
|
|
903
957
|
this.showInitializingLoader();
|
|
904
958
|
this._setState('initializing');
|
|
905
|
-
this.
|
|
906
|
-
baseUrl: this.baseUrl || DEFAULTS.BASE_URL,
|
|
907
|
-
orgId: this.orgId,
|
|
908
|
-
timeout: DEFAULTS.REQUEST_TIMEOUT,
|
|
909
|
-
retryAttempts: DEFAULTS.RETRY_ATTEMPTS,
|
|
910
|
-
});
|
|
911
|
-
const sessionResponse = await this.apiClient.createClientSession({
|
|
912
|
-
priceId: this.checkoutConfig.priceId,
|
|
913
|
-
externalId: this.checkoutConfig.customer.externalId,
|
|
914
|
-
email: this.checkoutConfig.customer.email,
|
|
915
|
-
region: this.region || DEFAULTS.REGION,
|
|
916
|
-
clientMetadata: this.checkoutConfig.clientMetadata,
|
|
917
|
-
countryCode: this.checkoutConfig.customer.countryCode,
|
|
918
|
-
});
|
|
919
|
-
const sessionData = this.apiClient.processSessionResponse(sessionResponse);
|
|
920
|
-
this.orderId = sessionData.orderId;
|
|
921
|
-
this.clientToken = sessionData.clientToken;
|
|
959
|
+
await this.createSession();
|
|
922
960
|
await this._initializePrimerCheckout();
|
|
923
961
|
this._setState('ready');
|
|
962
|
+
this.checkoutConfig?.onInitialized?.();
|
|
924
963
|
return this;
|
|
925
964
|
}
|
|
926
965
|
catch (error) {
|
|
@@ -932,48 +971,97 @@
|
|
|
932
971
|
this.hideInitializingLoader();
|
|
933
972
|
}
|
|
934
973
|
}
|
|
935
|
-
async
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
974
|
+
async createSession() {
|
|
975
|
+
this.apiClient = new APIClient({
|
|
976
|
+
baseUrl: this.baseUrl || DEFAULTS.BASE_URL,
|
|
977
|
+
orgId: this.orgId,
|
|
978
|
+
timeout: DEFAULTS.REQUEST_TIMEOUT,
|
|
979
|
+
retryAttempts: DEFAULTS.RETRY_ATTEMPTS,
|
|
980
|
+
});
|
|
981
|
+
const sessionResponse = await this.apiClient.createClientSession({
|
|
982
|
+
priceId: this.checkoutConfig.priceId,
|
|
983
|
+
externalId: this.checkoutConfig.customer.externalId,
|
|
984
|
+
email: this.checkoutConfig.customer.email,
|
|
985
|
+
region: this.region || DEFAULTS.REGION,
|
|
986
|
+
clientMetadata: this.checkoutConfig.clientMetadata,
|
|
987
|
+
countryCode: this.checkoutConfig.customer.countryCode,
|
|
988
|
+
});
|
|
989
|
+
const sessionData = this.apiClient.processSessionResponse(sessionResponse);
|
|
990
|
+
this.orderId = sessionData.orderId;
|
|
991
|
+
this.clientToken = sessionData.clientToken;
|
|
992
|
+
}
|
|
993
|
+
convertCardSelectorsToElements(selectors, container) {
|
|
994
|
+
const cardNumber = container.querySelector(selectors.cardNumber);
|
|
995
|
+
const expiryDate = container.querySelector(selectors.expiryDate);
|
|
996
|
+
const cvv = container.querySelector(selectors.cvv);
|
|
997
|
+
const cardholderName = container.querySelector(selectors.cardholderName);
|
|
998
|
+
const button = container.querySelector(selectors.button);
|
|
999
|
+
if (!cardNumber || !expiryDate || !cvv || !button) {
|
|
1000
|
+
throw new CheckoutError('Required card input elements not found in container');
|
|
1001
|
+
}
|
|
1002
|
+
return {
|
|
1003
|
+
cardNumber,
|
|
1004
|
+
expiryDate,
|
|
1005
|
+
cvv,
|
|
1006
|
+
cardholderName,
|
|
1007
|
+
button,
|
|
963
1008
|
};
|
|
1009
|
+
}
|
|
1010
|
+
convertPaymentButtonSelectorsToElements(selectors) {
|
|
1011
|
+
const paypal = document.querySelector(selectors.paypal);
|
|
1012
|
+
const googlePay = document.querySelector(selectors.googlePay);
|
|
1013
|
+
const applePay = document.querySelector(selectors.applePay);
|
|
1014
|
+
if (!paypal || !googlePay || !applePay) {
|
|
1015
|
+
throw new CheckoutError('Required payment button elements not found in container');
|
|
1016
|
+
}
|
|
1017
|
+
return {
|
|
1018
|
+
paypal,
|
|
1019
|
+
googlePay,
|
|
1020
|
+
applePay,
|
|
1021
|
+
};
|
|
1022
|
+
}
|
|
1023
|
+
async _initializePrimerCheckout() {
|
|
1024
|
+
// Get container element
|
|
1025
|
+
const containerElement = this.getContainer();
|
|
1026
|
+
if (!containerElement) {
|
|
1027
|
+
throw new CheckoutError(`Checkout container not found: ${this.checkoutConfig.container}`);
|
|
1028
|
+
}
|
|
1029
|
+
// Get selectors (either from config or default skin)
|
|
1030
|
+
let cardElements;
|
|
1031
|
+
let paymentButtonElements;
|
|
1032
|
+
let checkoutOptions;
|
|
964
1033
|
if (!this.checkoutConfig.cardSelectors ||
|
|
965
1034
|
!this.checkoutConfig.paymentButtonSelectors) {
|
|
966
1035
|
if (this.checkoutConfig.paymentMethodOrder) {
|
|
967
1036
|
this.paymentMethodOrder = this.checkoutConfig.paymentMethodOrder;
|
|
968
1037
|
}
|
|
969
1038
|
const defaultSkinCheckoutOptions = await this.getDefaultSkinCheckoutOptions();
|
|
970
|
-
|
|
1039
|
+
if (!defaultSkinCheckoutOptions.cardElements ||
|
|
1040
|
+
!defaultSkinCheckoutOptions.paymentButtonElements) {
|
|
1041
|
+
throw new CheckoutError('Default skin must provide cardSelectors and paymentButtonSelectors');
|
|
1042
|
+
}
|
|
1043
|
+
cardElements =
|
|
1044
|
+
defaultSkinCheckoutOptions.cardElements;
|
|
1045
|
+
paymentButtonElements = defaultSkinCheckoutOptions.paymentButtonElements;
|
|
1046
|
+
checkoutOptions = this.getCheckoutOptions(defaultSkinCheckoutOptions);
|
|
1047
|
+
}
|
|
1048
|
+
else {
|
|
1049
|
+
cardElements = this.convertCardSelectorsToElements(this.checkoutConfig.cardSelectors, containerElement);
|
|
1050
|
+
paymentButtonElements = this.convertPaymentButtonSelectorsToElements(this.checkoutConfig.paymentButtonSelectors);
|
|
1051
|
+
checkoutOptions = this.getCheckoutOptions({});
|
|
971
1052
|
}
|
|
972
1053
|
if (this.checkoutConfig.paymentMethodOrder) {
|
|
973
1054
|
// eslint-disable-next-line no-console
|
|
974
1055
|
console.warn('paymentMethodOrder is using only for default skin and will be ignored if you are using custom checkout');
|
|
975
1056
|
}
|
|
976
|
-
await this.primerWrapper.renderCheckout(this.clientToken, checkoutOptions
|
|
1057
|
+
await this.primerWrapper.renderCheckout(this.clientToken, checkoutOptions, {
|
|
1058
|
+
container: containerElement,
|
|
1059
|
+
cardElements,
|
|
1060
|
+
paymentButtonElements,
|
|
1061
|
+
onSubmit: this.handleSubmit,
|
|
1062
|
+
onInputChange: this.handleInputChange,
|
|
1063
|
+
onMethodRender: this.handleMethodRender,
|
|
1064
|
+
});
|
|
977
1065
|
}
|
|
978
1066
|
async _processPaymentResult(result, primerHandler) {
|
|
979
1067
|
if (result.orderId) {
|
|
@@ -1003,6 +1091,48 @@
|
|
|
1003
1091
|
throw new CheckoutError(`Unknown payment result type: ${result.type}`);
|
|
1004
1092
|
}
|
|
1005
1093
|
}
|
|
1094
|
+
getCheckoutOptions(options) {
|
|
1095
|
+
let wasPaymentProcessedStarted = false;
|
|
1096
|
+
return {
|
|
1097
|
+
...this.checkoutConfig,
|
|
1098
|
+
...options,
|
|
1099
|
+
onTokenizeSuccess: this.handleTokenizeSuccess,
|
|
1100
|
+
onResumeSuccess: this.handleResumeSuccess,
|
|
1101
|
+
onResumeError: error => {
|
|
1102
|
+
if (error.stack?.includes('PROCESSOR_3DS') &&
|
|
1103
|
+
error.code === 'RESUME_ERROR' &&
|
|
1104
|
+
error.message?.includes('fetch resume key')) {
|
|
1105
|
+
// Ignore 3DS close error, because it is not understandable by user
|
|
1106
|
+
return;
|
|
1107
|
+
}
|
|
1108
|
+
this.emit(EVENTS.PURCHASE_FAILURE, error);
|
|
1109
|
+
},
|
|
1110
|
+
onCheckoutFail: error => {
|
|
1111
|
+
this.emit(EVENTS.PURCHASE_FAILURE, error);
|
|
1112
|
+
},
|
|
1113
|
+
onTokenizeError: error => {
|
|
1114
|
+
this.emit(EVENTS.PURCHASE_FAILURE, error);
|
|
1115
|
+
},
|
|
1116
|
+
onTokenizeShouldStart: data => {
|
|
1117
|
+
this.emit(EVENTS.ERROR, undefined);
|
|
1118
|
+
this.emit(EVENTS.START_PURCHASE, data.paymentMethodType);
|
|
1119
|
+
return true;
|
|
1120
|
+
},
|
|
1121
|
+
onPaymentMethodAction: action => {
|
|
1122
|
+
switch (action) {
|
|
1123
|
+
case 'PAYMENT_METHOD_SELECTED':
|
|
1124
|
+
this.emit(EVENTS.ERROR, undefined);
|
|
1125
|
+
break;
|
|
1126
|
+
case 'PAYMENT_METHOD_UNSELECTED':
|
|
1127
|
+
if (!wasPaymentProcessedStarted) {
|
|
1128
|
+
this.emit(EVENTS.PURCHASE_CANCELLED);
|
|
1129
|
+
}
|
|
1130
|
+
wasPaymentProcessedStarted = false;
|
|
1131
|
+
break;
|
|
1132
|
+
}
|
|
1133
|
+
},
|
|
1134
|
+
};
|
|
1135
|
+
}
|
|
1006
1136
|
async updatePrice(newPriceId) {
|
|
1007
1137
|
this._ensureNotDestroyed();
|
|
1008
1138
|
requireString(newPriceId, 'priceId');
|
|
@@ -1093,6 +1223,13 @@
|
|
|
1093
1223
|
this.on(EVENTS.PURCHASE_COMPLETED, skin.onPurchaseCompleted);
|
|
1094
1224
|
return skin.getCheckoutOptions();
|
|
1095
1225
|
}
|
|
1226
|
+
async getCardDefaultSkinCheckoutOptions(node) {
|
|
1227
|
+
const CardSkin = (await Promise.resolve().then(function () { return index$1; })).default;
|
|
1228
|
+
const skin = new CardSkin(node);
|
|
1229
|
+
skin.init();
|
|
1230
|
+
this.on(EVENTS.INPUT_ERROR, skin.onInputError);
|
|
1231
|
+
return skin.getCheckoutOptions();
|
|
1232
|
+
}
|
|
1096
1233
|
showInitializingLoader() {
|
|
1097
1234
|
renderLoader(this.checkoutConfig.container);
|
|
1098
1235
|
}
|
|
@@ -1127,19 +1264,14 @@
|
|
|
1127
1264
|
const primerWrapper = new PrimerWrapper();
|
|
1128
1265
|
primerWrapper.ensurePrimerAvailable();
|
|
1129
1266
|
const config = resolveConfig(options, 'createCheckout');
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
checkoutConfig
|
|
1134
|
-
}
|
|
1135
|
-
const checkout = new CheckoutInstance({
|
|
1136
|
-
...config,
|
|
1137
|
-
checkoutConfig: {
|
|
1138
|
-
...checkoutConfig,
|
|
1139
|
-
onInitialized,
|
|
1140
|
-
},
|
|
1141
|
-
});
|
|
1267
|
+
const checkout = new CheckoutInstance({
|
|
1268
|
+
...config,
|
|
1269
|
+
checkoutConfig: {
|
|
1270
|
+
...checkoutConfig,
|
|
1271
|
+
},
|
|
1142
1272
|
});
|
|
1273
|
+
await checkout.initialize();
|
|
1274
|
+
return checkout;
|
|
1143
1275
|
}
|
|
1144
1276
|
async function createClientSession(params) {
|
|
1145
1277
|
const { priceId, externalId, email, clientMetadata, countryCode } = params;
|
|
@@ -1160,6 +1292,54 @@
|
|
|
1160
1292
|
});
|
|
1161
1293
|
return apiClient.processSessionResponse(sessionResponse);
|
|
1162
1294
|
}
|
|
1295
|
+
async function initMethod(method, element, options) {
|
|
1296
|
+
const checkoutInstance = new CheckoutInstance({
|
|
1297
|
+
orgId: options.orgId,
|
|
1298
|
+
baseUrl: options.baseUrl,
|
|
1299
|
+
checkoutConfig: {
|
|
1300
|
+
priceId: options.priceId,
|
|
1301
|
+
customer: {
|
|
1302
|
+
externalId: options.externalId,
|
|
1303
|
+
email: options.email,
|
|
1304
|
+
},
|
|
1305
|
+
container: '',
|
|
1306
|
+
clientMetadata: options.meta,
|
|
1307
|
+
},
|
|
1308
|
+
});
|
|
1309
|
+
checkoutInstance._ensureNotDestroyed();
|
|
1310
|
+
if (!checkoutInstance.isReady()) {
|
|
1311
|
+
await checkoutInstance['createSession']();
|
|
1312
|
+
}
|
|
1313
|
+
checkoutInstance.on(EVENTS.METHOD_RENDER, options.onRenderSuccess);
|
|
1314
|
+
checkoutInstance.on(EVENTS.METHOD_RENDER_ERROR, options.onRenderError);
|
|
1315
|
+
checkoutInstance.on(EVENTS.LOADER_CHANGE, options.onLoaderChange);
|
|
1316
|
+
checkoutInstance.on(EVENTS.SUCCESS, options.onPaymentSuccess);
|
|
1317
|
+
checkoutInstance.on(EVENTS.PURCHASE_FAILURE, options.onPaymentFail);
|
|
1318
|
+
checkoutInstance.on(EVENTS.PURCHASE_CANCELLED, options.onPaymentCancel);
|
|
1319
|
+
checkoutInstance.on(EVENTS.ERROR, options.onErrorMessageChange);
|
|
1320
|
+
if (method === exports.PaymentMethod.PAYMENT_CARD) {
|
|
1321
|
+
const cardDefaultOptions = await checkoutInstance['getCardDefaultSkinCheckoutOptions'](element);
|
|
1322
|
+
const checkoutOptions = checkoutInstance['getCheckoutOptions']({
|
|
1323
|
+
style: options.styles,
|
|
1324
|
+
...cardDefaultOptions,
|
|
1325
|
+
});
|
|
1326
|
+
await checkoutInstance.primerWrapper.initializeHeadlessCheckout(checkoutInstance.clientToken, checkoutOptions);
|
|
1327
|
+
return checkoutInstance.primerWrapper.initMethod(method, element, {
|
|
1328
|
+
cardElements: cardDefaultOptions.cardElements,
|
|
1329
|
+
onSubmit: checkoutInstance['handleSubmit'],
|
|
1330
|
+
onInputChange: checkoutInstance['handleInputChange'],
|
|
1331
|
+
onMethodRender: checkoutInstance['handleMethodRender'],
|
|
1332
|
+
onMethodRenderError: checkoutInstance['handleMethodRenderError'],
|
|
1333
|
+
});
|
|
1334
|
+
}
|
|
1335
|
+
await checkoutInstance.primerWrapper.initializeHeadlessCheckout(checkoutInstance.clientToken, checkoutInstance['getCheckoutOptions']({
|
|
1336
|
+
style: options.styles,
|
|
1337
|
+
}));
|
|
1338
|
+
return checkoutInstance.primerWrapper.initMethod(method, element, {
|
|
1339
|
+
onMethodRender: checkoutInstance['handleMethodRender'],
|
|
1340
|
+
onMethodRenderError: checkoutInstance['handleMethodRenderError'],
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1163
1343
|
|
|
1164
1344
|
/**
|
|
1165
1345
|
* @fileoverview Main entry point for @funnelfox/billing
|
|
@@ -1168,14 +1348,15 @@
|
|
|
1168
1348
|
configure: configure,
|
|
1169
1349
|
createCheckout: createCheckout,
|
|
1170
1350
|
createClientSession: createClientSession,
|
|
1351
|
+
initMethod: initMethod,
|
|
1171
1352
|
};
|
|
1172
1353
|
if (typeof window !== 'undefined') {
|
|
1173
1354
|
window.Billing = Billing;
|
|
1174
1355
|
}
|
|
1175
1356
|
|
|
1176
|
-
var template = "<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";
|
|
1357
|
+
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";
|
|
1177
1358
|
|
|
1178
|
-
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=\"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>\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 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";
|
|
1359
|
+
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=\"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";
|
|
1179
1360
|
|
|
1180
1361
|
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";
|
|
1181
1362
|
|
|
@@ -1183,7 +1364,86 @@
|
|
|
1183
1364
|
|
|
1184
1365
|
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";
|
|
1185
1366
|
|
|
1186
|
-
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.
|
|
1367
|
+
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";
|
|
1368
|
+
|
|
1369
|
+
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";
|
|
1370
|
+
|
|
1371
|
+
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 }";
|
|
1372
|
+
|
|
1373
|
+
class CardSkin {
|
|
1374
|
+
constructor(containerEl) {
|
|
1375
|
+
this.onInputError = (event) => {
|
|
1376
|
+
const { name, error } = event;
|
|
1377
|
+
const cardInputElements = this.getCardInputElements();
|
|
1378
|
+
const elementsMap = {
|
|
1379
|
+
cardNumber: cardInputElements.cardNumber.parentElement,
|
|
1380
|
+
expiryDate: cardInputElements.expiryDate.parentElement,
|
|
1381
|
+
cvv: cardInputElements.cvv.parentElement,
|
|
1382
|
+
};
|
|
1383
|
+
const errorContainer = elementsMap[name]?.querySelector('.errorContainer');
|
|
1384
|
+
if (errorContainer) {
|
|
1385
|
+
errorContainer.textContent = error || '';
|
|
1386
|
+
}
|
|
1387
|
+
};
|
|
1388
|
+
if (!containerEl) {
|
|
1389
|
+
throw new Error('Container element not found');
|
|
1390
|
+
}
|
|
1391
|
+
this.containerEl = containerEl;
|
|
1392
|
+
// Initialize with placeholders; real nodes will be wired in `init`.
|
|
1393
|
+
this.cardInputElements = {
|
|
1394
|
+
cardNumber: document.createElement('div'),
|
|
1395
|
+
expiryDate: document.createElement('div'),
|
|
1396
|
+
cvv: document.createElement('div'),
|
|
1397
|
+
};
|
|
1398
|
+
}
|
|
1399
|
+
wireCardInputs() {
|
|
1400
|
+
const cardNumber = this.containerEl.querySelector('#cardNumberInput');
|
|
1401
|
+
const expiryDate = this.containerEl.querySelector('#expiryInput');
|
|
1402
|
+
const cvv = this.containerEl.querySelector('#cvvInput');
|
|
1403
|
+
if (!cardNumber || !expiryDate || !cvv) {
|
|
1404
|
+
throw new Error('One or more card input elements are missing in the default skin');
|
|
1405
|
+
}
|
|
1406
|
+
this.cardInputElements = {
|
|
1407
|
+
cardNumber,
|
|
1408
|
+
expiryDate,
|
|
1409
|
+
cvv,
|
|
1410
|
+
};
|
|
1411
|
+
}
|
|
1412
|
+
async init() {
|
|
1413
|
+
this.containerEl.insertAdjacentHTML('afterbegin', template);
|
|
1414
|
+
this.wireCardInputs();
|
|
1415
|
+
}
|
|
1416
|
+
renderCardForm() {
|
|
1417
|
+
// Card form is part of the base template; no-op for default skin.
|
|
1418
|
+
}
|
|
1419
|
+
getCardInputSelectors() {
|
|
1420
|
+
return {
|
|
1421
|
+
cardNumber: '#cardNumberInput',
|
|
1422
|
+
expiryDate: '#expiryInput',
|
|
1423
|
+
cvv: '#cvvInput',
|
|
1424
|
+
cardholderName: '#cardHolderInput',
|
|
1425
|
+
button: '#submitButton',
|
|
1426
|
+
};
|
|
1427
|
+
}
|
|
1428
|
+
getCardInputElements() {
|
|
1429
|
+
return this.cardInputElements;
|
|
1430
|
+
}
|
|
1431
|
+
getCheckoutOptions() {
|
|
1432
|
+
return {
|
|
1433
|
+
cardElements: this.getCardInputElements(),
|
|
1434
|
+
card: {
|
|
1435
|
+
cardholderName: {
|
|
1436
|
+
required: false,
|
|
1437
|
+
},
|
|
1438
|
+
},
|
|
1439
|
+
};
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
var index$1 = /*#__PURE__*/Object.freeze({
|
|
1444
|
+
__proto__: null,
|
|
1445
|
+
default: CardSkin
|
|
1446
|
+
});
|
|
1187
1447
|
|
|
1188
1448
|
const paymentMethodTemplates = {
|
|
1189
1449
|
[exports.PaymentMethod.PAYMENT_CARD]: cardTemplate,
|
|
@@ -1243,17 +1503,7 @@
|
|
|
1243
1503
|
this.containerEl.remove();
|
|
1244
1504
|
};
|
|
1245
1505
|
this.onInputError = (event) => {
|
|
1246
|
-
|
|
1247
|
-
const cardInputElements = this.getCardInputElements();
|
|
1248
|
-
const elementsMap = {
|
|
1249
|
-
cardNumber: cardInputElements.cardNumber.parentElement,
|
|
1250
|
-
expiryDate: cardInputElements.expiryDate.parentElement,
|
|
1251
|
-
cvv: cardInputElements.cvv.parentElement,
|
|
1252
|
-
};
|
|
1253
|
-
const errorContainer = elementsMap[name]?.querySelector('.errorContainer');
|
|
1254
|
-
if (errorContainer) {
|
|
1255
|
-
errorContainer.textContent = error || '';
|
|
1256
|
-
}
|
|
1506
|
+
this.cardInstance.onInputError(event);
|
|
1257
1507
|
};
|
|
1258
1508
|
this.onMethodRender = (paymentMethod) => {
|
|
1259
1509
|
const methodKey = paymentMethod.replace('_', '-').toLowerCase();
|
|
@@ -1281,13 +1531,6 @@
|
|
|
1281
1531
|
throw new Error(`Container element not found for selector: ${containerSelector}`);
|
|
1282
1532
|
}
|
|
1283
1533
|
this.containerEl = containerEl;
|
|
1284
|
-
// Initialize with placeholders; real nodes will be wired in `init`.
|
|
1285
|
-
this.cardInputElements = {
|
|
1286
|
-
cardNumber: document.createElement('div'),
|
|
1287
|
-
expiryDate: document.createElement('div'),
|
|
1288
|
-
cvv: document.createElement('div'),
|
|
1289
|
-
button: document.createElement('button'),
|
|
1290
|
-
};
|
|
1291
1534
|
this.primerWrapper = primerWrapper;
|
|
1292
1535
|
}
|
|
1293
1536
|
initAccordion() {
|
|
@@ -1320,64 +1563,54 @@
|
|
|
1320
1563
|
});
|
|
1321
1564
|
}
|
|
1322
1565
|
wireCardInputs() {
|
|
1323
|
-
|
|
1324
|
-
const expiryDate = this.containerEl.querySelector('#expiryInput');
|
|
1325
|
-
const cvv = this.containerEl.querySelector('#cvvInput');
|
|
1566
|
+
this.cardInstance.wireCardInputs();
|
|
1326
1567
|
const button = this.containerEl.querySelector('#submitButton');
|
|
1327
|
-
if (!
|
|
1568
|
+
if (!button) {
|
|
1328
1569
|
throw new Error('One or more card input elements are missing in the default skin');
|
|
1329
1570
|
}
|
|
1330
1571
|
this.cardInputElements = {
|
|
1331
|
-
|
|
1332
|
-
expiryDate,
|
|
1333
|
-
cvv,
|
|
1572
|
+
...this.cardInstance.getCardInputElements(),
|
|
1334
1573
|
button,
|
|
1335
1574
|
};
|
|
1336
1575
|
}
|
|
1337
1576
|
async init() {
|
|
1338
|
-
this.containerEl.insertAdjacentHTML('beforeend', template);
|
|
1577
|
+
this.containerEl.insertAdjacentHTML('beforeend', template$1);
|
|
1339
1578
|
const paymentMethodContainers = this.containerEl.querySelector('#ff-payment-method-containers');
|
|
1340
1579
|
this.paymentMethodOrder.forEach(paymentMethod => {
|
|
1341
1580
|
paymentMethodContainers.insertAdjacentHTML('beforeend', paymentMethodTemplates[paymentMethod]);
|
|
1342
1581
|
});
|
|
1582
|
+
this.cardInstance = new CardSkin(document.querySelector('#cardForm'));
|
|
1583
|
+
this.cardInstance.init();
|
|
1343
1584
|
this.initAccordion();
|
|
1344
1585
|
this.wireCardInputs();
|
|
1345
1586
|
}
|
|
1346
1587
|
renderCardForm() {
|
|
1347
1588
|
// Card form is part of the base template; no-op for default skin.
|
|
1348
1589
|
}
|
|
1349
|
-
renderButton(paymentMethod) {
|
|
1350
|
-
const methodKey = paymentMethod.replace('_', '-').toLowerCase();
|
|
1351
|
-
const methodContainer = this.containerEl.querySelector(`.ff-payment-method-${methodKey}`);
|
|
1352
|
-
if (methodContainer) {
|
|
1353
|
-
methodContainer.classList.add('visible');
|
|
1354
|
-
}
|
|
1355
|
-
}
|
|
1356
1590
|
getCardInputSelectors() {
|
|
1357
1591
|
return {
|
|
1358
|
-
|
|
1359
|
-
expiryDate: '#expiryInput',
|
|
1360
|
-
cvv: '#cvvInput',
|
|
1361
|
-
cardholderName: '#cardHolderInput',
|
|
1592
|
+
...this.cardInstance.getCardInputSelectors(),
|
|
1362
1593
|
button: '#submitButton',
|
|
1363
1594
|
};
|
|
1364
1595
|
}
|
|
1365
1596
|
getCardInputElements() {
|
|
1366
|
-
return
|
|
1597
|
+
return {
|
|
1598
|
+
...this.cardInstance.getCardInputElements(),
|
|
1599
|
+
button: this.cardInputElements.button,
|
|
1600
|
+
};
|
|
1601
|
+
}
|
|
1602
|
+
getPaymentButtonElements() {
|
|
1603
|
+
return {
|
|
1604
|
+
paypal: this.containerEl.querySelector('#paypalButton'),
|
|
1605
|
+
googlePay: this.containerEl.querySelector('#googlePayButton'),
|
|
1606
|
+
applePay: this.containerEl.querySelector('#applePayButton'),
|
|
1607
|
+
};
|
|
1367
1608
|
}
|
|
1368
1609
|
getCheckoutOptions() {
|
|
1369
1610
|
return {
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
googlePay: '#googlePayButton',
|
|
1374
|
-
applePay: '#applePayButton',
|
|
1375
|
-
},
|
|
1376
|
-
card: {
|
|
1377
|
-
cardholderName: {
|
|
1378
|
-
required: false,
|
|
1379
|
-
},
|
|
1380
|
-
},
|
|
1611
|
+
...this.cardInstance.getCheckoutOptions(),
|
|
1612
|
+
cardElements: this.getCardInputElements(),
|
|
1613
|
+
paymentButtonElements: this.getPaymentButtonElements(),
|
|
1381
1614
|
applePay: {
|
|
1382
1615
|
buttonStyle: 'black',
|
|
1383
1616
|
},
|