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

Throw on get saved payment methods failure in test mode PaymentSheet #7999

Merged
merged 7 commits into from Feb 28, 2024

Conversation

amk-stripe
Copy link
Contributor

Summary

Throw when getting saved payment methods fails while loading PaymentSheet in test mode

Motivation

To match behavior with iOS.

A developer recently realized they were using the incorrect ephemeralKeySecret in their Android SDK only when they started doing the same thing in iOS -- the iOS SDK threw an error, alerting them to their mistake, but the Android SDK silently failed.

Testing

  • Added tests
  • Modified tests
  • Manually verified

There are already automated tests which cover the cases in which getting saved payment methods fails in CustomerRepositoryTest.kt.

Screen recording

Before After
silently fails when saved payment methods fails.webm payment fails when getting saved payment methods fails.webm

Changelog

  • [Changed] In test mode, payments will fail when getting saved payment methods fails.

Copy link
Contributor

github-actions bot commented Feb 26, 2024

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.4 MiB │   1.4 MiB │  0 B │   1.4 MiB │   1.4 MiB │  0 B 
 manifest │   2.3 KiB │   2.3 KiB │  0 B │   8.1 KiB │   8.1 KiB │  0 B 
      res │ 363.2 KiB │ 363.2 KiB │  0 B │ 490.6 KiB │ 490.6 KiB │  0 B 
   native │   6.2 MiB │   6.2 MiB │  0 B │  15.8 MiB │  15.8 MiB │  0 B 
    asset │  67.8 KiB │  67.8 KiB │  0 B │  87.7 KiB │  87.7 KiB │  0 B 
    other │ 114.7 KiB │ 114.7 KiB │  0 B │ 270.3 KiB │ 270.3 KiB │  0 B 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
    total │  10.2 MiB │  10.2 MiB │  0 B │  22.2 MiB │  22.2 MiB │  0 B 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 20963 │ 20963 │ 0 (+0 -0) 
   types │  6509 │  6509 │ 0 (+0 -0) 
 classes │  5298 │  5298 │ 0 (+0 -0) 
 methods │ 30646 │ 30646 │ 0 (+0 -0) 
  fields │ 17817 │ 17817 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  262 │  262 │  0   
 entries │ 5504 │ 5504 │  0

@amk-stripe amk-stripe self-assigned this Feb 26, 2024
@amk-stripe amk-stripe marked this pull request as ready for review February 26, 2024 23:52
@amk-stripe amk-stripe requested review from a team as code owners February 26, 2024 23:52
@amk-stripe amk-stripe enabled auto-merge (squash) February 26, 2024 23:52
@amk-stripe amk-stripe enabled auto-merge (squash) February 26, 2024 23:52
@amk-stripe amk-stripe merged commit 25696e3 into master Feb 28, 2024
12 checks passed
@amk-stripe amk-stripe deleted the validate-ephemeral-key-secret-in-test-mode branch February 28, 2024 15:57
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.

None yet

2 participants