GithubHelp home page GithubHelp logo

Comments (4)

ribeiroguilherme avatar ribeiroguilherme commented on May 28, 2024

Hi @davidohlin ,

The component.submit() has built-in logic to check if the component is valid, and then show validation or perform the payment. You can skip your custom check and you can rely in our internal validation in this case. If you face any issue, please let us know.

Cheers

from adyen-web.

davidohlin avatar davidohlin commented on May 28, 2024

@ribeiroguilherme But there is no callback to know that the submit was invalid, right? I omitted my side effects for brevity, but imagine this use case:

if (!component.isValid) {
  component.showValidation();
  setLoading(false)
  return;
}

component.submit();

How would I achieve that? The submit method doesnt return anything or omit any usable events AFAICT from the docs.

from adyen-web.

ribeiroguilherme avatar ribeiroguilherme commented on May 28, 2024

Hey @davidohlin ,

Indeed, there is no callback reporting that the form is invalid and validation is triggered. I discussed this internally with the team, and one idea that came out is to trigger onError with the errorType: VALIDATION . This way, we would report back that the validation step got triggered. How does that sound?

Talking specifically about the GooglePay button - it is not recommended to provide your own pay button according to the Google guidelines .
Regarding the GooglePay component, I'd recommend using the Component without custom pay button, and listen to the onSubmit callback.

from adyen-web.

lauterry avatar lauterry commented on May 28, 2024

Hello

Could you assist me with finding documentation or information regarding the availability of the component.showValidation() function?

I'm interested in programmatically triggering form validation, especially for an Adyen component form.

I have a custom button and would like to synchronize the validation of the Adyen component form with other fields on the form.

Any guidance on this matter would be greatly appreciated.

Best regards.

from adyen-web.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.