@adyen/adyen-web 5.5.0 → 5.7.0
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/README.md +1 -1
- package/dist/adyen.css +3 -2
- package/dist/adyen.css.map +1 -1
- package/dist/adyen.js +1 -1
- package/dist/adyen.js.map +1 -1
- package/dist/cjs/adyen.css +3 -2
- package/dist/cjs/adyen.css.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/es/adyen.css +3 -2
- package/dist/es/adyen.css.map +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es.modern/adyen.css +3 -2
- package/dist/es.modern/adyen.css.map +1 -1
- package/dist/es.modern/index.js +1 -1
- package/dist/types/components/Ach/components/AchInput/AchInput.d.ts +2 -4
- package/dist/types/components/Ach/components/AchInput/defaultProps.d.ts +0 -3
- package/dist/types/components/Ach/components/AchInput/types.d.ts +40 -0
- package/dist/types/components/Card/Bancontact.d.ts +10 -5
- package/dist/types/components/Card/Card.d.ts +10 -4
- package/dist/types/components/Card/components/CardInput/CardInput.d.ts +2 -39
- package/dist/types/components/Card/components/CardInput/components/CardFieldsWrapper.d.ts +47 -0
- package/dist/types/components/Card/components/CardInput/components/Installments/Installments.d.ts +4 -0
- package/dist/types/components/Card/components/CardInput/components/StoredCardFields.d.ts +1 -1
- package/dist/types/components/Card/components/CardInput/components/StoredCardFieldsWrapper.d.ts +16 -0
- package/dist/types/components/Card/components/CardInput/components/types.d.ts +1 -1
- package/dist/types/components/Card/components/CardInput/defaultProps.d.ts +2 -4
- package/dist/types/components/Card/components/CardInput/handlers.d.ts +8 -0
- package/dist/types/components/Card/components/CardInput/layouts.d.ts +9 -0
- package/dist/types/components/Card/components/CardInput/types.d.ts +86 -14
- package/dist/types/components/Card/components/CardInput/utils.d.ts +50 -0
- package/dist/types/components/Card/types.d.ts +2 -4
- package/dist/types/components/Dropin/Dropin.d.ts +5 -1
- package/dist/types/components/Dropin/components/DropinComponent.d.ts +3 -2
- package/dist/types/components/Dropin/types.d.ts +7 -3
- package/dist/types/components/SecuredFields/SecuredFieldsInput/SecuredFieldsInput.d.ts +31 -1
- package/dist/types/components/ThreeDS2/callSubmit3DS2Fingerprint.d.ts +2 -1
- package/dist/types/components/ThreeDS2/types.d.ts +18 -0
- package/dist/types/components/UIElement.d.ts +10 -11
- package/dist/types/components/internal/Address/Specifications.d.ts +7 -1
- package/dist/types/components/internal/Address/types.d.ts +5 -6
- package/dist/types/components/internal/FormFields/Field/Field.d.ts +2 -1
- package/dist/types/components/internal/FormFields/Field/types.d.ts +1 -0
- package/dist/types/components/internal/FormFields/Select/Select.d.ts +1 -1
- package/dist/types/components/internal/FormFields/Select/types.d.ts +1 -0
- package/dist/types/components/internal/SecuredFields/SFP/SFPUtils.d.ts +19 -0
- package/dist/types/components/internal/SecuredFields/{SecuredFieldsProvider.d.ts → SFP/SecuredFieldsProvider.d.ts} +4 -26
- package/dist/types/components/internal/SecuredFields/{SecuredFieldsProviderHandlers.d.ts → SFP/SecuredFieldsProviderHandlers.d.ts} +1 -1
- package/dist/types/components/internal/SecuredFields/SFP/defaultProps.d.ts +64 -0
- package/dist/types/components/internal/SecuredFields/SFP/types.d.ts +32 -0
- package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/AbstractCSF.d.ts +8 -7
- package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/CSF.d.ts +1 -5
- package/dist/types/components/internal/SecuredFields/lib/{core/utils/registerAdditionalField.d.ts → CSF/extensions/additionalFields.d.ts} +0 -0
- package/dist/types/components/internal/SecuredFields/lib/{configuration → CSF/extensions}/configureCallbacks.d.ts +0 -0
- package/dist/types/components/internal/SecuredFields/lib/{core → CSF/extensions}/createSecuredFields.d.ts +0 -0
- package/dist/types/components/internal/SecuredFields/lib/{core/utils → CSF/extensions}/handleBrandFromBinLookup.d.ts +1 -1
- package/dist/types/components/internal/SecuredFields/lib/{configuration → CSF/extensions}/handleConfig.d.ts +0 -0
- package/dist/types/components/internal/SecuredFields/lib/{core → CSF/extensions}/handleEncryption.d.ts +1 -1
- package/dist/types/components/internal/SecuredFields/lib/{core/utils/tabbing → CSF/extensions}/handleTab.d.ts +0 -0
- package/dist/types/components/internal/SecuredFields/lib/{core → CSF/extensions}/handleValidation.d.ts +1 -1
- package/dist/types/components/internal/SecuredFields/lib/CSF/index.d.ts +2 -0
- package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/initCSF.d.ts +1 -1
- package/dist/types/components/internal/SecuredFields/lib/CSF/partials/handleBinValue.d.ts +11 -0
- package/dist/types/components/internal/SecuredFields/lib/CSF/partials/handleFocus.d.ts +15 -0
- package/dist/types/components/internal/SecuredFields/lib/CSF/partials/handleIframeConfigFeedback.d.ts +11 -0
- package/dist/types/components/internal/SecuredFields/lib/CSF/partials/isConfigured.d.ts +13 -0
- package/dist/types/components/internal/SecuredFields/lib/CSF/partials/postMessageToAllIframes.d.ts +13 -0
- package/dist/types/components/internal/SecuredFields/lib/CSF/partials/processAutoComplete.d.ts +14 -0
- package/dist/types/components/internal/SecuredFields/lib/CSF/partials/processBrand.d.ts +20 -0
- package/dist/types/components/internal/SecuredFields/lib/CSF/partials/setFocusOnFrame.d.ts +11 -0
- package/dist/types/components/internal/SecuredFields/lib/CSF/partials/validateForm.d.ts +10 -0
- package/dist/types/components/internal/SecuredFields/lib/CSF/types.d.ts +83 -0
- package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/callbackUtils.d.ts +0 -0
- package/dist/types/components/internal/SecuredFields/lib/{utilities → CSF/utils}/cardType.d.ts +1 -1
- package/dist/types/components/internal/SecuredFields/lib/{core → CSF/utils}/destroySecuredFields.d.ts +0 -0
- package/dist/types/components/internal/SecuredFields/lib/{ui → CSF/utils}/encryptedElements.d.ts +0 -0
- package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/getCardGroupTypes.d.ts +0 -0
- package/dist/types/components/internal/SecuredFields/lib/CSF/utils/iframes/getIframeContentWin.d.ts +5 -0
- package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/iframes/postMessageToIframe.d.ts +0 -0
- package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/iframes/postMessageValidation.d.ts +0 -0
- package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/processErrors.d.ts +1 -1
- package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/tabbing/tabScenarioACH.d.ts +0 -0
- package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/tabbing/tabScenarioCreditCard.d.ts +0 -0
- package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/tabbing/tabScenarioGiftCard.d.ts +0 -0
- package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/tabbing/tabScenarioKCP.d.ts +0 -0
- package/dist/types/components/internal/SecuredFields/lib/{ui/domUtils.d.ts → CSF/utils/tabbing/utils.d.ts} +0 -1
- package/dist/types/components/internal/SecuredFields/lib/{utilities → CSF/utils}/userAgent.d.ts +0 -0
- package/dist/types/components/internal/SecuredFields/lib/configuration/constants.d.ts +4 -3
- package/dist/types/components/internal/SecuredFields/lib/{core → securedField}/AbstractSecuredField.d.ts +2 -6
- package/dist/types/components/internal/SecuredFields/lib/{core → securedField}/SecuredField.d.ts +2 -1
- package/dist/types/components/internal/SecuredFields/lib/{utilities → securedField/utils}/createIframe.d.ts +0 -0
- package/dist/types/components/internal/SecuredFields/lib/{core/utils/init → securedField/utils}/processAriaConfig.d.ts +2 -2
- package/dist/types/components/internal/SecuredFields/lib/{core/utils/init → securedField/utils}/processPlaceholders.d.ts +1 -1
- package/dist/types/components/internal/SecuredFields/lib/types.d.ts +5 -81
- package/dist/types/components/internal/SecuredFields/lib/utilities/commonUtils.d.ts +6 -1
- package/dist/types/components/internal/SecuredFields/utils.d.ts +1 -20
- package/dist/types/components/internal/SocialSecurityNumberBrazil/SocialSecurityNumberBrazil.d.ts +2 -1
- package/dist/types/components/types.d.ts +20 -0
- package/dist/types/core/Context/CoreContext.d.ts +2 -0
- package/dist/types/core/Context/CoreProvider.d.ts +4 -0
- package/dist/types/core/Context/useCoreContext.d.ts +1 -0
- package/dist/types/core/Errors/ErrorPanel.d.ts +14 -0
- package/dist/types/core/ProcessResponse/PaymentMethodsResponse/PaymentMethodsResponse.d.ts +1 -0
- package/dist/types/core/Services/http.d.ts +5 -4
- package/dist/types/core/core.d.ts +9 -2
- package/dist/types/utils/Validator/Validator.d.ts +1 -1
- package/dist/types/utils/hasOwnProperty.d.ts +1 -1
- package/package.json +3 -3
- package/dist/types/components/internal/SecuredFields/defaultProps.d.ts +0 -104
- package/dist/types/components/internal/SecuredFields/lib/core/utils/handleBinValue.d.ts +0 -2
- package/dist/types/components/internal/SecuredFields/lib/core/utils/iframes/handleFocus.d.ts +0 -2
- package/dist/types/components/internal/SecuredFields/lib/core/utils/iframes/handleIframeConfigFeedback.d.ts +0 -1
- package/dist/types/components/internal/SecuredFields/lib/core/utils/iframes/postMessageToAllIframes.d.ts +0 -1
- package/dist/types/components/internal/SecuredFields/lib/core/utils/iframes/setFocusOnFrame.d.ts +0 -1
- package/dist/types/components/internal/SecuredFields/lib/core/utils/isConfigured.d.ts +0 -1
- package/dist/types/components/internal/SecuredFields/lib/core/utils/processAutoComplete.d.ts +0 -2
- package/dist/types/components/internal/SecuredFields/lib/core/utils/processBrand.d.ts +0 -8
- package/dist/types/components/internal/SecuredFields/lib/core/utils/validateForm.d.ts +0 -1
- package/dist/types/components/internal/SecuredFields/lib/index.d.ts +0 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ThreeDS2DeviceFingerprint, onComplete, calls a new, internal, endpoint which
|
|
2
|
+
* ThreeDS2DeviceFingerprint, onComplete, calls a new, internal, endpoint which
|
|
3
|
+
* behaves like the /details endpoint but doesn't require the same credentials
|
|
3
4
|
*/
|
|
4
5
|
export default function callSubmit3DS2Fingerprint({ data }: {
|
|
5
6
|
data: any;
|
|
@@ -41,3 +41,21 @@ export interface FingerPrintData {
|
|
|
41
41
|
threeDSMethodNotificationURL: string;
|
|
42
42
|
postMessageDomain: string;
|
|
43
43
|
}
|
|
44
|
+
export declare type ThreeDS2FingerprintResponse = {
|
|
45
|
+
type: 'action' | 'completed';
|
|
46
|
+
action?: CheckoutRedirectAction | CheckoutThreeDS2Action;
|
|
47
|
+
details?: Record<string, string>;
|
|
48
|
+
};
|
|
49
|
+
declare type CheckoutRedirectAction = {
|
|
50
|
+
type: 'redirect';
|
|
51
|
+
data: Record<string, string>;
|
|
52
|
+
method: string;
|
|
53
|
+
paymentData: string;
|
|
54
|
+
};
|
|
55
|
+
declare type CheckoutThreeDS2Action = {
|
|
56
|
+
type: 'threeDS2';
|
|
57
|
+
token: string;
|
|
58
|
+
subtype: string;
|
|
59
|
+
authorisationToken: string;
|
|
60
|
+
};
|
|
61
|
+
export {};
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
2
|
import BaseElement from './BaseElement';
|
|
3
3
|
import { Order, PaymentAction } from '../types';
|
|
4
|
-
import { UIElementProps } from './types';
|
|
4
|
+
import { IUIElement, UIElementProps } from './types';
|
|
5
5
|
import AdyenCheckoutError from '../core/Errors/AdyenCheckoutError';
|
|
6
|
-
|
|
6
|
+
import type { UIElementStatus } from './types';
|
|
7
|
+
export declare class UIElement<P extends UIElementProps = any> extends BaseElement<P> implements IUIElement {
|
|
7
8
|
protected componentRef: any;
|
|
8
9
|
elementRef: any;
|
|
9
10
|
constructor(props: P);
|
|
10
11
|
setState(newState: object): void;
|
|
11
|
-
onChange(): object;
|
|
12
|
-
onSubmit
|
|
13
|
-
onValid
|
|
14
|
-
data: any;
|
|
15
|
-
};
|
|
12
|
+
protected onChange(): object;
|
|
13
|
+
private onSubmit;
|
|
14
|
+
private onValid;
|
|
16
15
|
onComplete(state: any): void;
|
|
17
16
|
/**
|
|
18
17
|
* Submit payment method data. If the form is not valid, it will trigger validation.
|
|
19
18
|
*/
|
|
20
19
|
submit(): void;
|
|
21
20
|
showValidation(): this;
|
|
22
|
-
setStatus(status:
|
|
23
|
-
submitPayment
|
|
24
|
-
submitAdditionalDetails
|
|
21
|
+
setStatus(status: UIElementStatus, props?: any): this;
|
|
22
|
+
private submitPayment;
|
|
23
|
+
private submitAdditionalDetails;
|
|
25
24
|
protected handleError: (error: AdyenCheckoutError) => void;
|
|
26
25
|
protected handleAdditionalDetails: (state: any) => any;
|
|
27
26
|
handleAction(action: PaymentAction, props?: {}): UIElement;
|
|
@@ -56,6 +55,6 @@ export declare class UIElement<P extends UIElementProps = any> extends BaseEleme
|
|
|
56
55
|
/**
|
|
57
56
|
* Get the payButton component for the current element
|
|
58
57
|
*/
|
|
59
|
-
payButton: (props: any) => h.JSX.Element;
|
|
58
|
+
protected payButton: (props: any) => h.JSX.Element;
|
|
60
59
|
}
|
|
61
60
|
export default UIElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AddressSchema } from './types';
|
|
1
|
+
import { AddressSchema, StringObject } from './types';
|
|
2
2
|
declare class Specifications {
|
|
3
3
|
private specifications;
|
|
4
4
|
constructor(specifications?: any);
|
|
@@ -21,6 +21,12 @@ declare class Specifications {
|
|
|
21
21
|
* @returns AddressSchema
|
|
22
22
|
*/
|
|
23
23
|
getAddressSchemaForCountry(country: string): AddressSchema;
|
|
24
|
+
/**
|
|
25
|
+
* Returns the address labels of the selected country or the default address labels.
|
|
26
|
+
* @param country - The selected country
|
|
27
|
+
* @returns StringObject
|
|
28
|
+
*/
|
|
29
|
+
getAddressLabelsForCountry(country: string): StringObject;
|
|
24
30
|
/**
|
|
25
31
|
* Returns the optional fields of the selected country or the default optional fields.
|
|
26
32
|
* @param country - The selected country
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { AddressField, AddressData } from '../../../types';
|
|
2
2
|
import Specifications from './Specifications';
|
|
3
3
|
import { ValidatorRules } from '../../../utils/Validator/Validator';
|
|
4
|
+
export declare type StringObject = {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
};
|
|
4
7
|
export interface AddressProps {
|
|
5
8
|
allowedCountries?: string[];
|
|
6
9
|
countryCode?: string;
|
|
@@ -71,13 +74,9 @@ export declare type AddressSchema = (AddressField | AddressFieldsGroup)[];
|
|
|
71
74
|
export interface AddressSpecifications {
|
|
72
75
|
[key: string]: {
|
|
73
76
|
hasDataset?: boolean;
|
|
74
|
-
labels?:
|
|
75
|
-
[key: string]: string;
|
|
76
|
-
};
|
|
77
|
+
labels?: StringObject;
|
|
77
78
|
optionalFields?: AddressField[];
|
|
78
|
-
placeholders?:
|
|
79
|
-
[key: string]: string;
|
|
80
|
-
};
|
|
79
|
+
placeholders?: StringObject;
|
|
81
80
|
schema?: AddressSchema;
|
|
82
81
|
};
|
|
83
82
|
}
|
|
@@ -13,7 +13,7 @@ declare class Field extends Component<FieldProps, FieldState> {
|
|
|
13
13
|
filled: any;
|
|
14
14
|
focused?: undefined;
|
|
15
15
|
};
|
|
16
|
-
render({ className, classNameModifiers, children, errorMessage, helper, inputWrapperModifiers, isLoading, isValid, label, dualBrandingElements, dir, name, showValidIcon }: {
|
|
16
|
+
render({ className, classNameModifiers, children, errorMessage, helper, inputWrapperModifiers, isLoading, isValid, label, dualBrandingElements, dir, name, showValidIcon, isCollatingErrors }: {
|
|
17
17
|
className?: string;
|
|
18
18
|
classNameModifiers?: any[];
|
|
19
19
|
children: any;
|
|
@@ -27,6 +27,7 @@ declare class Field extends Component<FieldProps, FieldState> {
|
|
|
27
27
|
dir: any;
|
|
28
28
|
name: any;
|
|
29
29
|
showValidIcon: any;
|
|
30
|
+
isCollatingErrors: any;
|
|
30
31
|
}): h.JSX.Element;
|
|
31
32
|
}
|
|
32
33
|
export default Field;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
2
|
import { SelectProps } from './types';
|
|
3
3
|
import './Select.scss';
|
|
4
|
-
declare function Select({ items, className, classNameModifiers, filterable, readonly, onChange, selected, name, isInvalid, isValid, placeholder, uniqueId }: SelectProps): h.JSX.Element;
|
|
4
|
+
declare function Select({ items, className, classNameModifiers, filterable, readonly, onChange, selected, name, isInvalid, isValid, placeholder, uniqueId, isCollatingErrors }: SelectProps): h.JSX.Element;
|
|
5
5
|
declare namespace Select {
|
|
6
6
|
var defaultProps: {
|
|
7
7
|
className: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Make an array of encrypted field names based on the value of the 'data-cse' attribute of elements in the rootNode
|
|
3
|
+
*/
|
|
4
|
+
export declare const getFields: (rootNode: any) => any;
|
|
5
|
+
/**
|
|
6
|
+
* If, visually, we're dealing with a single date field (expiryDate) we still need separate entries
|
|
7
|
+
* for expiryMonth & expiryYear - since that is how the values will be delivered from securedFields
|
|
8
|
+
*/
|
|
9
|
+
export declare const validFieldsReducer: (acc: any, cur: any) => any;
|
|
10
|
+
export declare const getErrorReducer: (numDateFields: any, state: any) => (acc: any, field: any) => any;
|
|
11
|
+
/**
|
|
12
|
+
* Create an object suitable for sending to our handleOnError function
|
|
13
|
+
*/
|
|
14
|
+
export declare const getErrorObject: (fieldType: any, rootNode: any, state: any) => {
|
|
15
|
+
rootNode: any;
|
|
16
|
+
fieldType: any;
|
|
17
|
+
error: any;
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
@@ -1,29 +1,8 @@
|
|
|
1
1
|
import { Component } from 'preact';
|
|
2
2
|
import { SFPProps } from './defaultProps';
|
|
3
|
-
import { StylesObject, CbObjOnError } from '
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { CVCPolicyType, DatePolicyType } from './lib/core/AbstractSecuredField';
|
|
7
|
-
export interface SFPState {
|
|
8
|
-
status?: string;
|
|
9
|
-
brand?: string;
|
|
10
|
-
errors?: object;
|
|
11
|
-
valid: object;
|
|
12
|
-
data: object;
|
|
13
|
-
cvcPolicy?: CVCPolicyType;
|
|
14
|
-
isSfpValid?: boolean;
|
|
15
|
-
autoCompleteName?: string;
|
|
16
|
-
billingAddress?: AddressData;
|
|
17
|
-
hasUnsupportedCard?: boolean;
|
|
18
|
-
hasKoreanFields?: boolean;
|
|
19
|
-
showSocialSecurityNumber?: boolean;
|
|
20
|
-
expiryDatePolicy?: DatePolicyType;
|
|
21
|
-
socialSecurityNumber?: string;
|
|
22
|
-
}
|
|
23
|
-
export interface SingleBrandResetObject {
|
|
24
|
-
brand: string;
|
|
25
|
-
cvcPolicy: CVCPolicyType;
|
|
26
|
-
}
|
|
3
|
+
import { StylesObject, CbObjOnError } from '../lib/types';
|
|
4
|
+
import { BinLookupResponse } from '../../../Card/types';
|
|
5
|
+
import { SFPState, SingleBrandResetObject } from './types';
|
|
27
6
|
/**
|
|
28
7
|
* SecuredFieldsProvider:
|
|
29
8
|
* Initialises & handles the client-side part of SecuredFields
|
|
@@ -53,7 +32,7 @@ declare class SecuredFieldsProvider extends Component<SFPProps, SFPState> {
|
|
|
53
32
|
keypadFix: boolean;
|
|
54
33
|
rootNode: any;
|
|
55
34
|
loadingContext: any;
|
|
56
|
-
|
|
35
|
+
brands: any[];
|
|
57
36
|
allowedDOMAccess: boolean;
|
|
58
37
|
showWarnings: boolean;
|
|
59
38
|
autoFocus: boolean;
|
|
@@ -68,7 +47,6 @@ declare class SecuredFieldsProvider extends Component<SFPProps, SFPState> {
|
|
|
68
47
|
onBinValue: () => void;
|
|
69
48
|
onFocus: () => void;
|
|
70
49
|
onAutoComplete: () => void;
|
|
71
|
-
placeholders: {};
|
|
72
50
|
styles: {};
|
|
73
51
|
};
|
|
74
52
|
componentDidMount(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CbObjOnError, CbObjOnFocus, CbObjOnBrand, CbObjOnAllValid, CbObjOnFieldValid, CbObjOnAutoComplete, CbObjOnConfigSuccess, CbObjOnLoad } from '
|
|
1
|
+
import { CbObjOnError, CbObjOnFocus, CbObjOnBrand, CbObjOnAllValid, CbObjOnFieldValid, CbObjOnAutoComplete, CbObjOnConfigSuccess, CbObjOnLoad } from '../lib/types';
|
|
2
2
|
/**
|
|
3
3
|
* Emits the onConfigSuccess (ready) event
|
|
4
4
|
* Here we can assume CSF is loaded and ready to be used
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Language } from '../../../../language/Language';
|
|
2
|
+
import { CardBrandsConfiguration } from '../../../Card/types';
|
|
3
|
+
import { StylesObject } from '../lib/types';
|
|
4
|
+
/**
|
|
5
|
+
* Should be the only props that can be sent to SFP (from CardInput, SecuredFieldsInput, AchInput, GiftcardComponent)
|
|
6
|
+
*/
|
|
7
|
+
export interface SFPProps {
|
|
8
|
+
allowedDOMAccess?: boolean;
|
|
9
|
+
autoFocus?: boolean;
|
|
10
|
+
brands?: string[];
|
|
11
|
+
brandsConfiguration?: CardBrandsConfiguration;
|
|
12
|
+
clientKey: string;
|
|
13
|
+
countryCode?: string;
|
|
14
|
+
hasKoreanFields?: boolean;
|
|
15
|
+
i18n: Language;
|
|
16
|
+
implementationType?: string;
|
|
17
|
+
isCollatingErrors?: boolean;
|
|
18
|
+
keypadFix?: boolean;
|
|
19
|
+
koreanAuthenticationRequired?: boolean;
|
|
20
|
+
legacyInputMode?: boolean;
|
|
21
|
+
loadingContext: string;
|
|
22
|
+
minimumExpiryDate?: string;
|
|
23
|
+
onAdditionalSFConfig?: () => {};
|
|
24
|
+
onAdditionalSFRemoved?: () => {};
|
|
25
|
+
onAllValid?: () => {};
|
|
26
|
+
onAutoComplete?: () => {};
|
|
27
|
+
onBinValue?: () => {};
|
|
28
|
+
onBrand?: () => {};
|
|
29
|
+
onChange: () => {};
|
|
30
|
+
onConfigSuccess?: () => {};
|
|
31
|
+
onError?: () => {};
|
|
32
|
+
onFieldValid?: () => {};
|
|
33
|
+
onFocus?: () => {};
|
|
34
|
+
onLoad?: () => {};
|
|
35
|
+
rootNode: HTMLElement;
|
|
36
|
+
showWarnings?: boolean;
|
|
37
|
+
styles?: StylesObject;
|
|
38
|
+
trimTrailingSeparator?: boolean;
|
|
39
|
+
type: string;
|
|
40
|
+
render: () => {};
|
|
41
|
+
}
|
|
42
|
+
declare const _default: {
|
|
43
|
+
type: string;
|
|
44
|
+
keypadFix: boolean;
|
|
45
|
+
rootNode: any;
|
|
46
|
+
loadingContext: any;
|
|
47
|
+
brands: any[];
|
|
48
|
+
allowedDOMAccess: boolean;
|
|
49
|
+
showWarnings: boolean;
|
|
50
|
+
autoFocus: boolean;
|
|
51
|
+
trimTrailingSeparator: boolean;
|
|
52
|
+
onChange: () => void;
|
|
53
|
+
onLoad: () => void;
|
|
54
|
+
onConfigSuccess: () => void;
|
|
55
|
+
onAllValid: () => void;
|
|
56
|
+
onFieldValid: () => void;
|
|
57
|
+
onBrand: () => void;
|
|
58
|
+
onError: () => void;
|
|
59
|
+
onBinValue: () => void;
|
|
60
|
+
onFocus: () => void;
|
|
61
|
+
onAutoComplete: () => void;
|
|
62
|
+
styles: {};
|
|
63
|
+
};
|
|
64
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CVCPolicyType, DatePolicyType } from '../lib/types';
|
|
2
|
+
import { AddressData } from '../../../../types';
|
|
3
|
+
export interface SFPState {
|
|
4
|
+
status?: string;
|
|
5
|
+
brand?: string;
|
|
6
|
+
errors?: object;
|
|
7
|
+
valid: SFPValid;
|
|
8
|
+
data: object;
|
|
9
|
+
cvcPolicy?: CVCPolicyType;
|
|
10
|
+
isSfpValid?: boolean;
|
|
11
|
+
autoCompleteName?: string;
|
|
12
|
+
billingAddress?: AddressData;
|
|
13
|
+
hasUnsupportedCard?: boolean;
|
|
14
|
+
hasKoreanFields?: boolean;
|
|
15
|
+
showSocialSecurityNumber?: boolean;
|
|
16
|
+
expiryDatePolicy?: DatePolicyType;
|
|
17
|
+
socialSecurityNumber?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface SingleBrandResetObject {
|
|
20
|
+
brand: string;
|
|
21
|
+
cvcPolicy: CVCPolicyType;
|
|
22
|
+
}
|
|
23
|
+
export interface SFPValid {
|
|
24
|
+
encryptedCardNumber?: boolean;
|
|
25
|
+
encryptedExpiryMonth?: boolean;
|
|
26
|
+
encryptedExpiryYear?: boolean;
|
|
27
|
+
encryptedSecurityCode?: boolean;
|
|
28
|
+
encryptedPassword?: boolean;
|
|
29
|
+
encryptedPin?: boolean;
|
|
30
|
+
encryptedBankAccountNumber?: boolean;
|
|
31
|
+
encryptedBankLocationId?: boolean;
|
|
32
|
+
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { CSFSetupObject, CSFConfigObject, CSFCallbacksConfig, CSFStateObject
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
import { CSFSetupObject, CSFConfigObject, CSFCallbacksConfig, CSFStateObject } from './types';
|
|
2
|
+
import { SFFeedbackObj, SendBrandObject, SendExpiryDateObject } from '../types';
|
|
3
|
+
import { createSecuredFields } from './extensions/createSecuredFields';
|
|
4
|
+
import processBrand from './partials/processBrand';
|
|
5
|
+
import handleBrandFromBinLookup from './extensions/handleBrandFromBinLookup';
|
|
5
6
|
declare abstract class AbstractCSF {
|
|
6
7
|
protected callbacks: CSFCallbacksConfig;
|
|
7
8
|
protected config: CSFConfigObject;
|
|
8
9
|
protected props: CSFSetupObject;
|
|
9
10
|
protected state: CSFStateObject;
|
|
10
|
-
protected
|
|
11
|
-
protected
|
|
11
|
+
protected validateForm: () => void;
|
|
12
|
+
protected handleBrandFromBinLookup: typeof handleBrandFromBinLookup;
|
|
12
13
|
protected callbacksHandler: (callbacksObj: object) => void;
|
|
13
14
|
protected configHandler: () => void;
|
|
14
15
|
protected createCardSecuredFields: (securedFields: HTMLElement[]) => number;
|
|
@@ -27,7 +28,7 @@ declare abstract class AbstractCSF {
|
|
|
27
28
|
protected isConfigured: () => void;
|
|
28
29
|
protected postMessageToAllIframes: (pDataObj: object) => void;
|
|
29
30
|
protected processAutoComplete: (pFeedbackObj: SFFeedbackObj) => void;
|
|
30
|
-
protected processBrand: typeof
|
|
31
|
+
protected processBrand: typeof processBrand;
|
|
31
32
|
protected sendBrandToCardSF: (brandObj: SendBrandObject) => void;
|
|
32
33
|
protected sendExpiryDatePolicyToSF: (dateObj: SendExpiryDateObject) => void;
|
|
33
34
|
protected setFocusOnFrame: (pFieldType: string, doLog?: boolean) => void;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import AbstractCSF from './AbstractCSF';
|
|
2
|
-
import { CSFReturnObject, CSFSetupObject } from '
|
|
2
|
+
import { CSFReturnObject, CSFSetupObject } from './types';
|
|
3
3
|
declare class CSF extends AbstractCSF {
|
|
4
4
|
constructor(setupObj: CSFSetupObject);
|
|
5
5
|
private init;
|
|
6
6
|
createReturnObject(): CSFReturnObject;
|
|
7
|
-
/**
|
|
8
|
-
* Retrieves the iframe, stored by field type, & returns it's contentWindow
|
|
9
|
-
*/
|
|
10
|
-
private getIframeContentWin;
|
|
11
7
|
}
|
|
12
8
|
export default CSF;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -2,4 +2,4 @@ import { SendBrandObject, SendExpiryDateObject } from '../../types';
|
|
|
2
2
|
import { BinLookupResponse } from '../../../../../Card/types';
|
|
3
3
|
export declare function sendBrandToCardSF(brandObj: SendBrandObject): void;
|
|
4
4
|
export declare function sendExpiryDatePolicyToSF(expiryDateObj: SendExpiryDateObject): void;
|
|
5
|
-
export
|
|
5
|
+
export default function handleBrandFromBinLookup(binLookupResponse: BinLookupResponse): void;
|
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SFFeedbackObj } from '
|
|
1
|
+
import { SFFeedbackObj } from '../../types';
|
|
2
2
|
export declare function handleEncryption(pFeedbackObj: SFFeedbackObj): void;
|
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SFFeedbackObj } from '
|
|
1
|
+
import { SFFeedbackObj } from '../../types';
|
|
2
2
|
export declare function handleValidation(pFeedbackObj: SFFeedbackObj): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SFFeedbackObj } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* @param csfState - comes from initial, partial, implementation
|
|
4
|
+
* @param csfCallbacks - comes from initial, partial, implementation
|
|
5
|
+
*
|
|
6
|
+
* @param pFeedbackObj -
|
|
7
|
+
*/
|
|
8
|
+
export declare function handleBinValue({ csfState, csfCallbacks }: {
|
|
9
|
+
csfState: any;
|
|
10
|
+
csfCallbacks: any;
|
|
11
|
+
}, pFeedbackObj: SFFeedbackObj): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SFFeedbackObj } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Call focus callback and store which field currently has focus
|
|
4
|
+
*
|
|
5
|
+
* @param csfState - comes from initial, partial, implementation
|
|
6
|
+
* @param csfProps - comes from initial, partial, implementation
|
|
7
|
+
* @param csfCallbacks - comes from initial, partial, implementation
|
|
8
|
+
*
|
|
9
|
+
* @param pFeedbackObj -
|
|
10
|
+
*/
|
|
11
|
+
export declare function handleFocus({ csfState, csfProps, csfCallbacks }: {
|
|
12
|
+
csfState: any;
|
|
13
|
+
csfProps: any;
|
|
14
|
+
csfCallbacks: any;
|
|
15
|
+
}, pFeedbackObj: SFFeedbackObj): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param csfState - comes from initial, partial, implementation
|
|
3
|
+
* @param csfCallbacks - comes from initial, partial, implementation
|
|
4
|
+
* @param isConfigured - comes from initial, partial, implementation
|
|
5
|
+
*
|
|
6
|
+
* @param pFeedbackObj -
|
|
7
|
+
*/
|
|
8
|
+
export declare function handleIframeConfigFeedback({ csfState, csfCallbacks }: {
|
|
9
|
+
csfState: any;
|
|
10
|
+
csfCallbacks: any;
|
|
11
|
+
}, isConfigured: any, pFeedbackObj: any): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param csfState - comes from initial, partial, implementation
|
|
3
|
+
* @param csfConfig - comes from initial, partial, implementation
|
|
4
|
+
* @param csfProps - comes from initial, partial, implementation
|
|
5
|
+
* @param csfCallbacks - comes from initial, partial, implementation
|
|
6
|
+
* @param validateForm - comes from initial, partial, implementation
|
|
7
|
+
*/
|
|
8
|
+
export declare function isConfigured({ csfState, csfConfig, csfProps, csfCallbacks }: {
|
|
9
|
+
csfState: any;
|
|
10
|
+
csfConfig: any;
|
|
11
|
+
csfProps: any;
|
|
12
|
+
csfCallbacks: any;
|
|
13
|
+
}, validateForm: any): void;
|
package/dist/types/components/internal/SecuredFields/lib/CSF/partials/postMessageToAllIframes.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UTIL TO BROADCAST TO ALL IFRAMES AT ONCE
|
|
3
|
+
* Adds correct txVariant, fieldType and numKey for each iframe
|
|
4
|
+
*
|
|
5
|
+
* @param csfState - comes from initial, partial, implementation
|
|
6
|
+
* @param csfConfig - comes from initial, partial, implementation
|
|
7
|
+
*
|
|
8
|
+
* @param pDataObj -
|
|
9
|
+
*/
|
|
10
|
+
export declare function postMessageToAllIframes({ csfState, csfConfig }: {
|
|
11
|
+
csfState: any;
|
|
12
|
+
csfConfig: any;
|
|
13
|
+
}, pDataObj: object): void;
|
package/dist/types/components/internal/SecuredFields/lib/CSF/partials/processAutoComplete.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SFFeedbackObj } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param csfState - comes from initial, partial, implementation
|
|
5
|
+
* @param csfConfig - comes from initial, partial, implementation
|
|
6
|
+
* @param csfCallbacks - comes from initial, partial, implementation
|
|
7
|
+
*
|
|
8
|
+
* @param pFeedbackObj -
|
|
9
|
+
*/
|
|
10
|
+
export declare function processAutoComplete({ csfState, csfConfig, csfCallbacks }: {
|
|
11
|
+
csfState: any;
|
|
12
|
+
csfConfig: any;
|
|
13
|
+
csfCallbacks: any;
|
|
14
|
+
}, pFeedbackObj: SFFeedbackObj): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SFFeedbackObj } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* - If generic card type AND passed brand doesn't equal stored brand - send the new brand to the cvc input
|
|
4
|
+
* (so it can reassess what length it should be and if any value it contains is now valid)
|
|
5
|
+
*
|
|
6
|
+
* - Create object for onBrand callback aka SFPHandlers.handleOnBrand
|
|
7
|
+
*
|
|
8
|
+
* @param csfState - comes from initial, partial, implementation
|
|
9
|
+
* @param csfConfig - comes from initial, partial, implementation
|
|
10
|
+
* @param csfProps - comes from initial, partial, implementation
|
|
11
|
+
* @param csfCallbacks - comes from initial, partial, implementation
|
|
12
|
+
*
|
|
13
|
+
* @param pFeedbackObj -
|
|
14
|
+
*/
|
|
15
|
+
export default function processBrand({ csfState, csfConfig, csfProps, csfCallbacks }: {
|
|
16
|
+
csfState: any;
|
|
17
|
+
csfConfig: any;
|
|
18
|
+
csfProps: any;
|
|
19
|
+
csfCallbacks: any;
|
|
20
|
+
}, pFeedbackObj: SFFeedbackObj): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param csfState - comes from initial, partial, implementation
|
|
3
|
+
* @param csfConfig - comes from initial, partial, implementation
|
|
4
|
+
*
|
|
5
|
+
* @param pFieldType -
|
|
6
|
+
* @param doLog -
|
|
7
|
+
*/
|
|
8
|
+
export declare function setFocusOnFrame({ csfState, csfConfig }: {
|
|
9
|
+
csfState: any;
|
|
10
|
+
csfConfig: any;
|
|
11
|
+
}, pFieldType: string, doLog?: boolean): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param csfState - comes from initial, partial, implementation
|
|
3
|
+
* @param csfProps - comes from initial, partial, implementation
|
|
4
|
+
* @param csfCallbacks - comes from initial, partial, implementation
|
|
5
|
+
*/
|
|
6
|
+
export default function validateForm({ csfState, csfProps, csfCallbacks }: {
|
|
7
|
+
csfState: any;
|
|
8
|
+
csfProps: any;
|
|
9
|
+
csfCallbacks: any;
|
|
10
|
+
}): void;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import Language from '../../../../../language/Language';
|
|
2
|
+
import { BrandStorageObject } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Exposed functions that can be called on the CSF instance
|
|
5
|
+
*/
|
|
6
|
+
export interface CSFReturnObject {
|
|
7
|
+
updateStyles: any;
|
|
8
|
+
setFocusOnFrame: any;
|
|
9
|
+
isValidated: any;
|
|
10
|
+
destroy: any;
|
|
11
|
+
brandsFromBinLookup: any;
|
|
12
|
+
hasUnsupportedCard: any;
|
|
13
|
+
addSecuredField: any;
|
|
14
|
+
removeSecuredField: any;
|
|
15
|
+
setKCPStatus: any;
|
|
16
|
+
sendValueToFrame?: any;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Base interface for SetupObject & ConfigObject
|
|
20
|
+
*/
|
|
21
|
+
interface CSFCommonProps {
|
|
22
|
+
loadingContext: string;
|
|
23
|
+
cardGroupTypes?: string[];
|
|
24
|
+
allowedDOMAccess?: boolean;
|
|
25
|
+
autoFocus?: boolean;
|
|
26
|
+
trimTrailingSeparator?: boolean;
|
|
27
|
+
showWarnings?: boolean;
|
|
28
|
+
keypadFix?: boolean;
|
|
29
|
+
isKCP?: boolean;
|
|
30
|
+
iframeUIConfig?: object;
|
|
31
|
+
legacyInputMode?: boolean;
|
|
32
|
+
minimumExpiryDate?: string;
|
|
33
|
+
implementationType?: 'components' | 'custom';
|
|
34
|
+
isCollatingErrors?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Object sent when SecuredFieldsProvider initialises CSF
|
|
38
|
+
*/
|
|
39
|
+
export interface CSFSetupObject extends CSFCommonProps {
|
|
40
|
+
type: string;
|
|
41
|
+
clientKey: string;
|
|
42
|
+
rootNode: string | HTMLElement;
|
|
43
|
+
callbacks?: object;
|
|
44
|
+
i18n?: Language;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The type for the config object created by CSF: properties that just need to be set once, at startup, and then don't change
|
|
48
|
+
* This object provides the source for many of the properties that are written into the SFSetupObject used to initialise a new SecuredField.ts
|
|
49
|
+
*/
|
|
50
|
+
export interface CSFConfigObject extends CSFCommonProps {
|
|
51
|
+
iframeSrc: string;
|
|
52
|
+
isCreditCardType: boolean;
|
|
53
|
+
sfLogAtStart: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface CSFCallbacksConfig {
|
|
56
|
+
onLoad?: (callbackObj: object) => void;
|
|
57
|
+
onConfigSuccess?: (callbackObj: object) => void;
|
|
58
|
+
onFieldValid?: (callbackObj: object) => void;
|
|
59
|
+
onAllValid?: (callbackObj: object) => void;
|
|
60
|
+
onBrand?: (callbackObj: object) => void;
|
|
61
|
+
onError?: (callbackObj: object) => void;
|
|
62
|
+
onFocus?: (callbackObj: object) => void;
|
|
63
|
+
onBinValue?: (callbackObj: object) => void;
|
|
64
|
+
onAutoComplete?: (callbackObj: object) => void;
|
|
65
|
+
onAdditionalSFConfig?: (callbackObj: object) => void;
|
|
66
|
+
onAdditionalSFRemoved?: (callbackObj: object) => void;
|
|
67
|
+
}
|
|
68
|
+
export interface CSFStateObject {
|
|
69
|
+
type: string;
|
|
70
|
+
brand: BrandStorageObject;
|
|
71
|
+
allValid: boolean;
|
|
72
|
+
numIframes: number;
|
|
73
|
+
originalNumIframes: number;
|
|
74
|
+
iframeCount: number;
|
|
75
|
+
iframeConfigCount: number;
|
|
76
|
+
isConfigured: boolean;
|
|
77
|
+
hasSeparateDateFields: boolean;
|
|
78
|
+
currentFocusObject: string;
|
|
79
|
+
registerFieldForIos: boolean;
|
|
80
|
+
securedFields: object;
|
|
81
|
+
isKCP: boolean;
|
|
82
|
+
}
|
|
83
|
+
export {};
|
package/dist/types/components/internal/SecuredFields/lib/{core → CSF}/utils/callbackUtils.d.ts
RENAMED
|
File without changes
|