Square form and validate.js

I’m using the Square form (https://developer.squareup.com/reference/sdks/web/payments/card-payments) and a multi-step form (https://www.nicesnippets.com/blog/jquery-multi-step-form-wizard-plugin-with-validation) that uses Validation.js (https://jqueryvalidation.org/)

The problem I have is that I can’t find a way to make the multi-step stop from moving to the next step when the credit card information is not valid.

I think the solution to this problem is to capture the validation of the credit card exactly when the user finishes filling out the form and Square returns no errors.

When Square returns no errors, I can set a required checkbox with a value of 1 that Validate,js can recognize as a credit card with good information.

Is that even possible?

Thanks.

I think I found the solution based on Detect when payment form is completed

The solution is explained in Detect when payment form is completed - #5 by luenib

Thanks