Skip to content

Update LocalStripeException to include decline code, error code, and error type#13144

Merged
amk-stripe merged 7 commits into
masterfrom
fix-3ds-error
May 27, 2026
Merged

Update LocalStripeException to include decline code, error code, and error type#13144
amk-stripe merged 7 commits into
masterfrom
fix-3ds-error

Conversation

@amk-stripe

@amk-stripe amk-stripe commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Update LocalStripeException to include decline code, error code, and error type

Motivation

https://jira.corp.stripe.com/browse/RUN_MOBILESDK-5379

I originally tried to just throw the full exception from the intent error (e.g. throw a CardException or ApiException instead of a LocalStripeException) but we have custom logic about what the display message should be which was broken by that. This preserves our existing display message logic while still exposing more error details to our clients.

Testing

  • Added tests
  • Modified tests
  • Manually verified

Manually verified that the user reported error situation now includes all the exception info they need

Changelog

  • [CHANGED]13144 On payment or setup confirmation failure, we now include error code, decline code, and error type in the exception thrown.

@amk-stripe amk-stripe changed the title Expose full exception on intent confirmation failure Update LocalStripeException to include decline code, error code, and error type May 22, 2026

@amk-stripe amk-stripe left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

hmm I think maybe I should include a StripeError in the LocalStripeException instead of just adding these fields I decided against this as the fix in this PR is a minimal fix which will enable us to solve the reported bug

@amk-stripe amk-stripe marked this pull request as ready for review May 26, 2026 16:36
@amk-stripe amk-stripe requested review from a team as code owners May 26, 2026 16:36
@amk-stripe amk-stripe requested a review from toluo-stripe May 26, 2026 16:36
@github-actions

github-actions Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

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.6 MiB │   4.6 MiB │    +83 B │   9.7 MiB │   9.7 MiB │   +460 B 
     arsc │   3.8 MiB │   3.8 MiB │      0 B │   3.8 MiB │   3.8 MiB │      0 B 
 manifest │   5.8 KiB │   5.8 KiB │      0 B │  30.8 KiB │  30.8 KiB │      0 B 
      res │     1 MiB │     1 MiB │      0 B │   1.7 MiB │   1.7 MiB │      0 B 
   native │   2.7 MiB │   2.7 MiB │      0 B │   2.7 MiB │   2.7 MiB │      0 B 
    asset │  23.5 KiB │    25 KiB │ +1.5 KiB │  44.2 KiB │  45.8 KiB │ +1.5 KiB 
    other │ 245.4 KiB │ 245.4 KiB │     -8 B │ 505.1 KiB │ 505.1 KiB │      0 B 
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
    total │  12.3 MiB │  12.3 MiB │ +1.6 KiB │  18.4 MiB │  18.4 MiB │   +2 KiB 

 DEX     │ old   │ new   │ diff       
─────────┼───────┼───────┼────────────
   files │     1 │     1 │  0         
 strings │ 45274 │ 45274 │  0 (+2 -2) 
   types │ 14272 │ 14272 │  0 (+0 -0) 
 classes │ 11594 │ 11594 │  0 (+0 -0) 
 methods │ 63368 │ 63370 │ +2 (+2 -0) 
  fields │ 41155 │ 41155 │  0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  319 │  319 │  0   
 entries │ 7476 │ 7476 │  0
APK
     compressed      │     uncompressed     │                                           
──────────┬──────────┼───────────┬──────────┤                                           
 size     │ diff     │ size      │ diff     │ path                                      
──────────┼──────────┼───────────┼──────────┼───────────────────────────────────────────
  8.9 KiB │ +1.5 KiB │   8.8 KiB │ +1.5 KiB │ ∆ assets/dexopt/baseline.prof             
  4.6 MiB │    +83 B │   9.7 MiB │   +460 B │ ∆ classes.dex                             
 55.6 KiB │     -4 B │ 130.6 KiB │      0 B │ ∆ META-INF/MANIFEST.MF                    
    270 B │     -2 B │     120 B │      0 B │ ∆ META-INF/version-control-info.textproto 
 58.9 KiB │     -1 B │ 130.6 KiB │      0 B │ ∆ META-INF/CERT.SF                        
  1.2 KiB │     -1 B │   1.2 KiB │      0 B │ ∆ META-INF/CERT.RSA                       
──────────┼──────────┼───────────┼──────────┼───────────────────────────────────────────
  4.7 MiB │ +1.6 KiB │    10 MiB │   +2 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff      
  ───────┼───────┼───────────
   45274 │ 45274 │ 0 (+2 -2) 
  
  + r8-map-id-beaacfbe45cd250e247974d89a93b0c4c4cabfef064da50f0a548526eb8bd929
  + ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":23,"pg-map-id":"beaacfbe45cd250e247974d89a93b0c4c4cabfef064da50f0a548526eb8bd929","r8-mode":"full","version":"8.13.19"}
  
  - r8-map-id-2bb12dd968466c45929c348a7714fb50878201a999f4fd72d6f88ec9bc5e71bd
  - ~~R8{"backend":"dex","compilation-mode":"release","has-checksums":false,"min-api":23,"pg-map-id":"2bb12dd968466c45929c348a7714fb50878201a999f4fd72d6f88ec9bc5e71bd","r8-mode":"full","version":"8.13.19"}
  

METHODS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   63368 │ 63370 │ +2 (+2 -0) 
  
  + xd.e <init>(int, String, String, String)
  + zd.d <init>(String, String, String, String, String)

@amk-stripe amk-stripe merged commit 9e20994 into master May 27, 2026
50 of 51 checks passed
@amk-stripe amk-stripe deleted the fix-3ds-error branch May 27, 2026 16:40
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.

2 participants