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

Add 3ds2 url to list of completion URLs so callbacks work correctly. #5079

Merged
merged 2 commits into from
May 26, 2022

Conversation

skyler-stripe
Copy link
Contributor

Summary

  • Adds the 3ds2 URL to the list of completion URLs. This means that the webview will close when not given a return URL. Previously it would get stuck. This is really only the case when using Stripe.handleNextAction or PaymentLauncher.handleNextAction.
  • Our normal confirm flows with both classes append a return URL which makes 3ds2 not land in this situation. handleNextAction does not do this, so we need add to our list of URLs so the activity result is fired correctly.

Motivation

Testing

  • Added tests
  • Modified tests
  • Manually verified

Created a PI with a next-action of 3ds, and hard coded it both with PaymentLauncher and Stripe. I confirmed that the webview would not hang and fires the callback correctly.

Comment on lines +187 to +188
"https://hooks.stripe.com/3d_secure/complete/",
"https://hooks.stripe.com/3d_secure_2/hosted/complete"
Copy link
Contributor

Choose a reason for hiding this comment

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

This may be for a future PR, but can't we just match all urls that are https://hooks.stripe.com, then we don't need to maintain this list?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's also https://hooks.stripe.com/three_d_secure/authenticate which triggers a different flow. So unfortunately not :(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This does feel like a value that should come from a server rather than be hard coded though. Hopefully we can add it later this year after we have that capability.

@github-actions
Copy link
Contributor

github-actions bot commented May 26, 2022

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: none)
NEW: paymentsheet-example-release-pr.apk (signature: none)

          │          compressed           │         uncompressed          
          ├───────────┬───────────┬───────┼───────────┬───────────┬───────
 APK      │ old       │ new       │ diff  │ old       │ new       │ diff  
──────────┼───────────┼───────────┼───────┼───────────┼───────────┼───────
      dex │  13.9 MiB │  13.9 MiB │ -70 B │  46.3 MiB │  46.3 MiB │ +72 B 
     arsc │   1.7 MiB │   1.7 MiB │   0 B │   1.7 MiB │   1.7 MiB │   0 B 
 manifest │   3.5 KiB │   3.5 KiB │   0 B │  15.7 KiB │  15.7 KiB │   0 B 
      res │ 824.7 KiB │ 824.7 KiB │   0 B │   1.3 MiB │   1.3 MiB │   0 B 
   native │   5.4 MiB │   5.4 MiB │   0 B │  13.4 MiB │  13.4 MiB │   0 B 
    asset │     3 MiB │     3 MiB │  +1 B │     3 MiB │     3 MiB │  +1 B 
    other │  79.9 KiB │  79.9 KiB │   0 B │ 154.8 KiB │ 154.8 KiB │   0 B 
──────────┼───────────┼───────────┼───────┼───────────┼───────────┼───────
    total │  24.8 MiB │  24.8 MiB │ -69 B │  65.9 MiB │  65.9 MiB │ +73 B 

         │          raw           │            unique            
         ├────────┬────────┬──────┼────────┬────────┬────────────
 DEX     │ old    │ new    │ diff │ old    │ new    │ diff       
─────────┼────────┼────────┼──────┼────────┼────────┼────────────
   files │      4 │      4 │    0 │        │        │            
 strings │ 225523 │ 225524 │   +1 │ 196276 │ 196277 │ +1 (+3 -2) 
   types │  39378 │  39378 │    0 │  35915 │  35915 │  0 (+0 -0) 
 classes │  33234 │  33234 │    0 │  33234 │  33234 │  0 (+0 -0) 
 methods │ 202277 │ 202277 │    0 │ 194081 │ 194081 │  0 (+0 -0) 
  fields │ 149866 │ 149866 │    0 │ 148835 │ 148835 │  0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  293 │  293 │  0   
 entries │ 5796 │ 5796 │  0
APK
   compressed    │   uncompressed   │                               
─────────┬───────┼──────────┬───────┤                               
 size    │ diff  │ size     │ diff  │ path                          
─────────┼───────┼──────────┼───────┼───────────────────────────────
 3.8 MiB │ -70 B │ 11.4 MiB │ +72 B │ ∆ classes3.dex                
 7.3 KiB │  +1 B │  7.2 KiB │  +1 B │ ∆ assets/dexopt/baseline.prof 
─────────┼───────┼──────────┼───────┼───────────────────────────────
 3.8 MiB │ -69 B │ 11.4 MiB │ +73 B │ (total)
DEX
STRINGS:

   old    │ new    │ diff       
  ────────┼────────┼────────────
   196276 │ 196277 │ +1 (+3 -2) 
  + SMAP
  PaymentAuthWebViewClient.kt
  Kotlin
  *S Kotlin
  *F
  + 1 PaymentAuthWebViewClient.kt
  com/stripe/android/view/PaymentAuthWebViewClient
  + 2 fake.kt
  kotlin/jvm/internal/FakeKt
  *L
  1#1,209:1
  1#2:210
  *E
  
  + SMAP
  PaymentAuthWebViewClient.kt
  Kotlin
  *S Kotlin
  *F
  + 1 PaymentAuthWebViewClient.kt
  com/stripe/android/view/PaymentAuthWebViewClient_Companion
  + 2 _Collections.kt
  kotlin/collections/CollectionsKt___CollectionsKt
  *L
  1#1,209:1
  1741#2,3:210
  1741#2,3:213
  *S KotlinDebug
  *F
  + 1 PaymentAuthWebViewClient.kt
  com/stripe/android/view/PaymentAuthWebViewClient_Companion
  *L
  199#1:210,3
  205#1:213,3
  *E
  
  + https://hooks.stripe.com/3d_secure_2/hosted/complete
  
  - SMAP
  PaymentAuthWebViewClient.kt
  Kotlin
  *S Kotlin
  *F
  + 1 PaymentAuthWebViewClient.kt
  com/stripe/android/view/PaymentAuthWebViewClient
  + 2 fake.kt
  kotlin/jvm/internal/FakeKt
  *L
  1#1,208:1
  1#2:209
  *E
  
  - SMAP
  PaymentAuthWebViewClient.kt
  Kotlin
  *S Kotlin
  *F
  + 1 PaymentAuthWebViewClient.kt
  com/stripe/android/view/PaymentAuthWebViewClient_Companion
  + 2 _Collections.kt
  kotlin/collections/CollectionsKt___CollectionsKt
  *L
  1#1,208:1
  1741#2,3:209
  1741#2,3:212
  *S KotlinDebug
  *F
  + 1 PaymentAuthWebViewClient.kt
  com/stripe/android/view/PaymentAuthWebViewClient_Companion
  *L
  198#1:209,3
  204#1:212,3
  *E

@skyler-stripe skyler-stripe merged commit a3ee6b9 into master May 26, 2022
@skyler-stripe skyler-stripe deleted the fixNextAction3dsCallback branch May 26, 2022 22:20
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.

5 participants