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

Use CardBrand enum to represent the card brand #1998

Merged
merged 1 commit into from
Dec 24, 2019
Merged

Conversation

mshafrir-stripe
Copy link
Collaborator

Summary

This is a breaking change.

  • Make Card#brand a CardBrand instead of String?
  • Make SourceCardData#brand a CardBrand instead of String?
  • Update CardUtils methods to take a CardBrand instead of String
  • Remove Card.CardBrand
  • Remove Card#asCardBrand(); use CardBrand.fromCode() instead
  • Use CardBrand internally in CardInputWidget and CardMultilineWidget

Motivation

Consolidate logic related to the card brand.

Testing

Unit tests and manual verification

This change consolidates logic related to the card brand
in one class. This is a breaking change.

- Make `Card#brand` a `CardBrand` instead of `String?`
- Make `SourceCardData#brand` a `CardBrand` instead of `String?`
- Update `CardUtils` methods to take a `CardBrand` instead of `String`
- Remove `Card.CardBrand`
- Remove `Card#asCardBrand()`; use `CardBrand.fromCode()` instead
- Use `CardBrand` internally in `CardInputWidget` and `CardMultilineWidget`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants