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

Fixed an issue where certain cobranded cards showed a generic card ic… #3731

Merged
merged 2 commits into from
Jul 1, 2024

Conversation

yuki-stripe
Copy link
Collaborator

…on instead of using the other card brand

Summary

We only use "preferred" card brand for icon. If it's unknown, we should fall back to the brand. This appears to match what Stripe.js does.
Example: 4000050360000001 preferred brand is eftpos_australia and brand is visa. We show an unknown icon but stripe.js shows a visa icon.

Motivation

https://docs.google.com/document/d/1tRLvYH4_UzRGevJuP15gU4SlU5zt9_pJBZtiOSMxy6A/edit search "AU Saved Payment Icon"

Testing

Manually tested, added unit test.

Changelog

See changelog

porter-stripe
porter-stripe previously approved these changes Jun 28, 2024
@@ -55,14 +55,20 @@ extension PaymentOption {
}

extension STPPaymentMethod {
/// Returns the first non-unknown card brand, prioritizing the card's preferred network brand > display brand > brand
func calculateCardBrandToDisplay() -> STPCardBrand {
Copy link
Collaborator

Choose a reason for hiding this comment

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

ah clever!

Copy link

emerge-tools bot commented Jun 28, 2024

📸 Snapshot Test

No snapshots generated

Name Version Added Removed Modified Unchanged Errored Approval
StripeSize
com.stripe.StripeSize
1.0 (1) 0 0 0 0 0 N/A
StripePaymentSheetSize
com.stripe.StripePaymentSheetSize
1.0 (1) 0 0 0 0 0 N/A
StripePaymentsSize
com.stripe.StripePaymentsSize
1.0 (1) 0 0 0 0 0 N/A
StripePaymentsUISize
com.stripe.StripePaymentsUISize
1.0 (1) 0 0 0 0 0 N/A
StripeApplePaySize
com.stripe.StripeApplePaySize
1.0 (1) 0 0 0 0 0 N/A
StripeFinancialConnectionsSize
com.stripe.StripeFinancialConnectionsSize
1.0 (1) 0 0 0 0 0 N/A

🛸 Powered by Emerge Tools

@yuki-stripe yuki-stripe merged commit 625ea01 into master Jul 1, 2024
4 checks passed
@yuki-stripe yuki-stripe deleted the yuki/fix-display-brand-image branch July 1, 2024 15:40
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

2 participants