Skip to content

Commit 449a9cd

Browse files
committed
Simplify code
1 parent b9f6919 commit 449a9cd

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

includes/payment-methods/class-upe-payment-method.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ public function is_enabled_at_checkout( string $account_country, bool $skip_limi
207207
}
208208

209209
// Reusable methods are always available for subscriptions. Other methods are available if manual renewal is allowed.
210-
$is_available_for_subscription = $this->are_manual_renewals_accepted() || $this->is_reusable();
210+
$are_manual_renewals_accepted = function_exists( 'wcs_is_manual_renewal_enabled' ) && wcs_is_manual_renewal_enabled();
211+
$is_available_for_subscription = $are_manual_renewals_accepted || $this->is_reusable();
211212

212213
$order_is_within_currency_limits = true;
213214
// This part ensures that when payment limits for the currency declared, those will be respected (e.g. BNPLs).
@@ -492,13 +493,4 @@ private function get_currency( $order_id = null ) {
492493
}
493494
return get_woocommerce_currency();
494495
}
495-
496-
/**
497-
* Check if manual renewals are accepted in WooCommerce Subscriptions settings.
498-
*
499-
* @return bool True if manual renewals are accepted in settings.
500-
*/
501-
private function are_manual_renewals_accepted() {
502-
return function_exists( 'wcs_is_manual_renewal_enabled' ) && wcs_is_manual_renewal_enabled();
503-
}
504496
}

0 commit comments

Comments
 (0)