Merge branch 'trunk' into PCP-2049-place-order-redirect

This commit is contained in:
Alex P 2023-11-23 10:06:10 +02:00
commit ad715bcfb6
No known key found for this signature in database
GPG key ID: 54487A734A204D71
47 changed files with 1591 additions and 553 deletions

View file

@ -186,6 +186,11 @@ return array(
);
},
'wcgateway.is-ppcp-settings-standard-payments-page' => static function ( ContainerInterface $container ): bool {
return $container->get( 'wcgateway.is-ppcp-settings-page' )
&& $container->get( 'wcgateway.current-ppcp-settings-page-id' ) === PayPalGateway::ID;
},
'wcgateway.current-ppcp-settings-page-id' => static function ( ContainerInterface $container ): string {
if ( ! $container->get( 'wcgateway.is-ppcp-settings-page' ) ) {
return '';
@ -208,7 +213,9 @@ return array(
static function ( ContainerInterface $container ): Settings {
return new Settings(
$container->get( 'wcgateway.button.default-locations' ),
$container->get( 'wcgateway.settings.dcc-gateway-title.default' )
$container->get( 'wcgateway.settings.dcc-gateway-title.default' ),
$container->get( 'wcgateway.settings.pay-later.default-button-locations' ),
$container->get( 'wcgateway.settings.pay-later.default-messaging-locations' )
);
}
),
@ -1381,6 +1388,11 @@ return array(
'mini-cart' => 'Mini Cart',
);
},
'wcgateway.button.default-locations' => static function( ContainerInterface $container ): array {
$button_locations = $container->get( 'wcgateway.button.locations' );
unset( $button_locations['mini-cart'] );
return array_keys( $button_locations );
},
'wcgateway.settings.pay-later.messaging-locations' => static function( ContainerInterface $container ): array {
$button_locations = $container->get( 'wcgateway.button.locations' );
unset( $button_locations['mini-cart'] );
@ -1392,7 +1404,7 @@ return array(
)
);
},
'wcgateway.button.default-locations' => static function( ContainerInterface $container ): array {
'wcgateway.settings.pay-later.default-messaging-locations' => static function( ContainerInterface $container ): array {
return array_keys( $container->get( 'wcgateway.settings.pay-later.messaging-locations' ) );
},
'wcgateway.settings.pay-later.button-locations' => static function( ContainerInterface $container ): array {
@ -1405,6 +1417,9 @@ return array(
return array_intersect_key( $button_locations, array_flip( $smart_button_selected_locations ) );
},
'wcgateway.settings.pay-later.default-button-locations' => static function( ContainerInterface $container ): array {
return $container->get( 'wcgateway.button.default-locations' );
},
'wcgateway.ppcp-gateways' => static function ( ContainerInterface $container ): array {
return array(
PayPalGateway::ID,