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

Draft
wants to merge 6 commits into
base: master
Choose a base branch
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

🚨 New dead code detected in this PR:

{
  "TextFieldElement+Card.swift_isDisallowedBrand": "TextFieldElement+Card.swift: warning: isDisallowedBrand is unused"
}

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, make sure your branch is up-to-date with master.

Copy link

emerge-tools bot commented Oct 4, 2024

⚠️ 5 new unused protocols, 6 builds decreased size

Name Version Download Change Install Change Approval
StripeSize
com.stripe.StripeSize
1.0 (1) 2.4 MB ⬇️ 4.9 kB (-0.2%) 7.8 MB ⬇️ 12.6 kB (-0.16%) N/A
StripeApplePaySize
com.stripe.StripeApplePaySize
1.0 (1) 432.6 kB ⬇️ 2.0 kB (-0.46%) 1.5 MB ⬇️ 4.2 kB (-0.28%) N/A
StripeFinancialConnectionsSize
com.stripe.StripeFinancialConnectionsSize
1.0 (1) 1.3 MB ⬇️ 6.3 kB (-0.48%) 4.3 MB ⬇️ 13.6 kB (-0.32%) N/A
StripePaymentsSize
com.stripe.StripePaymentsSize
1.0 (1) 1.1 MB ⬇️ 4.0 kB (-0.35%) 4.1 MB ⬇️ 6.3 kB (-0.16%) N/A
StripePaymentsUISize
com.stripe.StripePaymentsUISize
1.0 (1) 1.9 MB ⬇️ 3.4 kB (-0.18%) 6.3 MB ⬇️ 7.9 kB (-0.13%) N/A
StripePaymentSheetSize
com.stripe.StripePaymentSheetSize
1.0 (1) 3.4 MB ⬇️ 11.4 kB (-0.33%) 10.2 MB ⬇️ 29.6 kB (-0.29%) N/A

StripeSize 1.0 (1)
com.stripe.StripeSize

⚠️ Found new unused protocol: InstantDebitsLinkedBank
⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬇️ 12.6 kB (-0.16%)
Total download size change: ⬇️ 4.9 kB (-0.2%)

Largest size changes

Item Install Size Change
StripePayments.STPBankAccountCollector.collectBankAccountForSetup... ⬇️ -1.5 kB
StripeUICore.TextFieldElement.BlikCodeConfiguration.value witness ⬇️ -1.1 kB
DYLD.Exports ⬇️ -960 B
StripePayments.STPBankAccountCollector.collectBankAccountForPayme... ⬇️ -844 B
🗑 StripeCore.FinancialConnectionsLinkedBank.value witness ⬇️ -740 B
View Treemap

Image of diff

StripeApplePaySize 1.0 (1)
com.stripe.StripeApplePaySize

⚠️ Found new unused protocol: InstantDebitsLinkedBank
⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬇️ 4.2 kB (-0.28%)
Total download size change: ⬇️ 2.0 kB (-0.46%)

Largest size changes

Item Install Size Change
🗑 StripeCore.FinancialConnectionsLinkedBank.value witness ⬇️ -740 B
DYLD.Exports ⬇️ -736 B
🗑 StripeCore.InstantDebitsLinkedBank.value witness ⬇️ -552 B
Other ⬇️ -2.2 kB
View Treemap

Image of diff

StripeFinancialConnectionsSize 1.0 (1)
com.stripe.StripeFinancialConnectionsSize

⚠️ Found new unused protocol: InstantDebitsLinkedBank
⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬇️ 13.6 kB (-0.32%)
Total download size change: ⬇️ 6.3 kB (-0.48%)

Largest size changes

Item Install Size Change
🗑 StripeFinancialConnections.NativeFlowAPIDataManager.init(manifest... ⬇️ -2.8 kB
📝 StripeFinancialConnections.NativeFlowAPIDataManager.init(manifest... ⬆️ 2.8 kB
🗑 StripeFinancialConnections.FinancialConnectionsSharePaymentDetail... ⬇️ -1.7 kB
StripeFinancialConnections.FinancialConnectionsWebFlowViewControl... ⬇️ -1.4 kB
🗑 StripeFinancialConnections.Completed ⬇️ -1.4 kB
View Treemap

Image of diff

StripePaymentsSize 1.0 (1)
com.stripe.StripePaymentsSize

⚠️ 2 new unused protocols: InstantDebitsLinkedBank and FinancialConnectionsLinkedBank
⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬇️ 6.3 kB (-0.16%)
Total download size change: ⬇️ 4.0 kB (-0.35%)

Largest size changes

Item Install Size Change
StripePayments.STPBankAccountCollector.collectBankAccountForSetup... ⬇️ -1.5 kB
StripePayments.STPBankAccountCollector.collectBankAccountForPayme... ⬇️ -844 B
DYLD.Exports ⬇️ -744 B
🗑 StripeCore.FinancialConnectionsLinkedBank.value witness ⬇️ -740 B
📝 StripePayments.StubbedFinancialConnectionsLinkedBank.value witnes... ⬆️ 740 B
View Treemap

Image of diff

StripePaymentsUISize 1.0 (1)
com.stripe.StripePaymentsUISize

⚠️ Found new unused protocol: InstantDebitsLinkedBank
⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬇️ 7.9 kB (-0.13%)
Total download size change: ⬇️ 3.4 kB (-0.18%)

Largest size changes

Item Install Size Change
StripePayments.STPBankAccountCollector.collectBankAccountForSetup... ⬇️ -1.5 kB
StripeUICore.TextFieldElement.BlikCodeConfiguration.value witness ⬇️ -1.1 kB
StripePayments.STPBankAccountCollector.collectBankAccountForPayme... ⬇️ -844 B
DYLD.Exports ⬇️ -824 B
🗑 StripeCore.FinancialConnectionsLinkedBank.value witness ⬇️ -740 B
View Treemap

Image of diff

StripePaymentSheetSize 1.0 (1)
com.stripe.StripePaymentSheetSize

⚖️ Compare build
⏱️ Analyze build performance

Total install size change: ⬇️ 29.6 kB (-0.29%)
Total download size change: ⬇️ 11.4 kB (-0.33%)

Largest size changes

Item Install Size Change
📝 StripePaymentSheet.CardSectionElement.init(collectName,defaultVal... ⬆️ 8.2 kB
🗑 StripePaymentSheet.CardSectionElement.init(collectName,defaultVal... ⬇️ -8.0 kB
🗑 StripePaymentSheet.EmbeddedPaymentMethodsView.init(initialSelecti... ⬇️ -7.4 kB
📝 StripePaymentSheet.USBankAccountPaymentMethodElement.init(configu... ⬆️ 4.0 kB
📝 StripePaymentSheet.EmbeddedPaymentMethodsView.init(paymentMethodT... ⬆️ 3.8 kB
View Treemap

Image of diff


🛸 Powered by Emerge Tools

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.

1 participant