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

Select payment method when it is set as the default PM #10257

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

amk-stripe
Copy link
Collaborator

Summary

Select payment method when it is set as the default PM

Motivation

Updating behavior to match designs from figma

Testing

  • Added tests
  • Modified tests
  • Manually verified

Manually verified in horizontal mode, vertical mode, embedded. I can add end to end tests for horizontal + embedded as a follow up!

Screen recording

setting.default.updates.selection.webm

Copy link
Contributor

github-actions bot commented Feb 21, 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 MiB │     2 MiB │  0 B │   4.1 MiB │   4.1 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.6 KiB │ 302.6 KiB │  0 B │ 456.7 KiB │ 456.7 KiB │  0 B 
   native │   6.2 MiB │   6.2 MiB │  0 B │  15.8 MiB │  15.8 MiB │  0 B 
    asset │   7.3 KiB │   7.3 KiB │  0 B │   7.1 KiB │   7.1 KiB │  0 B 
    other │  95.1 KiB │  95.1 KiB │ +1 B │ 182.2 KiB │ 182.2 KiB │  0 B 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
    total │   9.6 MiB │   9.6 MiB │ +1 B │  21.6 MiB │  21.6 MiB │  0 B 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 20114 │ 20114 │ 0 (+0 -0) 
   types │  6221 │  6221 │ 0 (+0 -0) 
 classes │  5015 │  5015 │ 0 (+0 -0) 
 methods │ 29998 │ 29998 │ 0 (+0 -0) 
  fields │ 17347 │ 17347 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  164 │  164 │  0   
 entries │ 3643 │ 3643 │  0
APK
   compressed    │  uncompressed   │                                           
──────────┬──────┼──────────┬──────┤                                           
 size     │ diff │ size     │ diff │ path                                      
──────────┼──────┼──────────┼──────┼───────────────────────────────────────────
    272 B │ +2 B │    120 B │  0 B │ ∆ META-INF/version-control-info.textproto 
 28.9 KiB │ -2 B │   64 KiB │  0 B │ ∆ META-INF/CERT.SF                        
 25.6 KiB │ +1 B │ 63.9 KiB │  0 B │ ∆ META-INF/MANIFEST.MF                    
──────────┼──────┼──────────┼──────┼───────────────────────────────────────────
 54.8 KiB │ +1 B │  128 KiB │  0 B │ (total)

@@ -54,7 +54,6 @@ internal class CustomerStateHolder(
val newCustomer = customer.value?.copy(defaultPaymentMethodId = paymentMethod?.id)

savedStateHandle[SAVED_CUSTOMER] = newCustomer
updateMostRecentlySelectedSavedPaymentMethod(paymentMethod = paymentMethod)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this isn't needed anymore -- setting the selection will end up updating the most recently selected saved PM, so we don't need a separate call for this

@@ -292,11 +300,60 @@ internal class CustomerSessionPaymentSheetActivityTest {
composeTestRule.onUpdateScreenRemoveButton().assertDoesNotExist()
}

@Test
fun `Setting default card selects that card in vertical mode`() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ran ShampooRule with 1000 iterations to ensure this isn't flaky

@amk-stripe amk-stripe marked this pull request as ready for review February 24, 2025 01:18
@amk-stripe amk-stripe requested review from a team as code owners February 24, 2025 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant