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 konbini to PaymentSheet. #7308

Merged
merged 8 commits into from
Sep 15, 2023
Merged

Add konbini to PaymentSheet. #7308

merged 8 commits into from
Sep 15, 2023

Conversation

jaynewstrom-stripe
Copy link
Collaborator

@jaynewstrom-stripe jaynewstrom-stripe commented Sep 13, 2023

Summary

Note both Checkout and web PE don't use their normal 'phone number' field to collect it - it's just a normal text field (11 digits max, numbers only) and doesn't interact with merchant configuration related to the collection of a phone number (e.g. Checkout shows a separate phone field if you tell it to collect a phone number).

Motivation

LPM Sprint

Screen_recording_20230914_093653.webm

@github-actions
Copy link
Contributor

github-actions bot commented Sep 13, 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 │ +2.2 KiB │   7.7 MiB │   7.7 MiB │ +4.1 KiB 
     arsc │   2.2 MiB │   2.2 MiB │ +1.3 KiB │   2.2 MiB │   2.2 MiB │ +1.3 KiB 
 manifest │   4.9 KiB │   4.9 KiB │      0 B │  24.2 KiB │  24.2 KiB │      0 B 
      res │ 884.7 KiB │ 885.7 KiB │   +989 B │   1.4 MiB │   1.4 MiB │ +2.7 KiB 
   native │   2.6 MiB │   2.6 MiB │      0 B │     6 MiB │     6 MiB │      0 B 
    asset │     3 MiB │     3 MiB │ +1.3 KiB │     3 MiB │     3 MiB │ +1.6 KiB 
    other │ 200.1 KiB │ 200.2 KiB │    +72 B │ 448.2 KiB │ 448.4 KiB │   +164 B 
──────────┼───────────┼───────────┼──────────┼───────────┼───────────┼──────────
    total │  12.3 MiB │  12.3 MiB │ +5.8 KiB │  20.7 MiB │  20.7 MiB │ +9.9 KiB 

 DEX     │ old   │ new   │ diff              
─────────┼───────┼───────┼───────────────────
   files │     1 │     1 │   0               
 strings │ 38333 │ 38363 │ +30 (+73 -43)     
   types │ 12692 │ 12703 │ +11 (+49 -38)     
 classes │ 10716 │ 10724 │  +8 (+14 -6)      
 methods │ 55936 │ 55967 │ +31 (+3465 -3434) 
  fields │ 35256 │ 35301 │ +45 (+1695 -1650) 

 ARSC    │ old  │ new  │ diff       
─────────┼──────┼──────┼────────────
 configs │  290 │  290 │  0         
 entries │ 6947 │ 6950 │ +3 (+3 -0)
APK
     compressed      │     uncompressed     │                                
──────────┬──────────┼───────────┬──────────┤                                
 size     │ diff     │ size      │ diff     │ path                           
──────────┼──────────┼───────────┼──────────┼────────────────────────────────
  3.5 MiB │ +2.2 KiB │   7.7 MiB │ +4.1 KiB │ ∆ classes.dex                  
  2.2 MiB │ +1.3 KiB │   2.2 MiB │ +1.3 KiB │ ∆ resources.arsc               
  6.4 KiB │ +1.2 KiB │   6.2 KiB │ +1.2 KiB │ ∆ assets/dexopt/baseline.prof  
    993 B │   +993 B │   2.7 KiB │ +2.7 KiB │ + res/em.xml                   
 48.6 KiB │    +39 B │ 141.6 KiB │    +82 B │ ∆ META-INF/MANIFEST.MF         
   63 KiB │    +34 B │ 141.6 KiB │    +82 B │ ∆ META-INF/CERT.SF             
  2.9 KiB │    +22 B │  24.3 KiB │   +364 B │ ∆ assets/lpms.json             
    760 B │     -1 B │     628 B │     -1 B │ ∆ assets/dexopt/baseline.profm 
    849 B │     -1 B │   1.8 KiB │      0 B │ ∆ res/8Q.xml                   
    838 B │     -1 B │   1.8 KiB │      0 B │ ∆ res/So.xml                   
    949 B │     -1 B │   2.5 KiB │      0 B │ ∆ res/de.xml                   
    998 B │     -1 B │   2.8 KiB │      0 B │ ∆ res/nn.xml                   
  1.2 KiB │     -1 B │   1.2 KiB │      0 B │ ∆ META-INF/CERT.RSA            
──────────┼──────────┼───────────┼──────────┼────────────────────────────────
  5.8 MiB │ +5.8 KiB │  10.2 MiB │ +9.9 KiB │ (total)
DEX
STRINGS:

   old   │ new   │ diff          
  ───────┼───────┼───────────────
   38333 │ 38363 │ +30 (+73 -43) 
  + ChallengeAdditionalAuth
  + ChallengeDecoupledAuth
  + DisplayKonbiniDetails
  + DisplayKonbiniDetails(hostedVoucherUrl=
  + InformationOnly
  + JPY
  + Konbini
  + Konbini(confirmationNumber=
  + Lad/n5;
  + Lad/o5;
  + Lad/p5;
  + Lbd/d0;
  + Lcf/w;
  + Ldg/g7;
  + Ldg/h7;
  + Ldg/i7;
  + Lhf/p1;
  + Lid/m;
  + Lj5/f1;
  + Lle/s;
  + Lp0/m1;
  + Lwf/k;
  + VLILLZI
  + VerificationAttempted
  + VerificationDenied
  + VerificationNotPerformed
  + VerificationRejected
  + VerificationSuccessful
  + [Lad/a4;
  + [Lad/b5;
  + [Lad/f5;
  + [Lad/g5;
  + [Lad/k3;
  + [Lad/k4;
  + [Lad/m3;
  + [Lad/n5;
  + [Lad/o5;
  + [Lad/p5;
  + [Lcd/a;
  + [Lcf/n;
  + [Lcf/u;
  + [Lcf/w;
  + [Ldf/d;
  + [Ldf/k;
  + [Ldg/c7;
  + [Ldg/k5;
  + [Lhf/p1;
  + [Lhf/u0;
  + [Lhf/w0;
  + [Lid/g;
  + [Lid/l;
  + [Lif/b;
  + [Lif/f;
  + [Lp0/n0;
  + [Lpd/o1;
  + [Lpd/t1;
  + [Lpd/w0;
  + [Lqd/i;
  + [Lqd/q;
  + [Lqd/r;
  + [Lqd/u;
  + [Lqg/h;
  + [Lzf/d;
  + com.stripe.android.ui.core.elements.KonbiniConfirmationNumberSpec
  + confirmationNumber
  + confirmation_number
  + konbini
  + konbini[confirmation_number]
  + konbini_confirmation_number
  + konbini_display_details
  + null cannot be cast to non-null type com.stripe.android.model.StripeIntent.NextActionData.DisplayKonbiniDetails
  + null hostedVoucherUrl for DisplayKonbiniDetails
  + ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:ea7330b,r8-mode:full,version:8.1.65}
  
  - Lcd/h;
  - Ldf/m;
  - Lif/j;
  - Lkd/p;
  - Loh/p;
  - Lzf/q;
  - [Lad/d5;
  - [Lad/i5;
  - [Lad/k5;
  - [Lad/l3;
  - [Lad/l4;
  - [Lad/m5;
  - [Lad/n3;
  - [Lad/z3;
  - [Lcd/g;
  - [Lcf/m;
  - [Lcf/t;
  - [Lcf/v;
  - [Ldf/i;
  - [Ldf/l;
  - [Ldg/h5;
  - [Ldg/z6;
  - [Lhf/t0;
  - [Lhf/v0;
  - [Lid/f;
  - [Lid/h;
  - [Lif/e;
  - [Lif/j;
  - [Lp0/m0;
  - [Lpd/m1;
  - [Lpd/s1;
  - [Lpd/v0;
  - [Lqd/h;
  - [Lqd/n;
  - [Lqd/o;
  - [Lqd/s;
  - [Lqg/f;
  - [Lzf/e;
  - _values
  - e2
  - f2
  - g2
  - ~~R8{backend:dex,compilation-mode:release,has-checksums:false,min-api:21,pg-map-id:7099102,r8-mode:full,version:8.1.65}
  

TYPES:

   old   │ new   │ diff          
  ───────┼───────┼───────────────
   12692 │ 12703 │ +11 (+49 -38) 
  + Lad/n5;
  + Lad/o5;
  + Lad/p5;
  + Lbd/d0;
  + Lcf/w;
  + Ldg/g7;
  + Ldg/h7;
  + Ldg/i7;
  + Lhf/p1;
  + Lid/m;
  + Lj5/f1;
  + Lle/s;
  + Lp0/m1;
  + Lwf/k;
  + [Lad/a4;
  + [Lad/b5;
  + [Lad/f5;
  + [Lad/g5;
  + [Lad/k3;
  + [Lad/k4;
  + [Lad/m3;
  + [Lad/n5;
  + [Lad/o5;
  + [Lad/p5;
  + [Lcd/a;
  + [Lcf/n;
  + [Lcf/u;
  + [Lcf/w;
  + [Ldf/d;
  + [Ldf/k;
  + [Ldg/c7;
  + [Ldg/k5;
  + [Lhf/p1;
  + [Lhf/u0;
  + [Lhf/w0;
  + [Lid/g;
  + [Lid/l;
  + [Lif/b;
  + [Lif/f;
  + [Lp0/n0;
  + [Lpd/o1;
  + [Lpd/t1;
  + [Lpd/w0;
  + [Lqd/i;
  + [Lqd/q;
  + [Lqd/r;
  + [Lqd/u;
  + [Lqg/h;
  + [Lzf/d;
  
  - Lcd/h;
  - Ldf/m;
  - Lif/j;
  - Lkd/p;
  - Loh/p;
  - Lzf/q;
  - [Lad/d5;
  - [Lad/i5;
  - [Lad/k5;
  - [Lad/l3;
  - [Lad/l4;
  - [Lad/m5;
  - [Lad/n3;
  - [Lad/z3;
  - [Lcd/g;
  - [Lcf/m;
  - [Lcf/t;
  - [Lcf/v;
  - [Ldf/i;
  - [Ldf/l;
  - [Ldg/h5;
  - [Ldg/z6;
  - [Lhf/t0;
  - [Lhf/v0;
  - [Lid/f;
  - [Lid/h;
  - [Lif/e;
  - [Lif/j;
  - [Lp0/m0;
  - [Lpd/m1;
  - [Lpd/s1;
  - [Lpd/v0;
  - [Lqd/h;
  - [Lqd/n;
  - [Lqd/o;
  - [Lqd/s;
  - [Lqg/f;
  - [Lzf/e;
  

METHODS:

   old   │ new   │ diff              
  ───────┼───────┼───────────────────
   55936 │ 55967 │ +31 (+3465 -3434) 
  + a0.p A(e, e, m, i, int, int)
  + a0.p A0(int) → boolean
  + a0.p B(m, h, e, i, int, int)
  + a0.p B0() → Handler
  + a0.p C(boolean, r2, m, Set, t0, int, int, i, int, int)
  + a0.p C0(h0) → LifecycleCoroutineScopeImpl
  + a0.p D(e1, String, String, String, String, a, a, i, int, int)
  + a0.p D0(d) → d
  + a0.p E(float, float) → long
  + a0.p F(boolean, k, x, i, int)
  + a0.p G(i, int)
  + a0.p H(n, a, i, int)
  + a0.p I(float, boolean) → long
  + a0.p J(Throwable, a, a, c, i, int)
  + a0.p K(b, y2, j, a, i, int)
  + a0.p L(int, String, s, boolean, long, i, int)
  + a0.p M(e, e, i, int)
  + a0.p N(f, l)
  + a0.p O(m0, a) → int
  + a0.p P(long, long) → e
  + a0.p Q(int, float, float, float, float[]) → float
  + a0.p Q0(i, int) → l
  + a0.p R(i, int) → l
  + a0.p R0(l, a)
  + a0.p S(d0) → k
  + a0.p S0(int, int, long) → long
  + a0.p T(Size, Size) → Size
  + a0.p T0(JSONObject) → h
  + a0.p U(d0, f, c)
  + a0.p U0(JSONObject) → l
...✂
ARSC
ENTRIES:

   old  │ new  │ diff       
  ──────┼──────┼────────────
   6947 │ 6950 │ +3 (+3 -0) 
  + drawable/stripe_ic_paymentsheet_pm_konbini
  + string/stripe_konbini_confirmation_number_label
  + string/stripe_paymentsheet_payment_method_konbini

@@ -52,6 +53,11 @@ class FieldValuesToParamsMapConverter {
blikCode
)
}
} else if (code == PaymentMethod.Type.Konbini.code) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This special casing kills me. But it seemed out of scope to refactor this while adding it. We should discuss what it would take to make this better as a follow up.

@jaynewstrom-stripe jaynewstrom-stripe marked this pull request as ready for review September 14, 2023 15:37
@jaynewstrom-stripe jaynewstrom-stripe requested review from a team as code owners September 14, 2023 15:37
Comment on lines +80 to +81
<!-- Label for Konbini Payment Method -->
<string name="stripe_paymentsheet_payment_method_konbini">Konbini</string>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be in the no-translate file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is translated differently in Japanese.

@@ -102,6 +102,9 @@ internal class ConfirmPaymentIntentParamsFactory(
PaymentMethod.Type.Blik.code -> {
optionsParams
}
PaymentMethod.Type.Konbini.code -> {
optionsParams
Copy link
Collaborator

Choose a reason for hiding this comment

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

Marking this for a future refactor.

Comment on lines +204 to +206
/**
* URL of a webpage containing the voucher for this payment.
*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
/**
* URL of a webpage containing the voucher for this payment.
*/

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In theory we could expose this for bindings. I just copied what the others did.

// nextActionData.hostedVoucherUrl will never be null as AuthenticatorRegistry won't direct it here
authUrl = nextActionData.hostedVoucherUrl.takeIf { it!!.isNotEmpty() }
?: throw IllegalArgumentException("null hostedVoucherUrl for DisplayKonbiniDetails")
returnUrl = null
Copy link
Collaborator

Choose a reason for hiding this comment

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

Providing a return URL would cause this to be opened in a Chrome Custom Tab instead of a web view. Should we do that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is what the other vouchers do, so I just kept with it.

Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably start using CCT.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Are you peaceful if I leave it like this for this PR and submit a new PR to update all voucher based LPMs to switch to CCT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Or rather, what's the motivation?

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe for one-click auth to be enabled, we need CCT.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I think some payment methods are using CCT while others are using webview right? For example, bancontact uses CCT.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These wouldn't have auth though, you'd need to take them to a different app, or to a physical location, so they wouldn't benefit from that.


internal val KonbiniRequirement = PaymentMethodRequirements(
piRequirements = setOf(Delayed),
siRequirements = setOf(Delayed),
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this correct? I thought SI is not supported?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch. Thanks!

internal val KonbiniRequirement = PaymentMethodRequirements(
piRequirements = setOf(Delayed),
siRequirements = null,
confirmPMFromCustomer = true,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we also don't want this to be true

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🤦 thank you

@jaynewstrom-stripe jaynewstrom-stripe merged commit 000e026 into master Sep 15, 2023
@jaynewstrom-stripe jaynewstrom-stripe deleted the jaynewstrom/konbini branch September 15, 2023 14:08
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.

3 participants