Skip to content

Commit

Permalink
Fix extensions.
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrosilva-pt committed Dec 19, 2023
1 parent 1444741 commit e540484
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@
$properties = PluginProperties::new( __FILE__ );
$bootstrap = Package::new( $properties );



foreach ($modules as $key => $module) {
if (
$module instanceof \WooCommerce\PayPalCommerce\AdminNotices\AdminNotices ||
$module instanceof \WooCommerce\PayPalCommerce\ApiClient\ApiModule ||
$module instanceof \WooCommerce\PayPalCommerce\Applepay\ApplepayModule ||
$module instanceof \WooCommerce\PayPalCommerce\Blocks\BlocksModule ||
$module instanceof \WooCommerce\PayPalCommerce\Button\ButtonModule
) {
$bootstrap->addModule( $module );
Expand Down
2 changes: 1 addition & 1 deletion modules/ppcp-applepay/extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


return array(
'wcgateway.settings.fields' => function ( ContainerInterface $container, array $fields ): array {
'wcgateway.settings.fields' => function ( array $fields, ContainerInterface $container ): array {

// Eligibility check.
if ( ! $container->has( 'applepay.eligible' ) || ! $container->get( 'applepay.eligible' ) ) {
Expand Down
10 changes: 5 additions & 5 deletions modules/ppcp-blocks/extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;

return array(
'wcgateway.button.locations' => function ( ContainerInterface $container, array $locations ): array {
'wcgateway.button.locations' => function ( array $locations, ContainerInterface $container ): array {
return array_merge(
$locations,
array(
Expand All @@ -22,13 +22,13 @@
)
);
},
'wcgateway.settings.pay-later.messaging-locations' => function ( ContainerInterface $container, array $locations ): array {
'wcgateway.settings.pay-later.messaging-locations' => function ( array $locations, ContainerInterface $container ): array {
unset( $locations['checkout-block-express'] );
unset( $locations['cart-block'] );
return $locations;
},

'wcgateway.settings.fields' => function ( ContainerInterface $container, array $fields ): array {
'wcgateway.settings.fields' => function ( array $fields, ContainerInterface $container ): array {
$insert_after = function( array $array, string $key, array $new ): array {
$keys = array_keys( $array );
$index = array_search( $key, $keys, true );
Expand Down Expand Up @@ -59,7 +59,7 @@
);
},

'button.pay-now-contexts' => function ( ContainerInterface $container, array $contexts ): array {
'button.pay-now-contexts' => function ( array $contexts, ContainerInterface $container ): array {
if ( ! $container->get( 'blocks.settings.final_review_enabled' ) ) {
$contexts[] = 'checkout-block';
$contexts[] = 'cart-block';
Expand All @@ -68,7 +68,7 @@
return $contexts;
},

'button.handle-shipping-in-paypal' => function ( ContainerInterface $container ): bool {
'button.handle-shipping-in-paypal' => function ( bool $previous, ContainerInterface $container ): bool {
return ! $container->get( 'blocks.settings.final_review_enabled' );
},
);

0 comments on commit e540484

Please sign in to comment.