mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Add subscriptions api feature flag (WIP)
This commit is contained in:
parent
435a081cb8
commit
e5fb9b0b9d
3 changed files with 16 additions and 1 deletions
|
@ -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';
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue