这是indexloc提供的服务,不要输入任何密码
Skip to content

Add OnrampActivity to test OnrampCoordinator functionality #11157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 18, 2025

Conversation

carlosmuvi-stripe
Copy link
Collaborator

@carlosmuvi-stripe carlosmuvi-stripe commented Jul 18, 2025

Summary

Added OnrampActivity to paymentsheet-example to test OnrampCoordinator functionality as we progress on the implementation.

onramp.webm

Testing

  • Manually verified
  • Fixed ktlint and detekt issues
  • Updated API dump for @RestrictTo changes

Screenshots

Before After
No onramp testing interface OnrampActivity with complete user flow testing

- Created OnrampActivity with ViewModel-based state management
- Supports email lookup, registration, and authentication flows
- Added dedicated 'Onramp' section to MainActivity at bottom
- Implemented memory-safe architecture without leaks
- Added @RestrictTo annotations for library group access
- Loading state waits for configuration completion
- Split large RegistrationScreen function into smaller components
- Added @Suppress for TooGenericExceptionCaught in callback error handling
- Fixed trailing spaces and unnecessary blank lines
Copy link
Contributor

Risky Change

This is considered a risky change because it adjusts the sample app build.gradle, please review carefully.
We've seen issues in the past which resulted in failed builds for merchants. Please make sure the build.gradle change is intended.

By adding the label accept-risky-change to this PR, I acknowledge that I'm changing an example app and have verified that the SDK remains in a shippable state.

@carlosmuvi-stripe carlosmuvi-stripe added the accept-risky-change accept-risky-change label Jul 18, 2025
Copy link
Contributor

github-actions bot commented Jul 18, 2025

Diffuse output:

OLD: identity-example-release-base.apk (signature: V1, V2)
NEW: identity-example-release-pr.apk (signature: V1, V2)

          │          compressed          │         uncompressed         
          ├───────────┬───────────┬──────┼───────────┬───────────┬──────
 APK      │ old       │ new       │ diff │ old       │ new       │ diff 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
      dex │   2.1 MiB │   2.1 MiB │  0 B │   4.3 MiB │   4.3 MiB │  0 B 
     arsc │     1 MiB │     1 MiB │  0 B │     1 MiB │     1 MiB │  0 B 
 manifest │   2.3 KiB │   2.3 KiB │  0 B │     8 KiB │     8 KiB │  0 B 
      res │ 302.9 KiB │ 302.9 KiB │  0 B │   457 KiB │   457 KiB │  0 B 
   native │   6.2 MiB │   6.2 MiB │  0 B │  15.8 MiB │  15.8 MiB │  0 B 
    asset │   7.7 KiB │   7.7 KiB │  0 B │   7.4 KiB │   7.4 KiB │  0 B 
    other │  95.8 KiB │  95.8 KiB │ +4 B │ 183.5 KiB │ 183.5 KiB │  0 B 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
    total │   9.8 MiB │   9.8 MiB │ +4 B │  21.8 MiB │  21.8 MiB │  0 B 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 20688 │ 20688 │ 0 (+0 -0) 
   types │  6507 │  6507 │ 0 (+0 -0) 
 classes │  5270 │  5270 │ 0 (+0 -0) 
 methods │ 31521 │ 31521 │ 0 (+0 -0) 
  fields │ 18243 │ 18243 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  164 │  164 │  0   
 entries │ 3646 │ 3646 │  0
APK
   compressed    │   uncompressed   │                                           
──────────┬──────┼───────────┬──────┤                                           
 size     │ diff │ size      │ diff │ path                                      
──────────┼──────┼───────────┼──────┼───────────────────────────────────────────
 29.2 KiB │ +3 B │  64.6 KiB │  0 B │ ∆ META-INF/CERT.SF                        
    270 B │ -2 B │     120 B │  0 B │ ∆ META-INF/version-control-info.textproto 
  1.2 KiB │ +2 B │   1.2 KiB │  0 B │ ∆ META-INF/CERT.RSA                       
 25.9 KiB │ +1 B │  64.5 KiB │  0 B │ ∆ META-INF/MANIFEST.MF                    
──────────┼──────┼───────────┼──────┼───────────────────────────────────────────
 56.5 KiB │ +4 B │ 130.5 KiB │  0 B │ (total)

@carlosmuvi-stripe carlosmuvi-stripe force-pushed the carlosmuvi/onramp-example-activity branch from 32eff92 to 202ac99 Compare July 18, 2025 02:49
@@ -25,7 +26,8 @@ import javax.inject.Inject
* @param onrampCallbacks Callback structure that manages the results of asynchronous requests
* made by the coordinator.
*/
internal class OnrampCoordinator @Inject internal constructor(
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

so that we can test it on the example app

@carlosmuvi-stripe carlosmuvi-stripe requested a review from Twigz July 18, 2025 02:50
- OnrampCoordinator, OnrampConfiguration, OnrampCallbacks now library-group restricted
- Updated API declarations to reflect new internal access scope
@@ -25,7 +25,7 @@ internal class LinkControllerCoordinator @Inject constructor(
val linkActivityResultLauncher: ActivityResultLauncher<LinkActivityContract.Args>

init {
check(lifecycleOwner.lifecycle.currentState.isAtLeast(Lifecycle.State.CREATED))
check(lifecycleOwner.lifecycle.currentState.isAtLeast(Lifecycle.State.INITIALIZED))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Relaxed this so that we can build the LinkController (and register the activity launchers) before the activity is fully created. (The on ramp activity was crashing when initializing in onCreate).

CC @lng-stripe

@carlosmuvi-stripe carlosmuvi-stripe force-pushed the carlosmuvi/onramp-example-activity branch from 202ac99 to 3246234 Compare July 18, 2025 06:46
@carlosmuvi-stripe carlosmuvi-stripe marked this pull request as ready for review July 18, 2025 16:23
@carlosmuvi-stripe carlosmuvi-stripe requested review from a team as code owners July 18, 2025 16:23
@carlosmuvi-stripe carlosmuvi-stripe requested review from cttsai-stripe and lng-stripe and removed request for cttsai-stripe July 18, 2025 16:23
Copy link
Contributor

@lng-stripe lng-stripe left a comment

Choose a reason for hiding this comment

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

Good start 👍

@carlosmuvi-stripe carlosmuvi-stripe merged commit 3c94f67 into master Jul 18, 2025
15 checks passed
@carlosmuvi-stripe carlosmuvi-stripe deleted the carlosmuvi/onramp-example-activity branch July 18, 2025 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accept-risky-change accept-risky-change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants