Skip to content

PaymentMethod id is no longer nullable. #10990

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

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

Conversation

jaynewstrom-stripe
Copy link
Collaborator

Summary

PaymentMethod.id was public and nullable -- but in practice was never null. This fixes that modeling problem.

Motivation

https://jira.corp.stripe.com/browse/MOBILESDK-3698

Copy link
Contributor

github-actions bot commented Jun 24, 2025

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: V1, V2)
NEW: paymentsheet-example-release-pr.apk (signature: V1, V2)

          │           compressed           │         uncompressed          
          ├───────────┬───────────┬────────┼───────────┬───────────┬───────
 APK      │ old       │ new       │ diff   │ old       │ new       │ diff  
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼───────
      dex │   4.4 MiB │   4.4 MiB │ +232 B │   9.7 MiB │   9.7 MiB │ -12 B 
     arsc │   2.5 MiB │   2.5 MiB │    0 B │   2.5 MiB │   2.5 MiB │   0 B 
 manifest │   5.7 KiB │   5.7 KiB │    0 B │  29.4 KiB │  29.4 KiB │   0 B 
      res │   918 KiB │   918 KiB │    0 B │   1.5 MiB │   1.5 MiB │   0 B 
   native │   3.5 MiB │   3.5 MiB │    0 B │   8.5 MiB │   8.5 MiB │   0 B 
    asset │   1.6 MiB │   1.6 MiB │   +1 B │   1.6 MiB │   1.6 MiB │  +1 B 
    other │ 197.6 KiB │ 197.6 KiB │  +17 B │ 373.3 KiB │ 373.3 KiB │   0 B 
──────────┼───────────┼───────────┼────────┼───────────┼───────────┼───────
    total │  13.1 MiB │  13.1 MiB │ +250 B │  24.1 MiB │  24.1 MiB │ -11 B 

         │         raw          │           unique           
         ├───────┬───────┬──────┼───────┬───────┬────────────
 DEX     │ old   │ new   │ diff │ old   │ new   │ diff       
─────────┼───────┼───────┼──────┼───────┼───────┼────────────
   files │     2 │     2 │    0 │       │       │            
 strings │ 47226 │ 47227 │   +1 │ 46035 │ 46036 │ +1 (+2 -1) 
   types │ 16802 │ 16802 │    0 │ 16208 │ 16208 │  0 (+0 -0) 
 classes │ 13677 │ 13677 │    0 │ 13677 │ 13677 │  0 (+0 -0) 
 methods │ 67628 │ 67628 │    0 │ 66773 │ 66773 │  0 (+0 -0) 
  fields │ 44899 │ 44899 │    0 │ 44601 │ 44601 │  0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  242 │  242 │  0   
 entries │ 6323 │ 6323 │  0
APK
    compressed     │   uncompressed    │                               
──────────┬────────┼───────────┬───────┤                               
 size     │ diff   │ size      │ diff  │ path                          
──────────┼────────┼───────────┼───────┼───────────────────────────────
  4.3 MiB │ +233 B │   9.5 MiB │ -12 B │ ∆ classes.dex                 
 54.7 KiB │   +9 B │ 121.4 KiB │   0 B │ ∆ META-INF/CERT.SF            
 51.2 KiB │   +7 B │ 121.4 KiB │   0 B │ ∆ META-INF/MANIFEST.MF        
  8.5 KiB │   +1 B │   8.3 KiB │  +1 B │ ∆ assets/dexopt/baseline.prof 
 90.5 KiB │   -1 B │ 206.4 KiB │   0 B │ ∆ classes2.dex                
  1.2 KiB │   +1 B │   1.2 KiB │   0 B │ ∆ META-INF/CERT.RSA           
──────────┼────────┼───────────┼───────┼───────────────────────────────
  4.5 MiB │ +250 B │    10 MiB │ -11 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   46035 │ 46036 │ +1 (+2 -1) 
  
  + PaymentMethod id was null
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"adaa9cf","r8-mode":"full","version":"8.8.34"}
  
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":21,"pg-map-id":"30e0955","r8-mode":"full","version":"8.8.34"}

@jaynewstrom-stripe jaynewstrom-stripe force-pushed the jaynewstrom/paymentmethod-id-nullability branch 4 times, most recently from 40c2d34 to 050f90f Compare June 24, 2025 15:37
cttsai-stripe
cttsai-stripe previously approved these changes Jun 25, 2025
@@ -28,8 +28,8 @@ class SavedPaymentMethodsExtensionTest {
}

@Test
fun `shouldShowDefaultBadge is false when defaultPaymentMethodId is null and paymentMethod id null`() {
val actual = testSetup(null, null)
fun `shouldShowDefaultBadge is false when defaultPaymentMethodId is null and`() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
fun `shouldShowDefaultBadge is false when defaultPaymentMethodId is null and`() {
fun `shouldShowDefaultBadge is false when defaultPaymentMethodId is null`() {

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🤦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants