Skip to content

Conversation

@tjclawson-stripe
Copy link
Collaborator

@tjclawson-stripe tjclawson-stripe commented Nov 7, 2025

Summary

Update PaymentElement and VerticalModeFormUI to show VerticalModeFormHeaderUI if there is only one non card payment method.

Motivation

Fix empty form display

  • If wallet is available and there is one supported payment method
    • If PM is card > Do not show header as divider text displays "Or pay with card"
    • If PM is not card > Show header
  • If wallet is not available and there is only one supported payment method
    • If PM is card > Show title
    • If PM is not card > Show header

Testing

  • Added tests
  • Modified tests
  • Manually verified
Screen.Recording.2025-11-09.at.7.50.39.PM.mov

@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 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.1 MiB │   1.1 MiB │  0 B │   1.1 MiB │   1.1 MiB │  0 B 
 manifest │   2.3 KiB │   2.3 KiB │  0 B │     8 KiB │     8 KiB │  0 B 
      res │ 303.5 KiB │ 303.5 KiB │  0 B │ 457.7 KiB │ 457.7 KiB │  0 B 
   native │   7.9 MiB │   7.9 MiB │  0 B │  19.3 MiB │  19.3 MiB │  0 B 
    asset │   7.7 KiB │   7.7 KiB │  0 B │   7.4 KiB │   7.4 KiB │  0 B 
    other │  95.6 KiB │  95.6 KiB │ +4 B │ 183.6 KiB │ 183.6 KiB │  0 B 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
    total │  11.5 MiB │  11.5 MiB │ +4 B │  25.4 MiB │  25.4 MiB │  0 B 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 20719 │ 20719 │ 0 (+0 -0) 
   types │  6512 │  6512 │ 0 (+0 -0) 
 classes │  5276 │  5276 │ 0 (+0 -0) 
 methods │ 31556 │ 31556 │ 0 (+0 -0) 
  fields │ 18288 │ 18288 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  163 │  163 │  0   
 entries │ 3667 │ 3667 │  0
APK
   compressed    │   uncompressed   │                                           
──────────┬──────┼───────────┬──────┤                                           
 size     │ diff │ size      │ diff │ path                                      
──────────┼──────┼───────────┼──────┼───────────────────────────────────────────
 29.2 KiB │ +7 B │  64.6 KiB │  0 B │ ∆ META-INF/CERT.SF                        
    270 B │ -2 B │     120 B │  0 B │ ∆ META-INF/version-control-info.textproto 
 25.9 KiB │ -1 B │  64.6 KiB │  0 B │ ∆ META-INF/MANIFEST.MF                    
──────────┼──────┼───────────┼──────┼───────────────────────────────────────────
 55.4 KiB │ +4 B │ 129.3 KiB │  0 B │ (total)

@tjclawson-stripe tjclawson-stripe changed the title Tyler/fix one pm forms Fix Forms when there is only one payment method available Nov 10, 2025
@tjclawson-stripe tjclawson-stripe marked this pull request as ready for review November 10, 2025 17:35
@tjclawson-stripe tjclawson-stripe requested review from a team as code owners November 10, 2025 17:35
Copy link
Collaborator

@amk-stripe amk-stripe left a comment

Choose a reason for hiding this comment

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

should we also have screenshot tests for this? The tests you added seem like they would catch a regression but if they fail, it's a little hard to understand the impact. Vs in a screenshot test, it would be pretty obvious

}

private fun shouldShowHeader(selectedCode: String, showsWalletHeader: Boolean): Boolean {
return if (selectedCode == PaymentMethod.Type.Card.code) !showsWalletHeader else true
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return if (selectedCode == PaymentMethod.Type.Card.code) !showsWalletHeader else true
return (selectedCode != PaymentMethod.Type.Card.code) || !showsWalletHeader

Copy link
Collaborator

Choose a reason for hiding this comment

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

a bit easier to read and should return the same values

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.

4 participants