Skip to main content

VaultSDKAdapter

This is a common interface for all vault SDK adapters.

Events

submit()

submit: (payload) => Promise<{
vault_form_token: string;
card?: {
last_four_digits?: string;
bin?: string;
detected_brands?: (
| "VISA"
| "CARTE_BANCAIRE"
| "MASTERCARD"
| "MAESTRO"
| "AMERICAN_EXPRESS"
| "DISCOVER"
| "JCB"
| "DINERS_CLUB"
| "UNIONPAY"
| "OTHER")[];
};
}>;

Triggers a validation of the form, requesting the form_id to be returned if the form is valid.

Parameters

ParameterTypeDescription
payload{ expiry_month: number; expiry_year: number; }The payload containing the expiry month and year.
payload.expiry_monthnumber-
payload.expiry_yearnumber-

Returns

Promise<{ vault_form_token: string; card?: { last_four_digits?: string; bin?: string; detected_brands?: ( | "VISA" | "CARTE_BANCAIRE" | "MASTERCARD" | "MAESTRO" | "AMERICAN_EXPRESS" | "DISCOVER" | "JCB" | "DINERS_CLUB" | "UNIONPAY" | "OTHER")[]; }; }>

Throws

SdkErrors.TOKENIZATION_FAILED if the form is invalid or if there is an error during the process.

Throws

SdkErrors.INVALID_FORM if the form is not valid. success - emitted when the form is successfully tokenized. error - emitted when there is an error during the tokenization process.

Methods

on()

on(event, callback): void;

Registers an event listener for the specified event.

Parameters

ParameterType
eventkeyof SdkAdapterEventData
callback(data) => void

Returns

void

Properties

render()

render: () => void;

Renders the fields in the targets specified in the config.

Returns

void

Throws

SdkErrors.CONTAINER_NOT_FOUND if the target element for the field is not found.


destroy()

destroy: () => void;

Destroys the SDK instance and removes all event listeners. This is terminal and cannot the instance cannot be used after this call.

Returns

void