Wire checkout session customerEmail into Google Pay PM billing details#13362
Merged
cttsai-stripe merged 5 commits intoJul 7, 2026
Merged
Conversation
When confirming a Google Pay payment in a checkout session, the backend requires billing_details.email on the payment method. Google Pay doesn't return an email unless isEmailRequired=true, which isn't set in the checkout session flow. This mirrors stripe-js's __billingDetailsEmailOverride pattern by injecting the checkout session's customerEmail into the PM creation params. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Committed-By-Agent: claude
Contributor
|
Diffuse output: APKDEX |
- Fix line length in EmbeddedConfirmationHelper - Fix import ordering in PaymentSheetViewModel - Add testCheckoutSessionWithFlowController to TestGooglePay Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Committed-By-Agent: claude
…mGooglePay - Remove GooglePayBillingEmailFactory; read email from configuration.defaultBillingDetails.email (already merged by CheckoutConfigurationMerger) - Move billingEmailOverride logic into PaymentMethodCreateParams.createFromGooglePay instead of post-hoc modification in the ViewModel - Add checkout session GPay test with FlowController and guest customer - Fix test flow: use launchCustom(clickMultiStep=false) + playgroundBuyButton Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Committed-By-Agent: claude
- Rename to billingEmailFallback since it's a fallback, not an override - Remove default value from @RestrictTo param (internal code omits defaults) - Rename test method to confirmGooglePayWithCheckoutSession with only the relevant params (merchant, customerEmail) - Hardcode FlowController + CheckoutSession + no auto tax inside the test method since it's specific to this scenario Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Committed-By-Agent: claude
amk-stripe
previously approved these changes
Jul 7, 2026
| cardBrandFilter = PaymentSheetCardBrandFilter(configuration.cardBrandAcceptance), | ||
| cardFundingFilter = cardFundingFilter, | ||
| displayItems = displayItems, | ||
| billingEmailFallback = configuration.defaultBillingDetails?.email, |
Collaborator
There was a problem hiding this comment.
There's also a customerEmail on the checkout session object -- is that always the same as this email? Or should we additionally fallback to that customerEmail value too?
Contributor
There was a problem hiding this comment.
+1, we need to ensure that if customerEmail is on the CS we try to use it if available. I'm guessing we merge it into the defaultBillingDetails tho?
Contributor
Author
There was a problem hiding this comment.
Right. I added tests to cover that.
530ed34 to
e473a6f
Compare
- createFromGooglePay uses billingEmailFallback when GPay has no email - createFromGooglePay prefers GPay email when present - toConfirmationOption wires customerEmail from merged config to billingEmailFallback on the Google Pay confirmation option Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Committed-By-Agent: claude
e473a6f to
093d43e
Compare
amk-stripe
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
go/o/req_BAWvlsMkOoCamA
Summary
payment_method.billing_details.email. Google Pay doesn't return an email by default (isEmailRequiredis false in the checkout flow), so the PM gets created without one and confirm fails withcheckout_email_missing.customerEmailfrom the merged configuration (defaultBillingDetails.email, populated byCheckoutConfigurationMergerfrom the checkout session response) and passes it as a fallback intoPaymentMethodCreateParams.createFromGooglePay().Changes
PaymentMethodCreateParams.createFromGooglePay(): newbillingEmailFallbackparam, used when Google Pay doesn't provide an emailGooglePayPaymentMethodLauncherContractV2.Args: newbillingEmailFallbackfield threaded through the launcherGooglePayConfirmationOption.Config: carries the fallback from the merged configConfirmationOptionKtx: readsconfiguration.defaultBillingDetails?.emailwhen constructing the GPay optionTestGooglePay: newtestCheckoutSessionWithFlowControllertest (requires real device)Test plan
testCheckoutSessionWithFlowControllerpasses on real device with Google Pay (checkout session, FlowController, guest customer, automatic tax disabled)MOBILESDK-4640
🤖 Generated with Claude Code