Skip to content

Commit

Permalink
Add support for Venmo button with vault v3
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrosilva-pt committed Jan 15, 2024
1 parent af577c1 commit 751edc8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/ppcp-button/src/Assets/SmartButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -1253,6 +1253,16 @@ private function url_params(): array {
'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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,13 @@ static function () use ( $c ) {
$endpoint->handle_request();
}
);

add_filter(
'woocommerce_paypal_payments_save_payment_methods_eligible',
function() {
return true;
}
);
}

/**
Expand Down

0 comments on commit 751edc8

Please sign in to comment.