stripe / stripe-ios

Stripe iOS SDK
https://stripe.com
MIT License
2.12k stars 979 forks source link

Any chance to have Card Icons in public API? #263

Closed delebedev closed 8 years ago

delebedev commented 9 years ago

I'm using STPPaymentCardTextField which is really handy, but now I have 2 sets of card icons in my app. Do you think is it worth to expose them?

jflinter commented 9 years ago

Hey there! That makes a lot of sense; we'll open up an API for them in a future release. In the meantime, you should be able to load them as follows:

[UIImage imageNamed:imageName inBundle:[NSBundle bundleForClass:[STPAPIClient class]] compatibleWithTraitCollection:nil];

where imageName is one of stp_card_amex, stp_card_diners, stp_card_jcb, stp_card_mastercard, stp_card_visa.

bradfol commented 8 years ago

@garnett I have submitted #284 to expose class methods that will return UIImages for each STPCardBrand.

jflinter commented 8 years ago

Hey @garnett, we've added some additional helper methods in the 6.1.0 release - hope this gives you what you're looking for. Cheers!