Add subscriptions api feature flag (WIP)

This commit is contained in:
Emili Castells Guasch 2023-05-15 16:18:11 +02:00
parent 435a081cb8
commit e5fb9b0b9d
3 changed files with 16 additions and 1 deletions

View file

@ -106,6 +106,7 @@ return array(
'button.intent' => static function( ContainerInterface $container ): string {
$settings = $container->get( 'wcgateway.settings' );
$subscription_helper = $container->get( 'subscription.helper' );
assert( $subscription_helper instanceof SubscriptionHelper );
$context = $container->get( 'button.context' );
$intent = ( $settings->has( 'intent' ) ) ? $settings->get( 'intent' ) : 'capture';
@ -113,7 +114,7 @@ return array(
$other_context_intent = $subscription_helper->cart_contains_subscription() ? 'authorize' : $intent;
$subscription_mode = $settings->has( 'subscriptions_mode' ) ? $settings->get( 'subscriptions_mode' ) : '';
if($subscription_helper->need_subscription_intent($subscription_mode)) {
if ( $subscription_helper->need_subscription_intent( $subscription_mode ) ) {
return 'subscription';
}