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

Prevent back during payment intent confirmation #5789

Merged
merged 1 commit into from
Nov 10, 2022

Conversation

tillh-stripe
Copy link
Collaborator

@tillh-stripe tillh-stripe commented Nov 8, 2022

Summary

This pull request fixes an issue where a payment was incorrectly displayed as failed when pressing the back button while confirming the payment intent.

We now ignore back presses in the PaymentLauncherConfirmationActivity.

Motivation

Resolves #5771

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

N/A

Changelog

[CHANGED] We now disable the back button while confirming intents via PaymentLauncher to prevent them from incorrectly being displayed as failed.

@tillh-stripe tillh-stripe force-pushed the tillh/prevent-back-during-intent-confirmation branch from e049286 to b2f54f4 Compare November 8, 2022 21:21
@@ -2,6 +2,9 @@

## XX.XX.XX - 2022-XX-XX

### Payments
* [CHANGED][5789](https://github.com/stripe/stripe-android/pull/5789) We now disable the back button while confirming intents with `PaymentLauncher` to prevent them from incorrectly being displayed as failed.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thoughts on the wording?

@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 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 │  5.2 MiB │  5.2 MiB │ +247 B │  13.6 MiB │  13.6 MiB │ +444 B 
     arsc │  1.9 MiB │  1.9 MiB │    0 B │   1.9 MiB │   1.9 MiB │    0 B 
 manifest │  4.1 KiB │  4.1 KiB │    0 B │  19.2 KiB │  19.2 KiB │    0 B 
      res │    1 MiB │    1 MiB │    0 B │   1.8 MiB │   1.8 MiB │    0 B 
   native │  2.5 MiB │  2.5 MiB │    0 B │   5.9 MiB │   5.9 MiB │    0 B 
    asset │    3 MiB │    3 MiB │   -4 B │     3 MiB │     3 MiB │   -4 B 
    other │ 82.4 KiB │ 82.4 KiB │    0 B │ 158.4 KiB │ 158.4 KiB │    0 B 
──────────┼──────────┼──────────┼────────┼───────────┼───────────┼────────
    total │ 13.7 MiB │ 13.7 MiB │ +243 B │  26.4 MiB │  26.4 MiB │ +440 B 

         │          raw           │            unique            
         ├────────┬────────┬──────┼────────┬────────┬────────────
 DEX     │ old    │ new    │ diff │ old    │ new    │ diff       
─────────┼────────┼────────┼──────┼────────┼────────┼────────────
   files │      2 │      2 │    0 │        │        │            
 strings │  84861 │  84863 │   +2 │  70467 │  70468 │ +1 (+3 -2) 
   types │  21946 │  21947 │   +1 │  19666 │  19667 │ +1 (+2 -1) 
 classes │  17638 │  17639 │   +1 │  17638 │  17639 │ +1 (+2 -1) 
 methods │  94656 │  94660 │   +4 │  90532 │  90536 │ +4 (+7 -3) 
  fields │ 102423 │ 102424 │   +1 │ 101123 │ 101124 │ +1 (+1 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  334 │  334 │  0   
 entries │ 6252 │ 6252 │  0
APK
    compressed    │   uncompressed   │                                
─────────┬────────┼─────────┬────────┤                                
 size    │ diff   │ size    │ diff   │ path                           
─────────┼────────┼─────────┼────────┼────────────────────────────────
 2.1 MiB │ +247 B │ 5.8 MiB │ +444 B │ ∆ classes2.dex                 
   773 B │   -3 B │   641 B │   -3 B │ ∆ assets/dexopt/baseline.profm 
   8 KiB │   -1 B │ 7.9 KiB │   -1 B │ ∆ assets/dexopt/baseline.prof  
─────────┼────────┼─────────┼────────┼────────────────────────────────
 2.1 MiB │ +243 B │ 5.9 MiB │ +440 B │ (total)
DEX
STRINGS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   70467 │ 70468 │ +1 (+3 -2) 
  + ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:8cdf001,r8-mode:compatibility,version:3.3.83}
  + Lcom/stripe/android/payments/paymentlauncher/PaymentLauncherConfirmationActivity_onCreate_1;
  + Lcom/stripe/android/payments/paymentlauncher/PaymentLauncherConfirmationActivity_onCreate_3;
  
  - ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:d0fe804,r8-mode:compatibility,version:3.3.83}
  - Lcom/stripe/android/payments/paymentlauncher/PaymentLauncherConfirmationActivity_onCreate_2;
  

TYPES:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   19666 │ 19667 │ +1 (+2 -1) 
  + Lcom/stripe/android/payments/paymentlauncher/PaymentLauncherConfirmationActivity_onCreate_1;
  + Lcom/stripe/android/payments/paymentlauncher/PaymentLauncherConfirmationActivity_onCreate_3;
  
  - Lcom/stripe/android/payments/paymentlauncher/PaymentLauncherConfirmationActivity_onCreate_2;
  

METHODS:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   90532 │ 90536 │ +4 (+7 -3) 
  + com.stripe.android.payments.paymentlauncher.PaymentLauncherConfirmationActivity_onCreate_1 <clinit>()
  + com.stripe.android.payments.paymentlauncher.PaymentLauncherConfirmationActivity_onCreate_1 <init>()
  + com.stripe.android.payments.paymentlauncher.PaymentLauncherConfirmationActivity_onCreate_1 invoke(Object) → Object
  + com.stripe.android.payments.paymentlauncher.PaymentLauncherConfirmationActivity_onCreate_1 invoke(j)
  + com.stripe.android.payments.paymentlauncher.PaymentLauncherConfirmationActivity_onCreate_3 <init>(Object)
  + com.stripe.android.payments.paymentlauncher.PaymentLauncherConfirmationActivity_onCreate_3 invoke(Object) → Object
  + com.stripe.android.payments.paymentlauncher.PaymentLauncherConfirmationActivity_onCreate_3 invoke(PaymentResult)
  
  - com.stripe.android.payments.paymentlauncher.PaymentLauncherConfirmationActivity_onCreate_2 <init>(Object)
  - com.stripe.android.payments.paymentlauncher.PaymentLauncherConfirmationActivity_onCreate_2 invoke(Object) → Object
  - com.stripe.android.payments.paymentlauncher.PaymentLauncherConfirmationActivity_onCreate_2 invoke(PaymentResult)
  

FIELDS:

   old    │ new    │ diff       
  ────────┼────────┼────────────
   101123 │ 101124 │ +1 (+1 -0) 
  + com.stripe.android.payments.paymentlauncher.PaymentLauncherConfirmationActivity_onCreate_1 INSTANCE: PaymentLauncherConfirmationActivity_onCreate_1

@tillh-stripe tillh-stripe merged commit 7144893 into master Nov 10, 2022
@tillh-stripe tillh-stripe deleted the tillh/prevent-back-during-intent-confirmation branch November 10, 2022 16: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.

Payment gets failed on back press.
2 participants