Skip to main content

SecureFieldsEventsPayload

Payload for each event emitted by the Secure Fields SDK.

Properties​

autocomplete​

autocomplete: SecureFieldsChangeEventPayload;

Triggered when a field is autocompleted. This include the state of the field on which the change happened but also the state of the other fields.


blur​

blur: SecureFieldsChangeEventPayload;

Triggered when a field is blurred/unfocused. This include the state of the field on which the change happened but also the state of the other fields.


brandDetected​

brandDetected: object;

Triggered when a brand is detected in the card number field. It can also contain a co-brand if applicable.

NameType
brands?Brand[]

brandUserSelection​

brandUserSelection: object;

Triggered when the user selects a brand manually (co-brand case).

NameType
matchedBrandsBrand[]
selectedBrand

change​

change: SecureFieldsChangeEventPayload;

Triggered when a field changes(focus, blur, keyup, keydown, autocomplete).

This include the state of the field on which the change happened but also the state of the other fields.


error​

error: object;

Triggered for multiple errors while using the SDK.

NameType
code?string
messagestring
payload?any

focus​

focus: SecureFieldsChangeEventPayload;

Triggered when a field is focused This include the state of the field on which the change happened but also the state of the other fields.

See​

SecureFieldsChangeEventPayload


formValid​

formValid: object;

Triggered when the form validation changes. It's fired once at initialization with false and then on every change.

NameType
fields?Partial<Record<"cardNumber" | "cvv" | "expDate" | "holderName", SecureFieldsFieldState>>
hasErrorsboolean

keydown​

keydown: SecureFieldsChangeEventPayload;

Triggered when a key is pressed down in a field. This include the state of the field on which the change happened but also the state of the other fields.


keyup​

keyup: SecureFieldsChangeEventPayload;

Triggered when a key is pressed in a field. This include the state of the field on which the change happened but also the state of the other fields.


ready​

ready: void;

Triggered when the provider vaultSDK has been loaded and is ready to use.


success​

success:
| {
birth_date?: undefined;
card?: CardInfo;
three_ds_server_trans_id?: string;
vault_form_token: string;
}
| {
birth_date: string;
card?: undefined;
three_ds_server_trans_id?: string;
vault_form_token: string;
}
| {
birth_date: string;
card?: undefined;
vault_form_token?: undefined;
};

Triggered when the submission has been successful.

Three mutually exclusive cases:

  • Standard card: vault_form_token is present; card is optionally present; birth_date is absent.
  • Oney full-form: both vault_form_token and birth_date are present; card is absent.
  • Oney CVV-only: only birth_date is present; vault_form_token and card are absent.

Use 'vault_form_token' in payload or 'birth_date' in payload to narrow the variant.

With 3DS enabled at init, this fires only once the 3DS sequence has run, and carries its three_ds_server_trans_id — a submit whose 3DS could not be attempted still emits success, without it.

Union Members​

Type Literal​
{
birth_date?: undefined;
card?: CardInfo;
three_ds_server_trans_id?: string;
vault_form_token: string;
}
NameTypeDescription
birth_date?undefined-
card?CardInfoCard metadata returned by the backend. Present when the backend supplies it.
three_ds_server_trans_id?stringPresent when 3DS is enabled: correlates every 3DS step of this authentication.
vault_form_tokenstringStandard tokenization — always present in this variant.

Type Literal​
{
birth_date: string;
card?: undefined;
three_ds_server_trans_id?: string;
vault_form_token: string;
}
NameTypeDescription
birth_datestringISO 8601 date of birth required by Oney (YYYY-MM-DD).
card?undefined-
three_ds_server_trans_id?stringPresent when 3DS is enabled: correlates every 3DS step of this authentication.
vault_form_tokenstringVault token issued for the Oney full-form path.

Type Literal​
{
birth_date: string;
card?: undefined;
vault_form_token?: undefined;
}
NameTypeDescription
birth_datestringISO 8601 date of birth for Oney CVV-only — no vault tokenization occurs.
card?undefined-
vault_form_token?undefined-