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

Enable Cash App Pay for SI and PI+SFU #7264

Merged
merged 5 commits into from
Sep 8, 2023

Conversation

tillh-stripe
Copy link
Collaborator

@tillh-stripe tillh-stripe commented Sep 5, 2023

Summary

This pull request enables the usage of Cash App Pay for setup intents and payment intents with SFU.

Motivation

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

@github-actions
Copy link
Contributor

github-actions bot commented Sep 5, 2023

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 │   3.5 MiB │   3.5 MiB │   +619 B │   7.8 MiB │   7.8 MiB │ +1.9 KiB 
     arsc │   2.1 MiB │   2.1 MiB │   +788 B │   2.1 MiB │   2.1 MiB │   +788 B 
 manifest │   4.9 KiB │   4.9 KiB │      0 B │  24.1 KiB │  24.1 KiB │      0 B 
      res │ 879.5 KiB │ 879.5 KiB │     -2 B │   1.4 MiB │   1.4 MiB │      0 B 
   native │   2.6 MiB │   2.6 MiB │      0 B │     6 MiB │     6 MiB │      0 B 
    asset │     3 MiB │     3 MiB │     +4 B │     3 MiB │     3 MiB │     +4 B 
    other │ 200.1 KiB │ 200.1 KiB │     -9 B │ 447.6 KiB │ 447.6 KiB │      0 B 
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
    total │  12.3 MiB │  12.3 MiB │ +1.4 KiB │  20.7 MiB │  20.7 MiB │ +2.7 KiB 

 DEX     │ old   │ new   │ diff            
─────────┼───────┼───────┼─────────────────
   files │     1 │     1 │   0             
 strings │ 38305 │ 38311 │  +6 (+12 -6)    
   types │ 12684 │ 12687 │  +3 (+8 -5)     
 classes │ 10709 │ 10712 │  +3 (+3 -0)     
 methods │ 56185 │ 56201 │ +16 (+383 -367) 
  fields │ 35253 │ 35259 │  +6 (+255 -249) 

 ARSC    │ old  │ new  │ diff       
─────────┼──────┼──────┼────────────
 configs │  290 │  290 │  0         
 entries │ 6934 │ 6935 │ +1 (+1 -0)
APK
     compressed      │     uncompressed     │                                
──────────┬──────────┼───────────┬──────────┤                                
 size     │ diff     │ size      │ diff     │ path                           
──────────┼──────────┼───────────┼──────────┼────────────────────────────────
  2.1 MiB │   +788 B │   2.1 MiB │   +788 B │ ∆ resources.arsc               
  3.5 MiB │   +619 B │   7.8 MiB │ +1.9 KiB │ ∆ classes.dex                  
 48.7 KiB │     -9 B │ 141.2 KiB │      0 B │ ∆ META-INF/MANIFEST.MF         
    762 B │     +3 B │     630 B │     +3 B │ ∆ assets/dexopt/baseline.profm 
    994 B │     -2 B │   2.8 KiB │      0 B │ ∆ res/XB.xml                   
  6.4 KiB │     +1 B │   6.3 KiB │     +1 B │ ∆ assets/dexopt/baseline.prof  
    877 B │     -1 B │   2.3 KiB │      0 B │ ∆ res/6i.xml                   
    839 B │     +1 B │   1.8 KiB │      0 B │ ∆ res/AZ.xml                   
    538 B │     +1 B │     952 B │      0 B │ ∆ res/gK.xml                   
  3.1 KiB │     -1 B │  21.1 KiB │      0 B │ ∆ res/s0.xml                   
 62.8 KiB │     -1 B │ 141.3 KiB │      0 B │ ∆ META-INF/CERT.SF             
  1.2 KiB │     +1 B │   1.2 KiB │      0 B │ ∆ META-INF/CERT.RSA            
──────────┼──────────┼───────────┼──────────┼────────────────────────────────
  5.8 MiB │ +1.4 KiB │  10.2 MiB │ +2.7 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff        
  ───────┼───────┼─────────────
   38305 │ 38311 │ +6 (+12 -6) 
  + CashAppPayMandateTextSpec(apiPath=
  + Lfg/a7;
  + Lfg/b7;
  + Lfg/z6;
  + [Lfg/a3;
  + [Lfg/a4;
  + [Lfg/d5;
  + [Lfg/p3;
  + [Lfg/v6;
  + cashapp_mandate
  + com.stripe.android.ui.core.elements.CashAppPayMandateTextSpec
  + ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:0e7b9e3,r8-mode:full,version:8.0.46}
  
  - [Lfg/a5;
  - [Lfg/m3;
  - [Lfg/s6;
  - [Lfg/x2;
  - [Lfg/x3;
  - ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:d24383f,r8-mode:full,version:8.0.46}
  

TYPES:

   old   │ new   │ diff       
  ───────┼───────┼────────────
   12684 │ 12687 │ +3 (+8 -5) 
  + Lfg/a7;
  + Lfg/b7;
  + Lfg/z6;
  + [Lfg/a3;
  + [Lfg/a4;
  + [Lfg/d5;
  + [Lfg/p3;
  + [Lfg/v6;
  
  - [Lfg/a5;
  - [Lfg/m3;
  - [Lfg/s6;
  - [Lfg/x2;
  - [Lfg/x3;
  

METHODS:

   old   │ new   │ diff            
  ───────┼───────┼─────────────────
   56185 │ 56201 │ +16 (+383 -367) 
  + dg.l <init>(j4, b)
  + fg.a2 <clinit>()
  + fg.a2 i() → Object
  + fg.a3 <init>()
  + fg.a3 valueOf(String) → a3
  + fg.a3 values() → a3[]
  + fg.a4 <init>(String, int)
  + fg.a4 valueOf(String) → a4
  + fg.a4 values() → a4[]
  + fg.a5 <init>()
  + fg.a5 serializer() → b
  + fg.a7 <init>()
  + fg.a7 serializer() → b
  + fg.b2 <init>()
  + fg.b2 serializer() → b
  + fg.b5 <init>()
  + fg.b5 i() → Object
  + fg.b6 <init>()
  + fg.b6 <init>(int, t0, int)
  + fg.b7 <clinit>()
  + fg.b7 <init>(int, t0)
  + fg.b7 equals(Object) → boolean
  + fg.b7 hashCode() → int
  + fg.b7 toString() → String
  + fg.c2 a() → b[]
  + fg.c2 b()
  + fg.c2 c(c) → Object
  + fg.c2 d(d, Object)
  + fg.c2 e() → g
  + fg.c5 serializer() → b
  + fg.c6 a() → b[]
  + fg.c6 b()
  + fg.c6 c(c) → Object
  + fg.c6 d(d, Object)
  + fg.c6 e() → g
  + fg.d2 serializer() → b
  + fg.d3 <init>(int, String, String)
  + fg.d5 <init>(String, int)
  + fg.d5 valueOf(String) → d5
  + fg.d5 values() → d5[]
  + fg.d6 serializer() → b
  + fg.e2 <init>(int, String, String)
  + fg.e2 equals(Object) → boolean
  + fg.e2 hashCode() → int
  + fg.e2 toString() → String
  + fg.e3 <clinit>()
  + fg.e3 <init>()
  + fg.e3 a() → b[]
  + fg.e3 b()
  + fg.e3 c(c) → Object
  + fg.e3 d(d, Object)
  + fg.e3 e() → g
  + fg.e4 <init>()
  + fg.e4 a() → b[]
  + fg.e4 b()
  + fg.e4 c(c) → Object
  + fg.e4 d(d, Object)
  + fg.e4 e() → g
  + fg.e5 <clinit>()
  + fg.e5 <init>(int, t0, d5)
  + fg.e5 equals(Object) → boolean
  + fg.e5 hashCode() → int
  + fg.e5 toString() → String
  + fg.e6 <clinit>()
  + fg.e6 <init>(int, String, boolean, ArrayList, v4, y5)
  + fg.e6 equals(Object) → boolean
  + fg.e6 hashCode() → int
  + fg.e6 toString() → String
  + fg.f2 <clinit>()
  + fg.f3 serializer() → b
  + fg.f4 <init>()
  + fg.f4 serializer() → b
  + fg.f6 <clinit>()
  + fg.f6 <init>()
  + fg.f6 i() → Object
  + fg.g2 <init>()
  + fg.g2 f(m) → b
  + fg.g3 <clinit>()
  + fg.g3 <init>(int, t0, v6, List)
  + fg.g3 equals(Object) → boolean
  + fg.g3 hashCode() → int
  + fg.g3 toString() → String
  + fg.g4 <clinit>()
  + fg.g4 <init>(int, t0)
  + fg.g6 <clinit>()
  + fg.g6 <init>()
  + fg.g6 i() → Object
  + fg.h3 <init>(t0, String, int)
  + fg.h3 a() → t0
  + fg.h3 g() → u0
  + fg.h4 <clinit>()
  + fg.h5 serializer() → b
  + fg.h6 <init>(d1, a, int, String, int)
  + fg.h6 a(i, int)
  + fg.h6 z(Object, Object) → Object
  + fg.i3 <clinit>()
  + fg.i3 a() → b[]
  + fg.i3 b()
  + fg.i3 c(c) → Object
  + fg.i3 d(d, Object)
  + fg.i3 e() → g
  + fg.i4 <init>(j4, boolean, boolean)
  + fg.i5 i() → Object
  + fg.i6 <init>(d1, String, String, String, String, a, a, int, int)
  + fg.i6 z(Object, Object) → Object
  + fg.j2 <init>(int, f2, f2, f2, f2, f2, f2)
  + fg.j2 a() → Map
  + fg.j3 serializer() → b
  + fg.j4 <init>(List)
  + fg.j4 equals(Object) → boolean
  + fg.j4 hashCode() → int
  + fg.j4 toString() → String
  + fg.j5 serializer() → b
  + fg.j6 <init>(int, List)
  + fg.j6 b() → int
  + fg.j6 e(String) → String
  + fg.j6 f(int) → String
  + fg.j6 g() → boolean
  + fg.j6 h() → List
  + fg.j6 i() → ArrayList
  + fg.j6 j() → boolean
  + fg.k3 <init>(int, t0)
  + fg.k3 equals(Object) → boolean
  + fg.k3 hashCode() → int
  + fg.k3 toString() → String
  + fg.k4 <init>(String, int, int)
  + fg.k4 equals(Object) → boolean
  + fg.k4 hashCode() → int
  + fg.k4 toString() → String
  + fg.k5 <clinit>()
  + fg.k6 <init>(t0, g0)
  + fg.k6 a() → t0

...✂
ARSC
ENTRIES:

   old  │ new  │ diff       
  ──────┼──────┼────────────
   6934 │ 6935 │ +1 (+1 -0) 
  + string/stripe_cash_app_pay_mandate

@tillh-stripe tillh-stripe changed the title Enabled Cash App Pay for setup intents Enable Cash App Pay for setup intents Sep 6, 2023
@tillh-stripe tillh-stripe force-pushed the tillh/cash-app-pay-setup-intents branch 2 times, most recently from e376009 to e58693a Compare September 6, 2023 19:15
@tillh-stripe tillh-stripe reopened this Sep 6, 2023
@tillh-stripe tillh-stripe force-pushed the tillh/cash-app-pay-setup-intents branch 3 times, most recently from c870f32 to 70da21b Compare September 7, 2023 15:29
@tillh-stripe tillh-stripe force-pushed the tillh/cash-app-pay-setup-intents branch from 70da21b to 9073756 Compare September 7, 2023 17:30
@tillh-stripe tillh-stripe marked this pull request as ready for review September 7, 2023 17:30
@tillh-stripe tillh-stripe requested review from a team as code owners September 7, 2023 17:30
@tillh-stripe tillh-stripe changed the title Enable Cash App Pay for setup intents Enable Cash App Pay for SI and PI+SFU Sep 7, 2023
@tillh-stripe tillh-stripe force-pushed the tillh/cash-app-pay-setup-intents branch from 9073756 to 036125b Compare September 7, 2023 17:38
@@ -18,12 +18,12 @@ data class MandateTextSpec(
@StringRes
val stringResId: Int
) : FormItemSpec() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we reuse MandateTextSpec, rather than adding a new CashAppPayMandateTextSpec?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

CashAppPayMandateTextSpec is using MandateTextSpec under the hood.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand why we need this class though, couldn't we just add MandateTextSpec with the specific arguments in LpmRepository?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need CashAppPayMandateTextSpec because it passes merchantName to the underlying MandateSpec twice (as there are two placeholders in the string). We can’t do that with the plain MandateSpec.

paymentMethod.hasExpectedDetails()
}.filter { paymentMethod ->
// PayPal isn't supported yet as a saved payment method (backend limitation).
paymentMethod.type != PaymentMethod.Type.PayPal
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should (as a follow up) add this as a property to the LpmRepository or similar where we can define this stuff along side the PM.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

+1

@tillh-stripe tillh-stripe merged commit d3160db into master Sep 8, 2023
10 checks passed
@tillh-stripe tillh-stripe deleted the tillh/cash-app-pay-setup-intents branch September 8, 2023 15:09
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

4 participants