Title: Hook into PayPal button checkout errors
Last modified: May 5, 2025

---

# Hook into PayPal button checkout errors

 *  Resolved [Goran87](https://wordpress.org/support/users/goran87/)
 * (@goran87)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/hook-into-paypal-button-checkout-errors/)
 * Hey there,
 * this support is amazing, so just to quickly ask one thing, when user clicks on
   paypal button to open modal, if error happens like user did not complete all 
   required fields, is there a JS event that we could hook into to trigger our logic?
   
   We use default ones for forms that is not working anymore:$(document.body).on(‘
   checkout_error’, function (event, errorMessage) {Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Clayton R](https://wordpress.org/support/users/mrclayton/)
 * (@mrclayton)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/hook-into-paypal-button-checkout-errors/#post-18453630)
 * Hi [@goran87](https://wordpress.org/support/users/goran87/)
 * Apologies for the delayed response. Are you specifically looking for a client
   side event or would a server side action work?
 * When one of the PayPal buttons is clicked, the plugin triggers this event:
 *     ```wp-block-code
       $(document.body).triggerHandler('wc_ppcp_on_click', [this, source]);
       ```
   
 * Where `source` is the funding source like “paypal”, “card”, “paylater”, “venmo”
   etc.
 * If there is an error, the plugin triggers this event:
 *     ```wp-block-code
       $(document.body).triggerHandler('wc_ppcp_on_error', [this, source, error]);
       ```
   
 * I believe the `wc_ppcp_on_error’ is the event that you’re looking for.
 * The reason you’re not seeing `checkout_error` is because you most likely have
   the plugin’s checkout field validation enabled. That means the plugin validates
   the checkout fields when the user clicks the PayPal button. You could turn that
   off and then validation wouldn’t occur until the checkout form is submitted and
   WooCommerce’s performs the validation during the checkout process.
 * Kind Regards
 *  Thread Starter [Goran87](https://wordpress.org/support/users/goran87/)
 * (@goran87)
 * [1 year, 1 month ago](https://wordpress.org/support/topic/hook-into-paypal-button-checkout-errors/#post-18454439)
 * Exactly what I was looking, thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Hook into PayPal button checkout errors’ is closed to new replies.

 * ![](https://ps.w.org/pymntpl-paypal-woocommerce/assets/icon-256x256.png?rev=2718338)
 * [Payment Plugins for PayPal WooCommerce](https://wordpress.org/plugins/pymntpl-paypal-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pymntpl-paypal-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pymntpl-paypal-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/pymntpl-paypal-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pymntpl-paypal-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pymntpl-paypal-woocommerce/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Goran87](https://wordpress.org/support/users/goran87/)
 * Last activity: [1 year, 1 month ago](https://wordpress.org/support/topic/hook-into-paypal-button-checkout-errors/#post-18454439)
 * Status: resolved