Blocks API: get billing details from order if not in request #3778
+85
−18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3777
Changes proposed in this Pull Request:
With express checkout's shift to Blocks API for processing the order, the billing details required for Stripe customer creation logic is no longer present in the request (
POST
) data.This PR adds logic to retrieve the billing data from the order object, if it is available.
Testing instructions
develop
, you will see aUndefined index: name
PHP notice in your logs.develop
, the customer's name isName: , Guest
(missing name) and the billing details are also missing.Card Holder Name
if using Google Pay test account. Verify inside the customer's page that their billing details are complete.develop
, another nameless customer with no billing details gets created in Stripe.Note: I wanted to add some unit tests, but the testable methods involve calls to Stripe API. I'm somewhat hesitant to add code to enable us to inject an API library, but LMK if you feel strongly one way or another.
changelog.txt
andreadme.txt
(or does not apply)Post merge