From e173f39e3cae274a464acf92c7c4e620b76b76c3 Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Thu, 18 May 2023 16:46:25 +0200 Subject: [PATCH] Add vault true when subscription in cart --- modules/ppcp-button/src/Assets/SmartButton.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/ppcp-button/src/Assets/SmartButton.php b/modules/ppcp-button/src/Assets/SmartButton.php index 1b11c5970..7f07c332a 100644 --- a/modules/ppcp-button/src/Assets/SmartButton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -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, );