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.
| Name | Type |
|---|---|
brands? | Brand[] |
brandUserSelection
brandUserSelection: object;
Triggered when the user selects a brand manually (co-brand case).
| Name | Type |
|---|---|
matchedBrands | Brand[] |
selected | Brand |
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.
| Name | Type |
|---|---|
code? | string |
message | string |
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.
| Name | Type |
|---|---|
fields? | object |
fields.cardNumber? | object |
fields.cardNumber.length? | number |
fields.cardNumber.touched? | boolean |
fields.cardNumber.valid? | boolean |
fields.cvv? | object |
fields.cvv.length? | number |
fields.cvv.touched? | boolean |
fields.cvv.valid? | boolean |
hasErrors | boolean |
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;
vault_form_token: string;
}
| {
birth_date: string;
card?: undefined;
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 / PCI Proxy card:
vault_form_tokenis present;cardis optionally present;birth_dateis absent. - Oney full-form: both
vault_form_tokenandbirth_dateare present;cardis absent. - Oney CVV-only: only
birth_dateis present;vault_form_tokenandcardare absent.
Use 'vault_form_token' in payload or 'birth_date' in payload to narrow the variant.
Union Members
Type Literal
{
birth_date?: undefined;
card?: CardInfo;
vault_form_token: string;
}
| Name | Type | Description |
|---|---|---|
birth_date? | undefined | - |
card? | CardInfo | Card metadata returned by the backend. Present when the backend supplies it. |
vault_form_token | string | Standard or PCI Proxy tokenization — always present in this variant. |
Type Literal
{
birth_date: string;
card?: undefined;
vault_form_token: string;
}
| Name | Type | Description |
|---|---|---|
birth_date | string | ISO 8601 date of birth required by Oney (YYYY-MM-DD). |
card? | undefined | - |
vault_form_token | string | Vault token issued for the Oney full-form path. |
Type Literal
{
birth_date: string;
card?: undefined;
vault_form_token?: undefined;
}
| Name | Type | Description |
|---|---|---|
birth_date | string | ISO 8601 date of birth for Oney CVV-only — no vault tokenization occurs. |
card? | undefined | - |
vault_form_token? | undefined | - |