mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
♻️ Deprecate old config-services
This commit is contained in:
parent
c310151f1f
commit
236188af34
5 changed files with 15 additions and 17 deletions
|
@ -23,11 +23,11 @@ use WooCommerce\PayPalCommerce\WcGateway\Helper\Environment;
|
|||
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
||||
|
||||
return array(
|
||||
// @deprecated - use `applepay.eligibility.check` instead.
|
||||
'applepay.eligible' => static function ( ContainerInterface $container ): bool {
|
||||
$apm_applies = $container->get( 'applepay.helpers.apm-applies' );
|
||||
assert( $apm_applies instanceof ApmApplies );
|
||||
$eligibility_check = $container->get( 'applepay.eligibility.check' );
|
||||
|
||||
return $apm_applies->for_country() && $apm_applies->for_currency() && $apm_applies->for_merchant();
|
||||
return $eligibility_check();
|
||||
},
|
||||
'applepay.eligibility.check' => static function ( ContainerInterface $container ): callable {
|
||||
$apm_applies = $container->get( 'applepay.helpers.apm-applies' );
|
||||
|
|
|
@ -22,12 +22,11 @@ use WooCommerce\PayPalCommerce\ApiClient\Helper\CurrencyGetter;
|
|||
|
||||
return array(
|
||||
|
||||
// If AXO can be configured.
|
||||
// @deprecated - use `axo.eligibility.check` instead.
|
||||
'axo.eligible' => static function ( ContainerInterface $container ): bool {
|
||||
$apm_applies = $container->get( 'axo.helpers.apm-applies' );
|
||||
assert( $apm_applies instanceof ApmApplies );
|
||||
$eligibility_check = $container->get( 'axo.eligibility.check' );
|
||||
|
||||
return $apm_applies->for_country_currency() && $apm_applies->for_merchant();
|
||||
return $eligibility_check();
|
||||
},
|
||||
'axo.eligibility.check' => static function ( ContainerInterface $container ): callable {
|
||||
$apm_applies = $container->get( 'axo.helpers.apm-applies' );
|
||||
|
|
|
@ -13,11 +13,11 @@ use WooCommerce\PayPalCommerce\CardFields\Helper\CardFieldsApplies;
|
|||
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
||||
|
||||
return array(
|
||||
// @deprecated - use `card-fields.eligibility.check` instead.
|
||||
'card-fields.eligible' => static function ( ContainerInterface $container ): bool {
|
||||
$save_payment_methods_applies = $container->get( 'card-fields.helpers.save-payment-methods-applies' );
|
||||
assert( $save_payment_methods_applies instanceof CardFieldsApplies );
|
||||
$eligibility_check = $container->get( 'card-fields.eligibility.check' );
|
||||
|
||||
return $save_payment_methods_applies->for_country() && $save_payment_methods_applies->for_merchant();
|
||||
return $eligibility_check();
|
||||
},
|
||||
'card-fields.eligibility.check' => static function ( ContainerInterface $container ): callable {
|
||||
$save_payment_methods_applies = $container->get( 'card-fields.helpers.save-payment-methods-applies' );
|
||||
|
|
|
@ -23,12 +23,11 @@ use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
|||
|
||||
return array(
|
||||
|
||||
// If GooglePay can be configured.
|
||||
// @deprecated - use `googlepay.eligibility.check` instead.
|
||||
'googlepay.eligible' => static function ( ContainerInterface $container ): bool {
|
||||
$apm_applies = $container->get( 'googlepay.helpers.apm-applies' );
|
||||
assert( $apm_applies instanceof ApmApplies );
|
||||
$eligibility_check = $container->get( 'googlepay.eligibility.check' );
|
||||
|
||||
return $apm_applies->for_country() && $apm_applies->for_currency() && $apm_applies->for_merchant();
|
||||
return $eligibility_check();
|
||||
},
|
||||
'googlepay.eligibility.check' => static function ( ContainerInterface $container ): callable {
|
||||
$apm_applies = $container->get( 'googlepay.helpers.apm-applies' );
|
||||
|
|
|
@ -16,11 +16,11 @@ use WooCommerce\PayPalCommerce\SavePaymentMethods\Helper\SavePaymentMethodsAppli
|
|||
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
||||
|
||||
return array(
|
||||
// @deprecated - use `save-payment-methods.eligibility.check` instead.
|
||||
'save-payment-methods.eligible' => static function ( ContainerInterface $container ): bool {
|
||||
$save_payment_methods_applies = $container->get( 'save-payment-methods.helpers.save-payment-methods-applies' );
|
||||
assert( $save_payment_methods_applies instanceof SavePaymentMethodsApplies );
|
||||
$eligibility_check = $container->get( 'save-payment-methods.eligibility.check' );
|
||||
|
||||
return $save_payment_methods_applies->for_country() && $save_payment_methods_applies->for_merchant();
|
||||
return $eligibility_check();
|
||||
},
|
||||
'save-payment-methods.eligibility.check' => static function ( ContainerInterface $container ): callable {
|
||||
$save_payment_methods_applies = $container->get( 'save-payment-methods.helpers.save-payment-methods-applies' );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue