Skip to content

Commit

Permalink
PRESS12-44 Updated the hook to trigger when wcpay_account_data is
Browse files Browse the repository at this point in the history
updated
  • Loading branch information
mamatharao05 committed Dec 5, 2024
1 parent ff08d0e commit 51f4b55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/Listeners/Commerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function register_hooks() {
add_filter( 'update_option_ewc4wp_sso_account_status', array( $this, 'ecomdash_connected' ), 10, 2 );
add_filter( 'woocommerce_update_product', array( $this, 'product_created_or_updated' ), 100, 2 );
add_action( 'update_option_woocommerce_custom_orders_table_enabled', array( $this, 'woocommerce_hpos_enabled' ), 10, 3 );
add_filter( 'pre_update_option_wcpay_account_connect_wpcom_connection_success', array( $this, 'woopay_connection' ), 10, 2 );
add_filter( 'update_option_wcpay_account_data', array( $this, 'woopay_connection' ), 10, 2 );
}

/**
Expand Down Expand Up @@ -347,7 +347,7 @@ public function woopay_connection( $new_option, $old_option ) {
'provider' => 'woopay',
'page' => $url,
);
if ( $new_option !== $old_option && ! empty( $new_option ) ) {
if ( empty( $old_option ) && ! empty( $new_option ) ) {
$this->push(
'payment_connected',
$data
Expand Down

0 comments on commit 51f4b55

Please sign in to comment.