callbacks.md

Callbacks

Callback functions passed in the options object to Finix.PaymentForm(). Each callback fires in response to a specific form lifecycle event.

Fires once when the Payment Form iframe finishes loading. Takes no parameters.

onLoad: function () { ... }

Use onLoad to show UI that depends on the form being ready — for example, enabling a custom submit button or hiding a loading spinner.

Fires every time the form state changes — field values, validation errors, focus and blur events, card brand detection, and payment method switching.

onUpdate: function (state, binInformation, hasErrors) { ... }
Parameter Type Description
state object Form state including metadata about which inputs are valid, dirty, or focused — does not expose payment data
binInformation object High-level BIN data such as BIN number and card brand
hasErrors boolean true if the form currently has validation errors — useful for enabling or disabling a custom submit button

Fires when the form is submitted. Providing onSubmit in the options automatically renders a submit button inside the form.

onSubmit: function (error, response) { ... }
Parameter Type Description
error `object null`
response `object null`

Use onSubmit when you want the form to render and manage its own submit button. For a custom button outside the form, use form.submit() method instead.

See Token Response for the full response shape.