mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
announce subscription support in gateway and force checkout deactivation if no support
This commit is contained in:
parent
40b3e12057
commit
68fe89af4b
6 changed files with 44 additions and 13 deletions
|
@ -28,18 +28,23 @@ return [
|
|||
$notice = $container->get('wcgateway.notice.authorize-order-action');
|
||||
$settings = $container->get('wcgateway.settings');
|
||||
|
||||
$smartButton = $container->get('button.smart-button');
|
||||
$supportsSubscription = $smartButton->canSaveVaultToken();
|
||||
return new WcGateway(
|
||||
$settingsRenderer,
|
||||
$orderProcessor,
|
||||
$authorizedPayments,
|
||||
$notice,
|
||||
$settings
|
||||
$settings,
|
||||
$supportsSubscription
|
||||
);
|
||||
},
|
||||
'wcgateway.disabler' => static function (ContainerInterface $container): DisableGateways {
|
||||
$sessionHandler = $container->get('session.handler');
|
||||
$settings = $container->get('wcgateway.settings');
|
||||
return new DisableGateways($sessionHandler, $settings);
|
||||
$smartButton = $container->get('button.smart-button');
|
||||
$subscriptionDisable = ! $smartButton->canSaveVaultToken() && $smartButton->hasSubscription();
|
||||
return new DisableGateways($sessionHandler, $settings, $subscriptionDisable);
|
||||
},
|
||||
'wcgateway.settings' => static function (ContainerInterface $container): Settings {
|
||||
return new Settings();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue