Pass the vault_enabled to JS

This commit is contained in:
Narek Zakarian 2024-05-17 00:07:13 +04:00
parent f966643681
commit 7a5e56eb4c
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7

View file

@ -1280,6 +1280,7 @@ document.querySelector("#payment").before(document.querySelector(".ppcp-messages
'is_logged' => is_user_logged_in(),
),
'should_handle_shipping_in_paypal' => $this->should_handle_shipping_in_paypal && ! $this->is_checkout(),
'vaultingEnabled' => $this->settings->has( 'vault_enabled' ) && $this->settings->get( 'vault_enabled' ),
);
if ( 'pay-now' === $this->context() ) {
@ -1360,7 +1361,7 @@ document.querySelector("#payment").before(document.querySelector(".ppcp-messages
'integration-date' => PAYPAL_INTEGRATION_DATE,
'components' => implode( ',', $this->components() ),
'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',
'commit' => 'false',
'intent' => $intent,
);