Show other payment methods if isn't eligible for WooPayments

If the current store is not eligible for WooPayments, we have to also show the other payment methods.
This commit is contained in:
Narek Zakarian 2025-03-26 17:27:21 +04:00
parent 8918e10bff
commit a9cc04dc35
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7

View file

@ -9,6 +9,7 @@ declare( strict_types = 1 );
namespace WooCommerce\PayPalCommerce\Settings\Data; namespace WooCommerce\PayPalCommerce\Settings\Data;
use Automattic\WooCommerce\Admin\Features\PaymentGatewaySuggestions\DefaultPaymentGateways;
use RuntimeException; use RuntimeException;
use WooCommerce\PayPalCommerce\Settings\DTO\MerchantConnectionDTO; use WooCommerce\PayPalCommerce\Settings\DTO\MerchantConnectionDTO;
use WooCommerce\PayPalCommerce\Settings\Enum\SellerTypeEnum; use WooCommerce\PayPalCommerce\Settings\Enum\SellerTypeEnum;
@ -306,6 +307,13 @@ class GeneralSettings extends AbstractDataModel {
* @return bool * @return bool
*/ */
public function own_brand_only() : bool { public function own_brand_only() : bool {
/**
* If the current store is not eligible for WooPayments, we have to also show the other payment methods.
*/
if ( ! in_array( $this->woo_settings['country'], DefaultPaymentGateways::get_wcpay_countries(), true ) ) {
return false;
}
// Temporary dev/test mode. // Temporary dev/test mode.
$simulate_cookie = sanitize_key( wp_unslash( $_COOKIE['simulate-branded-only'] ?? '' ) ); $simulate_cookie = sanitize_key( wp_unslash( $_COOKIE['simulate-branded-only'] ?? '' ) );