Refactor GooglePay availability notices.

This commit is contained in:
Pedro Silva 2023-09-22 08:53:35 +01:00
parent dc77deea79
commit b16e2571b1
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
3 changed files with 132 additions and 61 deletions

View file

@ -16,6 +16,7 @@ use WooCommerce\PayPalCommerce\Googlepay\Assets\BlocksPaymentMethod;
use WooCommerce\PayPalCommerce\Googlepay\Assets\Button;
use WooCommerce\PayPalCommerce\Googlepay\Helper\ApmApplies;
use WooCommerce\PayPalCommerce\Googlepay\Helper\ApmProductStatus;
use WooCommerce\PayPalCommerce\Googlepay\Helper\AvailabilityNotice;
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
return array(
@ -49,6 +50,12 @@ return array(
return true;
},
'googlepay.availability_notice' => static function ( ContainerInterface $container ): AvailabilityNotice {
return new AvailabilityNotice(
$container->get( 'googlepay.helpers.apm-product-status' )
);
},
'googlepay.helpers.apm-product-status' => SingletonDecorator::make(
static function( ContainerInterface $container ): ApmProductStatus {
return new ApmProductStatus(