HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/html/ielts-store/wp-content/plugins/woo-stripe-payment/includes/updates/update-3.1.0.php
<?php
defined( 'ABSPATH' ) || exit();

// update webhooks to include payment_intent.succeeded
$environments = array( 'live', 'test' );

foreach ( $environments as $env ) {
	$webhook_id = stripe_wc()->api_settings->get_option( "webhook_id_{$env}" );
	if ( $webhook_id ) {
		$gateway = WC_Stripe_Gateway::load( $env );

		// fetch webhook so we can merge existing events with the new payment_intent.succeeded event
		$webhook = $gateway->webhookEndpoints->retrieve( $webhook_id );
		if ( ! is_wp_error( $webhook ) ) {
			$events   = $webhook['enabled_events'];
			$events[] = 'payment_intent.succeeded';

			$result = $gateway->webhookEndpoints->update( $webhook_id, array( 'enabled_events' => $events ) );
			wc_stripe_log_info( "Webhook {$webhook_id} updated." );
		}
	}
}

update_option( 'wc_stripe_connect_notice', 'yes' );

// send email
ob_start();
WC_Emails::instance()->email_header( __( 'Stripe For WooCommerce Update', 'woo-stripe-payment' ) );
?>
    <p><?php esc_html_e( 'Greetings from Payment Plugins,', 'woo-stripe-payment' ); ?></p>
    <p><?php esc_html_e( 'At Stripe\'s request, we have updated Stripe for WooCommerce to use the new Stripe Connect integration. This new integration offers even more security. Stripe is requesting that all merchants switch.', 'woo-stripe-payment' ); ?></p>
    <p><?php printf( __( 'Click %1$shere%2$s to be redirected to your Stripe API settings page then click the <strong>Click to Connect</strong> button.', 'woo-stripe-payment' ), '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=checkout&section=stripe_api' ) . '" target="_blank">', '</a>' ); ?>


    <p><?php esc_html_e( 'Kind Regards,', 'woo-stripe-payment' ); ?></p>
    <p><?php esc_html_e( 'Payment Plugins' ); ?></p>
<?php
WC_Emails::instance()->email_footer();
$content           = ob_get_clean();
$settings          = get_option( 'woocommerce_new_order_settings', array( 'recipient' => get_option( 'admin_email', '' ) ) );
$email             = new WC_Email();
$email->email_type = 'html';
add_filter(
	'woocommerce_email_from_address',
	function ( $from ) {
		return 'support@paymentplugins.com';
	}
);
add_filter(
	'woocommerce_email_from_name',
	function ( $name ) {
		return 'Payment Plugins';
	}
);
$email->send( $settings['recipient'], __( 'Stripe For WooCommerce Update', 'woo-stripe-payment' ), $content, $email->get_headers(), array() );