n_notice() { // Bail out if Stripe account is not connected. if ( ! Helpers::has_stripe_keys() ) { return; } // Bail out if webhooks is not enabled. if ( ! Helpers::is_webhook_enabled() ) { return; } // Bail out if webhooks is configured and active. if ( Helpers::is_webhook_configured() && $this->is_webhooks_active() ) { return; } // Bail out if there are no Stripe payments. if ( ! $this->get_last_stripe_payment() ) { return; } $notice = sprintf( wp_kses( /* translators: %s - WPForms.com URL for Stripe webhooks documentation. */ __( 'Heads up! Looks like you have a problem with your webhooks configuration. Please check and confirm that you\'ve configured the WPForms webhooks in your Stripe account. This notice will disappear automatically when a new Stripe request comes in. See our documentation for more information.', 'wpforms-lite' ), [ 'a' => [ 'href' => [], 'target' => [], 'rel' => [], ], ] ), esc_url( wpforms_utm_link( 'https://wpforms.com/docs/setting-up-stripe-webhooks/', 'Admin', 'Webhooks not active' ) ) ); Notice::error( $notice, [ 'dismiss' => true, 'slug' => self::NOTICE_ID, ] ); } /** * Maybe perform updating of endpoint URL or register AS task in certain cases. * * @since 1.8.4 * * @param array $settings An array of plugin settings. * @param bool $updated Whether an option was updated or not. * @param array $old_settings An old array of plugin settings. */ public function maybe_webhook_settings_is_updated( $settings, $updated, $old_settings ) { // Bail out early if Webhooks is not enabled. if ( empty( $settings['stripe-webhooks-enabled'] ) ) { return; } // Bail out early if it's not Settings > Payments admin page. if ( ! isset( $_POST['nonce'] ) || ! wpforms_is_admin_page( 'settings', 'payments' ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'wpforms-settings-nonce' ) ) { return; } // If Webhooks Method is changed, we have to update an endpoint's URL. if ( ! empty( $settings['stripe-webhooks-communication'] ) && ! empty( $old_settings['stripe-webhooks-communication'] ) && $settings['stripe-webhooks-communication'] !== $old_settings['stripe-webhooks-communication'] ) { $this->webhooks_manager->update( $this->webhooks_manager->get_id(), [ 'url' => Helpers::get_webhook_url(), 'disabled' => false, ] ); return; } $this->maybe_schedule_task(); } /** * Determine whether webhooks is active. * * @since 1.8.4 * * @return bool */ public function is_webhooks_active() { if ( get_option( self::ENDPOINT_OPTION, self::STATUS_OK ) !== self::STATUS_OK ) { return false; } if ( get_option( self::SIGNATURE_OPTION, self::STATUS_OK ) !== self::STATUS_OK ) { return false; } return true; } /** * Save webhooks status. * * @since 1.8.4 * * @param string $option Option name. * @param string $value Status value. */ public static function save_status( $option, $value ) { if ( ! in_array( $value, [ self::STATUS_OK, self::STATUS_ERROR ], true ) ) { return; } update_option( $option, $value ); } }
Fatal error: Uncaught Error: Class 'WPForms\Integrations\Stripe\WebhooksHealthCheck' not found in /var/www/html/padrepio.org.br/web/wp-content/plugins/wpforms-lite/src/Integrations/Stripe/Stripe.php:57 Stack trace: #0 /var/www/html/padrepio.org.br/web/wp-content/plugins/wpforms-lite/src/Integrations/Loader.php(75): WPForms\Integrations\Stripe\Stripe->load() #1 /var/www/html/padrepio.org.br/web/wp-content/plugins/wpforms-lite/src/Integrations/Loader.php(60): WPForms\Integrations\Loader->load_integration(Object(WPForms\Integrations\Stripe\Stripe)) #2 /var/www/html/padrepio.org.br/web/wp-content/plugins/wpforms-lite/src/Integrations/Loader.php(22): WPForms\Integrations\Loader->__construct() #3 /var/www/html/padrepio.org.br/web/wp-includes/class-wp-hook.php(324): WPForms\Integrations\Loader::get_instance('') #4 /var/www/html/padrepio.org.br/web/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(Object(WPForms\Providers\Providers), Array) #5 /var/www/html/padrepio.org.br/web/wp-includes/plugin.php(517): WP_Hook->do_act in /var/www/html/padrepio.org.br/web/wp-content/plugins/wpforms-lite/src/Integrations/Stripe/Stripe.php on line 57