Add vault true when subscription in cart

This commit is contained in:
Emili Castells Guasch 2023-05-18 16:46:25 +02:00
parent e2d1f40de0
commit e173f39e3c

View file

@ -988,12 +988,13 @@ class SmartButton implements SmartButtonInterface {
$intent = 'capture';
}
$params = array(
$subscription_mode = $this->settings->has( 'subscriptions_mode' ) ? $this->settings->get( 'subscriptions_mode' ) : '';
$params = array(
'client-id' => $this->client_id,
'currency' => $this->currency,
'integration-date' => PAYPAL_INTEGRATION_DATE,
'components' => implode( ',', $this->components() ),
'vault' => $this->can_save_vault_token() ? 'true' : 'false',
'vault' => ( $this->can_save_vault_token() || $this->subscription_helper->need_subscription_intent( $subscription_mode ) ) ? 'true' : 'false',
'commit' => in_array( $context, $this->pay_now_contexts, true ) ? 'true' : 'false',
'intent' => $intent,
);