From 974ee325fe7e179e1e18630eba4ffcb230bdb6bb Mon Sep 17 00:00:00 2001 From: Timur Karimov Date: Fri, 15 Mar 2024 13:56:12 +0100 Subject: [PATCH] update settings option for every gateway separately --- .../admin/class-wc-rest-payments-settings-controller.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/admin/class-wc-rest-payments-settings-controller.php b/includes/admin/class-wc-rest-payments-settings-controller.php index 55e56214142..94c34909162 100644 --- a/includes/admin/class-wc-rest-payments-settings-controller.php +++ b/includes/admin/class-wc-rest-payments-settings-controller.php @@ -630,7 +630,11 @@ function ( $payment_method ) use ( $available_payment_methods ) { } } - $this->wcpay_gateway->update_option( 'upe_enabled_payment_method_ids', $payment_method_ids_to_enable ); + foreach ( $payment_method_ids_to_enable as $payment_method_id ) { + $gateway = WC_Payments::get_payment_gateway_by_id( $payment_method_id ); + $gateway->update_option( 'upe_enabled_payment_method_ids', $payment_method_ids_to_enable ); + } + if ( $payment_method_ids_to_enable ) { $this->request_unrequested_payment_methods( $payment_method_ids_to_enable ); }