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

STPCard.brandFromString Deprecation #800

Closed
crontab opened this issue Sep 21, 2017 · 4 comments
Closed

STPCard.brandFromString Deprecation #800

crontab opened this issue Sep 21, 2017 · 4 comments

Comments

@crontab
Copy link

crontab commented Sep 21, 2017

+ (STPCardBrand)brandFromString:(NSString *)string DEPRECATED_ATTRIBUTE;

This useful function is now deprecated, what is the suggested alternative?

@joeydong-stripe
Copy link
Contributor

Hi @crontab, thanks for opening an issue.

We originally publicized this method unintentionally and recently decided to deprecate it because we didn't understand the use case for it. In particular, the string values are specific to the Stripe API which is tricky to handle. We primarily expect developers to use the [STPCard brand] method and STPCardBrand enum instead of passing the string value around.

Can you give us some information about how you are/will be using this method?

@crontab
Copy link
Author

crontab commented Sep 21, 2017

Hi @joeydong-stripe

Our mobile app receives the card brand strings from our backend which in turn receives them from Stripe. The app among other things uses these strings to display card images to the user using your other API functions. Thus the string-to-numericID translation should happen somewhere, i.e. either on our backend (which we are a bit reluctant to do at the moment) or on the frontend/mobile side. This function did just that for us.

@joeydong-stripe
Copy link
Contributor

joeydong-stripe commented Sep 21, 2017

Thanks for the extra context! This is definitely a tricky problem.

We had some discussions and although there could be a problem relying on this method if the Stripe API changes the brand identifiers, it is unlikely to happen. Therefore, we've decided to un-deprecate this method.

Please see pull request #801

@joeydong-stripe
Copy link
Contributor

We've merged #801. The method will be un-marked as deprecated in the next release. Thanks again!

mludowise-stripe pushed a commit that referenced this issue Mar 13, 2022
…nd color (#800)

* Add PaymentSheetAppearance

* Migrate background color to PaymentSheetAppearance

* Try to fix namespace

* Add TODO

* Refactor primary color

* Fix checkbox stroke color

* Add comment

* Fix tests

* Default checkbox stroke to black

* Update Stripe/PaymentSheetAppearance.swift

Co-authored-by: Yuki <[email protected]>

* Group appearance APIs, remove didSet as well

* Make checkbox black stroke

* Revert change on primaryButtonColor

* Add TOOD comment

* Re-record tests

* Update check circle background to match appearance primary

* 🎨  Text, secondary text, icon, danger, border, componentBackground colors (#821)

* Refactor text color

* primary and secondary text color refactor

* refactor for icon color

* dangerColor, componentBorderColor, componentBackgroundColor

* Audit changes thus far

* Refactor for componentDividerColor

* Refactor corner radius

* Border width refactor

* Set corner radius on link button

* Refactor for shadows

* Revert "Refactor for componentDividerColor"

This reverts commit 028ebfc60934ac58ae4b57251c7f0cb9a86de6da.

* Revert form element changes

* Revert sepa mandate change, update checkbox stroke

* Little bit more clean up

* Fix build issue

* Fill checkbox with componentBackground

* Set border on checkbox

* Set checkbox label color

* Fix shadow corner radius

* Fix build issue

* Update snapshots

* update checkbox snapshot tests

* comment out record

* Don't modify link appearance

* update link snapshot tests

* update snapshots

* PR feedback

* Make link checkbox blue

* update new snapshot tests :/

* Update snapshots from latest

* Fix test

* Record dark mode tests

Co-authored-by: Yuki <[email protected]>
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

No branches or pull requests

2 participants