Skip to content

Vault via Orders API for redirect gateway in Blocks Checkout (3796)#4131

Merged
Dinamiko merged 10 commits intodev/developfrom
poc/vault-component
Mar 5, 2026
Merged

Vault via Orders API for redirect gateway in Blocks Checkout (3796)#4131
Dinamiko merged 10 commits intodev/developfrom
poc/vault-component

Conversation

@Dinamiko
Copy link
Collaborator

@Dinamiko Dinamiko commented Mar 2, 2026

This PR extends PayPal vaulting support to the "Proceed to PayPal" button in blocks checkout.

Previously, saving payment methods only worked through the Express PayPal button. The redirect flow triggered by "Proceed to PayPal" never injected vault attributes because OrderProcessor::create_order() passed empty values to the Orders API. This change forwards the correct payment method and funding source, enabling SavePaymentMethodsModule to activate during the redirect flow.

Additionally, customers can now pay with a previously saved PayPal token directly from the "Proceed to PayPal" button.

@Dinamiko Dinamiko changed the base branch from dev/develop to dev/PCP-5413-remove-legacy-ui March 2, 2026 12:01
Copy link
Collaborator

@Narek13 Narek13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for working on this. Added some suggestions and doubts.

Base automatically changed from dev/PCP-5413-remove-legacy-ui to dev/develop March 2, 2026 15:33
@Dinamiko Dinamiko requested a review from Narek13 March 5, 2026 15:18
if ( $response instanceof WP_Error ) {
throw new RuntimeException( $response->get_error_message() );
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, do we also want to check the status code here? like is done in orderEndpoint for example?

$status_code = (int) wp_remote_retrieve_response_code( $response );
if ( 200 !== $status_code ) {
	throw new PayPalApiException( $json, $status_code );
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, thanks!

Copy link
Collaborator

@Narek13 Narek13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making all the chnages. Left 1 more doubt. Everything else looks good to me.

@Dinamiko Dinamiko merged commit b79eed7 into dev/develop Mar 5, 2026
11 checks passed
@Dinamiko Dinamiko deleted the poc/vault-component branch March 5, 2026 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants