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 synthetic payment method for LinkCardBrand #9288

Merged
merged 3 commits into from
Sep 23, 2024

Conversation

tillh-stripe
Copy link
Collaborator

@tillh-stripe tillh-stripe commented Sep 16, 2024

Summary

This pull request adds a “synthetic” payment method for LinkCardBrand.

We don’t receive the LinkCardBrand type as a payment method type in the intent, so we must add it after the fact in PaymentMethodMetadata.

Motivation

BANKCON-14522

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

Changelog

Copy link
Contributor

github-actions bot commented Sep 16, 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 │   1.9 MiB │   1.9 MiB │  0 B │     4 MiB │     4 MiB │  0 B 
     arsc │     1 MiB │     1 MiB │  0 B │     1 MiB │     1 MiB │  0 B 
 manifest │   2.3 KiB │   2.3 KiB │  0 B │     8 KiB │     8 KiB │  0 B 
      res │ 301.5 KiB │ 301.5 KiB │  0 B │   455 KiB │   455 KiB │  0 B 
   native │   6.2 MiB │   6.2 MiB │  0 B │  15.8 MiB │  15.8 MiB │  0 B 
    asset │   6.8 KiB │   6.8 KiB │  0 B │   6.5 KiB │   6.5 KiB │  0 B 
    other │  85.5 KiB │  85.5 KiB │ -2 B │ 158.7 KiB │ 158.7 KiB │  0 B 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
    total │   9.5 MiB │   9.5 MiB │ -2 B │  21.4 MiB │  21.4 MiB │  0 B 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 20244 │ 20244 │ 0 (+0 -0) 
   types │  6082 │  6082 │ 0 (+0 -0) 
 classes │  4886 │  4886 │ 0 (+0 -0) 
 methods │ 29462 │ 29462 │ 0 (+0 -0) 
  fields │ 17389 │ 17389 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  164 │  164 │  0   
 entries │ 3608 │ 3608 │  0
APK
   compressed    │   uncompressed   │                        
──────────┬──────┼───────────┬──────┤                        
 size     │ diff │ size      │ diff │ path                   
──────────┼──────┼───────────┼──────┼────────────────────────
 28.3 KiB │ -3 B │  62.6 KiB │  0 B │ ∆ META-INF/CERT.SF     
 25.1 KiB │ +1 B │  62.5 KiB │  0 B │ ∆ META-INF/MANIFEST.MF 
──────────┼──────┼───────────┼──────┼────────────────────────
 53.5 KiB │ -2 B │ 125.1 KiB │  0 B │ (total)

@tillh-stripe tillh-stripe force-pushed the tillh/link-synthetic-payment-method branch from 2a31812 to e1492e3 Compare September 16, 2024 22:21
@tillh-stripe tillh-stripe force-pushed the tillh/mpe-link-mode branch 3 times, most recently from 7c3a9c8 to b8c2541 Compare September 17, 2024 00:07
@tillh-stripe tillh-stripe force-pushed the tillh/link-synthetic-payment-method branch 4 times, most recently from b4f17c0 to 070b99b Compare September 18, 2024 17:01
Base automatically changed from tillh/mpe-link-mode to master September 18, 2024 19:03
@tillh-stripe tillh-stripe force-pushed the tillh/link-synthetic-payment-method branch 3 times, most recently from 4bf0eb2 to aefae6d Compare September 23, 2024 12:27
import com.stripe.android.uicore.elements.FormElement
import com.stripe.android.ui.core.R as PaymentsUiCoreR

internal object LinkCardBrandDefinition : PaymentMethodDefinition {
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 identical to InstantDebitsDefinition. Once we move the bank form to a proper UiDefinitionFactory, we can also deduplicate this.

@tillh-stripe tillh-stripe force-pushed the tillh/link-synthetic-payment-method branch from aa6968f to 941ec2c Compare September 23, 2024 14:11
@tillh-stripe tillh-stripe marked this pull request as ready for review September 23, 2024 14:12
@tillh-stripe tillh-stripe requested review from a team as code owners September 23, 2024 14:12
Copy link
Collaborator

Choose a reason for hiding this comment

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

I imagine these updated since US Bank Account wasn't in the list of supported payment method types?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That’s because of this change. It’ll only show up if linkMode == LinkCardBrand, and we’re restricting this to our test merchants for now.

samer-stripe
samer-stripe previously approved these changes Sep 23, 2024
}.filterNot {
}

val syntheticPaymentMethodTypes = listOf(LinkCardBrandDefinition).filter {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we model synthetics differently? It doesn't feel like this logic belongs here as is.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don’t see them as being very different from “normal” payment method definitions.

},

/** Requires that LinkCardBrand is possible for this transaction. */
LinkCardBrand {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to make sure they also have card as an available payment method?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, we only receive the LinkCardBrand mode if there’s a card type (see here).

@tillh-stripe tillh-stripe force-pushed the tillh/link-synthetic-payment-method branch from b0f7a69 to 25696f1 Compare September 23, 2024 20:00
@tillh-stripe tillh-stripe enabled auto-merge (squash) September 23, 2024 20:01
@tillh-stripe tillh-stripe merged commit 5ff7c54 into master Sep 23, 2024
13 checks passed
@tillh-stripe tillh-stripe deleted the tillh/link-synthetic-payment-method branch September 23, 2024 20:21
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