Conversation
12f0e5f to
0b896e7
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Address the stale Late Pledge state capture and preserve the Rewards Selection refresh guard.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
Enables gated Google Pay support in Stripe PaymentSheet across checkout and payment settings, with a non-production Stripe workaround.
Changes:
- Upgrades Stripe and adds Google Pay configuration.
- Adds feature gating and currency propagation across payment flows.
- Adds availability handling and unit tests.
| File | Summary |
|---|---|
app/src/test/java/com/kickstarter/viewmodels/PaymentMethodsViewModelTest.kt |
Tests Google Pay gate behavior. |
app/src/test/java/com/kickstarter/viewmodels/LatePledgeCheckoutViewModelTest.kt |
Tests gate behavior and currency propagation. |
app/src/test/java/com/kickstarter/viewmodels/CrowdfundCheckoutViewModelTest.kt |
Tests Google Pay gate behavior. |
app/src/test/java/com/kickstarter/libs/utils/extensions/ContextExtTest.kt |
Tests Google Pay configuration conditions. |
app/src/main/java/com/kickstarter/viewmodels/projectpage/RewardsSelectionViewModel.kt |
Changes project-data refresh behavior; the existing refresh guard should be restored or preserved. |
app/src/main/java/com/kickstarter/viewmodels/projectpage/LatePledgeCheckoutViewModel.kt |
Propagates project currency and evaluates the feature gate. |
app/src/main/java/com/kickstarter/viewmodels/projectpage/CrowdfundCheckoutViewModel.kt |
Adds Google Pay feature-gate support. |
app/src/main/java/com/kickstarter/viewmodels/PaymentMethodsViewModel.kt |
Adds Google Pay feature-gate output. |
app/src/main/java/com/kickstarter/utils/GooglePayAvailabilityUtil.kt |
Adds the non-production Stripe availability workaround. |
app/src/main/java/com/kickstarter/ui/fragments/CrowdfundCheckoutFragment.kt |
Configures gated Google Pay for crowdfund checkout. |
app/src/main/java/com/kickstarter/ui/activities/ProjectPageActivity.kt |
Configures Google Pay for late pledges; the collector may use stale currency state. |
app/src/main/java/com/kickstarter/ui/activities/PaymentMethodsSettingsActivity.kt |
Enables Google Pay in payment settings. |
app/src/main/java/com/kickstarter/libs/utils/extensions/ContextExt.kt |
Builds PaymentSheet Google Pay configuration. |
app/src/main/java/com/kickstarter/libs/featureflag/StatsigClient.kt |
Defines the Google Pay feature gate. |
app/src/main/java/com/kickstarter/KSApplication.kt |
Installs the environment-specific workaround. |
app/build.gradle |
Upgrades Stripe and adds the Wallet dependency. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| } | ||
|
|
||
| if (!refreshData) return | ||
| // if (!refreshData) return |
There was a problem hiding this comment.
Yes, this is technically a quick fix for the bug that nondeterministically prevents the rewards carousel from loading for Late Pledge Projects. I will create a separate PR for it at some point soon.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2565 +/- ##
============================================
- Coverage 65.12% 65.08% -0.05%
- Complexity 2582 2594 +12
============================================
Files 409 410 +1
Lines 32996 33031 +35
Branches 4709 4713 +4
============================================
+ Hits 21489 21498 +9
- Misses 9046 9063 +17
- Partials 2461 2470 +9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| * Provides the configuration for the PaymentSheet, following the specs | ||
| * @see [link](https://stripe.com/docs/payments/accept-a-payment?platform=android&ui=elements#android-flowcontroller) | ||
| * | ||
| * @param googlePayCurrencyCode The three-letter ISO 4217 alphabetic currency code, e.g. "USD" or "EUR". |
There was a problem hiding this comment.
Maybe worth mentioning here the googlePayCurrencyCode is the merchant's ( Kickstarter ), not the project, took a moment to realize why on getGooglePayConfiguration "US" was hardcoded as country code and same with getPaymentSheetConfiguration "USD"
There was a problem hiding this comment.
Great, I'll update the comments to add more clarification:
- The
countryCodeset in theGooglePayConfigurationobject is the country code of the business' (Kickstarter's) Stripe account, so that's hardcoded to"US". (Stripe docs, tech plan) - Noted in the PR details, the
currencyCodefor theGooglePayConfigurationObjectis required for Setup Intents and should be set to the Project's currency. Only in Payment Method Settings, where there is no Project, it was decided to hardcode the value to"USD". Luke's comment here provides more context. So that's where you're seeing an explicit call tothis.getPaymentSheetConfiguration(userEmail, googlePayEnabled, "USD")only inPaymentMethodSettingsActivity.flowControllerPresentPaymentOption(). On the other screens it's variable.
There was a problem hiding this comment.
Interestingly, in a follow up message to Stripe reps, they responded today suggesting the countryCode may also need to be variable based on the Project (if I'm understanding their reply correctly). So if we need to make countryCode variable for Crowdfund & Late Pledge checkouts, I anticipate doing so in a separate PR but following the same pattern.
Thank you for reviewing! 💰
No, we are not ok with it 😄 We have a separate in-progress ticket for this label specifically ([CHECK-553]) so we can use the full label, check localization, or decide to use something else like 'GPay' and translate ourselves. Also double-checking the usage in e.g. the extension function |


📲 What
23.20.0.GooglePayAvailabilityClientin non-production environments.🤔 Why
Google Pay presents an opportunity to increase pledge conversion on Android by enabling backers to pledge with cards already saved to their Google Wallet, eliminating the friction of manually entering card details.
This PR introduces Google Pay through the existing Stripe Payment Sheet integration within Crowdfund checkout, Late Pledge checkout, and Payment Method Settings.
A temporary override of
GooglePayAvailabilityClientis included as a workaround for and from Stripe Android issue #13968, which is preventing the Google Pay integration from working reliably in the Test environment.🛠 How
23.20.0.Context.getPaymentSheetConfiguration()with optional Google Pay enablement and currency parameters for backwards compatibility.Context.getGooglePayConfiguration()to build a nullablePaymentSheet.GooglePayConfigurationbased on a boolean flag, optional currency code and the environment:nullwhen the gate is disabled, the currency is missing or blank.webEndpointto set the Google PayTestorProductionEnvironment.isPaymentSheetGooglePayEnabled()containing the feature gate check into toPaymentMethodsViewModel,CrowdfundCheckoutViewModel, andLatePledgeCheckoutViewModel.configReady.USDas decided in the tech plan.LatePledgeCheckoutUIStateso it is available when Late Pledge configures PaymentSheet.GooglePayAvailabilityUtilto isolate the temporary Stripe availability override.existingPaymentMethodRequiredparameter from Google Pay readiness requests.KSApplication.initApplication()for non-production environments as determined byApiEndpoint, consistent with Dagger Stripe provider (ApplicationModule.provideStripe())👀 See
Crowdfund Checkout
Screen_recording_20260924_201210.mp4
📋 QA
Feature gate - not passing
Note
The sandbox feature gate is set to pass when 'App Version >= 3.43.0'. Confirm
internal_version_name<3.43.0. This is, of course, the default state of the branch.Prereqs:
Payment Method Settings
Late Pledge Checkout
Crowdfund Checkout
Feature gate - passing
Note
The sandbox feature gate is set to pass when 'App Version >= 3.43.0'. Set
internal_version_name>=3.43.0to pass the feature gate.Prereqs:
Payment Method Settings
Visa **4242,Visa **5556,Mastercard **4444, or any other card prefixed with a country code.Generic decline: Visa,Insufficient funds: Visa,Expired card: Visa, etc.Late Pledge Checkout
Visa **4242,Visa **5556,Mastercard **4444, or any other card prefixed with a country code.Generic decline: Visa,Insufficient funds: Visa,Expired card: Visa, etc.Crowdfund Checkout
Visa **4242,Visa **5556,Mastercard **4444, or any other card prefixed with a country code.Generic decline: Visa,Insufficient funds: Visa,Expired card: Visa, etc.Story 📖