Validation at time of clicking PayPal Express Checkout button - onClick()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This demo shows some validation but not exactly what I need. https://developer.paypal.com/demo/checkout/#/pattern/validation
I would like to do some validation at the time the PayPal button is clicked (like was the zip code field filled in correctly or is the user logged on). The Validate() is called once, basically when the page is loaded. That's too early to validate. The onClick() function is called when the button is clicked and a good place to do my validation but I don't have a way to continue if valid and display the error if not.
The demo uses a checkbox event within the scope of the validate() function so it is able to enable/disable the PayPal popup (onClick() still works if disabled). The demo's onClick() simply shows/hides the error message.
Does anyone know how to do validation within onClick() or is that too late to enable/disable?
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Need help to integrate PayPal Checkout Advanced (PPCP) with WooCommerce in PayPal Upgrade Community
- When clicking on a payment button generates error: Unexpected token ... in PayPal Payments Standard
- Payment not automatically being captured, funds not transferred in Sandbox Environment
- patch_payment_resource returns generic 422 on second request in REST APIs
- Paypal Express Checkout Not Working in PayPal Reporting