Skip to content
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

[Experimental] Add PaymentConfirmationMediator & PaymentConfirmationRegistry #9335

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

samer-stripe
Copy link
Collaborator

Summary

Add PaymentConfirmationMediator & PaymentConfirmationRegistry

Motivation

Helps move all the ConfirmationOption and Launcher abstractions into a mediator to manage the definitions.

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

PaymentConfirmationMediator(savedStateHandle, definition)
}
}
}
Copy link
Collaborator Author

@samer-stripe samer-stripe Sep 25, 2024

Choose a reason for hiding this comment

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

I was initially thinking of adding different list for pre-confirmation definitions, but I think that limits definitions to 0-1 pre-confirmation definition and 1 end-confirmation definition. I wonder if we should update the PaymentConfirmationDefinition interface to indicate if it is the end state of confirmation or moving the confirmation state forward (Google Pay has provided a payment method, move to the next found definition)

Copy link
Collaborator Author

@samer-stripe samer-stripe Sep 25, 2024

Choose a reason for hiding this comment

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

We would have to ensure though that the list is ordered correctly for each implementation through tests

Copy link
Collaborator Author

@samer-stripe samer-stripe Sep 25, 2024

Choose a reason for hiding this comment

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

Example:

val registry = PaymentConfirmationRegistry(
    definitions = listOf(
        GooglePayConfirmationDefinition, // Not an end state definition
        BacsConfirmationDefinition, // Not an end state definition
        SepaMandateConfirmationDefinition, // Not an end state definition
        CvcRecollectionConfirmationDefinition, // Not an end state definition
        LinkConfirmationDefinition, // Not an end state definition
        ExternalPaymentMethodsConfirmationDefinition, // An end state definition
        IntentConfirmationDefinition, // An end state definition
    )
)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Plus side is we can have 1-to-many confirmation definitions

Copy link
Contributor

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 │   1.9 MiB │   1.9 MiB │  0 B │     4 MiB │     4 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 │ 301.5 KiB │ 301.5 KiB │  0 B │   455 KiB │   455 KiB │  0 B 
   native │   6.2 MiB │   6.2 MiB │  0 B │  15.8 MiB │  15.8 MiB │  0 B 
    asset │   6.8 KiB │   6.8 KiB │  0 B │   6.5 KiB │   6.5 KiB │  0 B 
    other │  85.5 KiB │  85.5 KiB │ +8 B │ 158.7 KiB │ 158.7 KiB │  0 B 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
    total │   9.5 MiB │   9.5 MiB │ +8 B │  21.4 MiB │  21.4 MiB │  0 B 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 20244 │ 20244 │ 0 (+0 -0) 
   types │  6082 │  6082 │ 0 (+0 -0) 
 classes │  4886 │  4886 │ 0 (+0 -0) 
 methods │ 29462 │ 29462 │ 0 (+0 -0) 
  fields │ 17389 │ 17389 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  164 │  164 │  0   
 entries │ 3608 │ 3608 │  0
APK
    compressed    │  uncompressed   │                     
──────────┬───────┼──────────┬──────┤                     
 size     │ diff  │ size     │ diff │ path                
──────────┼───────┼──────────┼──────┼─────────────────────
 28.3 KiB │ +10 B │ 62.6 KiB │  0 B │ ∆ META-INF/CERT.SF  
  1.2 KiB │  -2 B │  1.2 KiB │  0 B │ ∆ META-INF/CERT.RSA 
──────────┼───────┼──────────┼──────┼─────────────────────
 29.5 KiB │  +8 B │ 63.8 KiB │  0 B │ (total)

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.

1 participant