Merge pull request #3103 from woocommerce/fix/payment-method-enabled-for-non-wc-gateway--items

Fix non wc gateway items null enabled key
This commit is contained in:
Emili Castells 2025-02-14 12:06:32 +01:00 committed by GitHub
commit ee45ca89ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -710,10 +710,10 @@ class PaymentRestEndpoint extends RestEndpoint {
if ( ! isset( $all_gateways[ $key ] ) && isset( $request_data[ $key ] ) ) {
switch ( $key ) {
case 'venmo':
$this->settings->set_venmo_enabled( $request_data[ $key ]['enabled'] );
$this->settings->set_venmo_enabled( $request_data[ $key ]['enabled'] ?? false );
break;
case 'pay-later':
$this->settings->set_paylater_enabled( $request_data[ $key ]['enabled'] );
$this->settings->set_paylater_enabled( $request_data[ $key ]['enabled'] ?? false );
break;
}