Add support for Venmo button with vault v3

This commit is contained in:
Pedro Silva 2024-01-15 16:55:36 +00:00
parent af577c130f
commit 751edc8353
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
2 changed files with 17 additions and 0 deletions

View file

@ -1253,6 +1253,16 @@ document.querySelector("#payment").before(document.querySelector("#ppcp-messages
'commit' => in_array( $context, $this->pay_now_contexts, true ) ? 'true' : 'false',
'intent' => $intent,
);
if (
$this->settings->has( 'subscriptions_mode' )
&& $this->settings->get( 'subscriptions_mode' ) === 'vaulting_api'
&& apply_filters( 'woocommerce_paypal_payments_save_payment_methods_eligible', false )
) {
// Remove vault parameter to allow for Venmo with Save Payment Methods (Vault V3).
unset( $params['vault'] );
}
if (
$this->environment->current_environment_is( Environment::SANDBOX )
&& defined( 'WP_DEBUG' ) && \WP_DEBUG

View file

@ -329,6 +329,13 @@ class SavePaymentMethodsModule implements ModuleInterface {
$endpoint->handle_request();
}
);
add_filter(
'woocommerce_paypal_payments_save_payment_methods_eligible',
function() {
return true;
}
);
}
/**