mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +08:00
Merge branch 'trunk' into PCP-4352-disabled-payment-methods-not-hidden-pre-onboarding-in-reactified-payments-tab
This commit is contained in:
commit
9d8471a889
2 changed files with 48 additions and 2 deletions
|
@ -10,7 +10,18 @@ declare( strict_types = 1 );
|
|||
namespace WooCommerce\PayPalCommerce\Settings;
|
||||
|
||||
use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache;
|
||||
use WooCommerce\PayPalCommerce\Applepay\ApplePayGateway;
|
||||
use WooCommerce\PayPalCommerce\Axo\Gateway\AxoGateway;
|
||||
use WooCommerce\PayPalCommerce\Button\Helper\MessagesApply;
|
||||
use WooCommerce\PayPalCommerce\Googlepay\GooglePayGateway;
|
||||
use WooCommerce\PayPalCommerce\LocalAlternativePaymentMethods\BancontactGateway;
|
||||
use WooCommerce\PayPalCommerce\LocalAlternativePaymentMethods\BlikGateway;
|
||||
use WooCommerce\PayPalCommerce\LocalAlternativePaymentMethods\EPSGateway;
|
||||
use WooCommerce\PayPalCommerce\LocalAlternativePaymentMethods\IDealGateway;
|
||||
use WooCommerce\PayPalCommerce\LocalAlternativePaymentMethods\MultibancoGateway;
|
||||
use WooCommerce\PayPalCommerce\LocalAlternativePaymentMethods\MyBankGateway;
|
||||
use WooCommerce\PayPalCommerce\LocalAlternativePaymentMethods\P24Gateway;
|
||||
use WooCommerce\PayPalCommerce\LocalAlternativePaymentMethods\TrustlyGateway;
|
||||
use WooCommerce\PayPalCommerce\Settings\Ajax\SwitchSettingsUiEndpoint;
|
||||
use WooCommerce\PayPalCommerce\Settings\Data\Definition\FeaturesDefinition;
|
||||
use WooCommerce\PayPalCommerce\Settings\Data\Definition\PaymentMethodsDependenciesDefinition;
|
||||
|
@ -46,6 +57,11 @@ use WooCommerce\PayPalCommerce\Settings\Service\DataSanitizer;
|
|||
use WooCommerce\PayPalCommerce\Settings\Service\SettingsDataManager;
|
||||
use WooCommerce\PayPalCommerce\Settings\Data\Definition\PaymentMethodsDefinition;
|
||||
use WooCommerce\PayPalCommerce\PayLaterConfigurator\Factory\ConfigFactory;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Gateway\CardButtonGateway;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Gateway\CreditCardGateway;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Gateway\OXXO\OXXO;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayUponInvoice\PayUponInvoiceGateway;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
|
||||
use WooCommerce\PayPalCommerce\PayLaterConfigurator\Endpoint\SaveConfig;
|
||||
use WooCommerce\PayPalCommerce\WcGateway\Helper\Environment;
|
||||
|
@ -570,4 +586,29 @@ return array(
|
|||
'settings.service.gateway-redirect' => static function (): GatewayRedirectService {
|
||||
return new GatewayRedirectService();
|
||||
},
|
||||
/**
|
||||
* Returns a list of all payment gateway IDs created by this plugin.
|
||||
*
|
||||
* @returns string[] The list of all gateway IDs.
|
||||
*/
|
||||
'settings.config.all-gateway-ids' => static function (): array {
|
||||
return array(
|
||||
PayPalGateway::ID,
|
||||
CardButtonGateway::ID,
|
||||
CreditCardGateway::ID,
|
||||
AxoGateway::ID,
|
||||
ApplePayGateway::ID,
|
||||
GooglePayGateway::ID,
|
||||
BancontactGateway::ID,
|
||||
BlikGateway::ID,
|
||||
EPSGateway::ID,
|
||||
IDealGateway::ID,
|
||||
MyBankGateway::ID,
|
||||
P24Gateway::ID,
|
||||
TrustlyGateway::ID,
|
||||
MultibancoGateway::ID,
|
||||
PayUponInvoiceGateway::ID,
|
||||
OXXO::ID,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
|
|
@ -23,6 +23,7 @@ use WooCommerce\PayPalCommerce\LocalAlternativePaymentMethods\MyBankGateway;
|
|||
use WooCommerce\PayPalCommerce\LocalAlternativePaymentMethods\P24Gateway;
|
||||
use WooCommerce\PayPalCommerce\LocalAlternativePaymentMethods\TrustlyGateway;
|
||||
use WooCommerce\PayPalCommerce\Settings\Ajax\SwitchSettingsUiEndpoint;
|
||||
use WooCommerce\PayPalCommerce\Settings\Data\Definition\PaymentMethodsDefinition;
|
||||
use WooCommerce\PayPalCommerce\Settings\Data\OnboardingProfile;
|
||||
use WooCommerce\PayPalCommerce\Settings\Data\TodosModel;
|
||||
use WooCommerce\PayPalCommerce\Settings\Endpoint\RestEndpoint;
|
||||
|
@ -453,12 +454,16 @@ class SettingsModule implements ServiceModule, ExecutableModule {
|
|||
}
|
||||
|
||||
$is_payments_page = $container->get( 'wcgateway.is-wc-payments-page' );
|
||||
$all_gateway_ids = $container->get( 'settings.config.all-gateway-ids' );
|
||||
|
||||
if ( $is_payments_page ) {
|
||||
$methods = array_filter(
|
||||
$methods,
|
||||
function ( $method ): bool {
|
||||
if ( ! is_object( $method ) || $method->id === PayPalGateway::ID ) {
|
||||
function ( $method ) use ( $all_gateway_ids ): bool {
|
||||
if ( ! is_object( $method )
|
||||
|| $method->id === PayPalGateway::ID
|
||||
|| ! in_array( $method->id, $all_gateway_ids, true )
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue