onFormValid
The onFormValid
event is triggered when your customers complete their payment information, ensuring that the information entered meets all necessary requirements, signaling that the path to payment processing is clear and ready to make their transactions a reality.
Objective
You will learn how to:
- Implement event.
- Considerations.
- Tips.
1. Implement event:
checkout.onFormValid((event) => {
console.log('Form successfully validated. You can continue with the process.', event);
});
Sample response
{
"paymentMethod": "CARD",
"transactionId": "17059512062590",
"orderNumber": "1705951206",
"formIsValid": true
}
2. Considerations
- This event is commonly triggered after the user has completed entering information on the payment form, including details such as credit card information, buyer data, etc.
- Useful for performing specific actions when the form is in a valid state.
3. Tips
- Make sure required fields are completed before allowing this event to be triggered.
- After onFormValid fires, it is the appropriate time to initiate any payment processing actions, such as sending the information to the server for the actual transaction.
Important
Remember to follow these steps to make use of the events:
- Create an instance to the web SDK.
const checkout = new Izipay({ config: iziConfig?.config });
- Call checkout
checkout.LoadForm(
{
authorization: token,
keyRSA: 'RSA',
callbackResponse: callbackResponsePayment,
}
);