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

[DRAFT] Card brand filtering for PAN and saved payment methods #4056

Closed
wants to merge 10 commits into from

Conversation

porter-stripe
Copy link
Collaborator

@porter-stripe porter-stripe commented Sep 25, 2024

Summary

  • Adds the CBF public API to PaymentSheet and CustomerSheet under SPI
  • Adds unit and UI tests
  • Updates playground with a CBF toggle
  • Filters cards in the card text field based on brand
  • Hides saved payment methods of cards with disallowed brands

In a future PR:

  • Filter card networks in Apple Pay
  • Filter card brands in CBC dropdown

Motivation

https://docs.google.com/document/d/1DD7mncHsHbMtU_jqr_TnaLL8ltjO61pPmdOAlJXxYHY/edit

Testing

  • Manual
  • Unit tests
  • UI tests

Changelog

N/A for now

Copy link

github-actions bot commented Sep 27, 2024

🚨 New dead code detected in this PR:

CardSectionElement.swift:63 warning: Property 'cardBrandFilter' is assigned, but never used

Please remove the dead code before merging.

If this is intentional, you can bypass this check by adding the label skip dead code check to this PR.

ℹ️ If this comment appears to be left in error, double check that the flagged code is actually used and/or make sure your branch is up-to-date with master.

Copy link

emerge-tools bot commented Oct 4, 2024

6 builds increased size

Name Version Download Change Install Change Approval
StripeSize
com.stripe.StripeSize
1.0 (1) 2.4 MB ⬆️ 62 B 7.8 MB ⬆️ 172 B N/A
StripeApplePaySize
com.stripe.StripeApplePaySize
1.0 (1) 434.7 kB ⬆️ 93 B (0.02%) 1.5 MB ⬆️ 112 B N/A
StripeFinancialConnectionsSize
com.stripe.StripeFinancialConnectionsSize
1.0 (1) 1.3 MB ⬆️ 305 B (0.02%) 4.3 MB ⬆️ 112 B N/A
StripePaymentsSize
com.stripe.StripePaymentsSize
1.0 (1) 1.1 MB ⬇️ 88 B 4.1 MB ⬆️ 112 B N/A
StripePaymentsUISize
com.stripe.StripePaymentsUISize
1.0 (1) 1.9 MB ⬇️ 2.1 kB (-0.11%) 6.3 MB ⬆️ 172 B N/A
StripePaymentSheetSize
com.stripe.StripePaymentSheetSize
1.0 (1) 3.4 MB ⬆️ 7.6 kB (0.22%) 10.3 MB ⬆️ 11.9 kB (0.12%) N/A

StripeSize 1.0 (1)
com.stripe.StripeSize

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 172 B
Total download size change: ⬆️ 62 B

Largest size changes

Item Install Size Change
Other ⬆️ 172 B
View Treemap

Image of diff

StripeApplePaySize 1.0 (1)
com.stripe.StripeApplePaySize

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 112 B
Total download size change: ⬆️ 93 B (0.02%)

Largest size changes

Item Install Size Change
Other ⬆️ 112 B
View Treemap

Image of diff

StripeFinancialConnectionsSize 1.0 (1)
com.stripe.StripeFinancialConnectionsSize

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 112 B
Total download size change: ⬆️ 305 B (0.02%)

Largest size changes

Item Install Size Change
Other ⬆️ 112 B
View Treemap

Image of diff

StripePaymentsSize 1.0 (1)
com.stripe.StripePaymentsSize

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 112 B
Total download size change: ⬇️ 88 B

Largest size changes

Item Install Size Change
Other ⬆️ 112 B
View Treemap

Image of diff

StripePaymentsUISize 1.0 (1)
com.stripe.StripePaymentsUISize

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 172 B
Total download size change: ⬇️ 2.1 kB (-0.11%)

Largest size changes

Item Install Size Change
Other ⬆️ 172 B
View Treemap

Image of diff

StripePaymentSheetSize 1.0 (1)
com.stripe.StripePaymentSheetSize

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬆️ 11.9 kB (0.12%)
Total download size change: ⬆️ 7.6 kB (0.22%)

Largest size changes

Item Install Size Change
📝 StripePaymentSheet.CardSectionElement.init(collectName,defaultVal... ⬆️ 8.0 kB
🗑 StripePaymentSheet.CardSectionElement.init(collectName,defaultVal... ⬇️ -8.0 kB
📝 StripePaymentSheet.CardBrandFilter.isAccepted(cardBrand) ⬆️ 916 B
DYLD.Exports ⬆️ 720 B
Other ⬆️ 10.3 kB
View Treemap

Image of diff


🛸 Powered by Emerge Tools

Copy link

github-actions bot commented Oct 6, 2024

⚠️ Missing Translations
The following strings have been uploaded to Lokalise but are not yet translated.

%1$@ is not accepted

If it's okay for these strings to be unlocalized in master (e.g. this is for an unshipped feature), add the label ship without translations to acknowledge that there are missing translations. Otherwise, wait until translations are available in Lokalise and re-run this job.

New strings are localized on a weekly basis and are downloaded as part of the release process. For more details on how to localize a string, you can refer to this link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant