Gr4vy Embed accepts an
onEvent parameter that can be used to listen to certain
events emitted from the form.
Currently, we Gr4vy Embed emits the following events.
Returned when the initial input (
options) are incorrectly formatted
Dispatched when the card form changes validity. The card form is
invalid if required data, such as card number, is not entered or if a required field is populated with invalid data. If all form fields are populated with valid data the form is
e.g. if the form is valid the onEvent
data will be:
Returns a full transaction object when the transaction was successfully created.
Returns a payment method object when a payment method was selected and in Gr4vy Embed. The method could be a new payment method(e.g. card) or a stored method (e.g. id).
Returned when the form encounters an API error.