stripe-android icon indicating copy to clipboard operation
stripe-android copied to clipboard

Use Stripe callback for extreme customization of card number filling

Open pvarry opened this issue 6 years ago • 7 comments

For my app I need to create completely custom interface to fill new credit card number, with two line style and boxed text fields. After that I need some code to interact with those elements and Stripe team (thanks ❤️) have already done a part of that work but the interesting part is tagged as private.

So I would like to know if its possible to make brandChangeCallback and completionCallback of CardNumberEditText public to be used directly in my code. (It will be ever more interesting to have a shouldShowErrorCallback.) And finally I don't if its a good idea to make strings ressource like card_number_hint, expiry_date_hint, valid_digits, etc. public ?

Basically it's to help us to make beautiful interfaces with the power of Stripe.

Summary

Make some methods public :

  • brandChangeCallback
  • completionCallback

Male some ressource public :

  • card_number_hint
  • expiry_date_hint
  • cvc_multiline_helper_amex
  • cvc_multiline_helper
  • valid_digits

If possible create a new callback in CardNumberEditText :

  • shouldShowErrorCallback

pvarry avatar Jan 08 '20 15:01 pvarry

Gonna defer to @mshafrir-stripe on this :)

csabol-stripe avatar Jan 09 '20 23:01 csabol-stripe

Hello @mshafrir-stripe, I would to know if you have any news about this feature request ?

pvarry avatar Jan 14 '20 17:01 pvarry

@pvarry thanks for filing. As far as accessing Stripe string resources, they should be available via com.stripe.android.R, e.g. com.stripe.android.R.string.card_number_hint.

For making methods public and adding new callbacks, I can investigate that.

mshafrir-stripe avatar Jan 23 '20 14:01 mshafrir-stripe

Thanks for your answer.

Yes, I use this ressource like you say but Android Studio give me a warning as follow : image

pvarry avatar Jan 23 '20 14:01 pvarry

Hello, do you have any news about this issue ? @mshafrir-stripe @smaskell-stripe

pvarry avatar Aug 26 '20 09:08 pvarry

Hey @pvarry. @mshafrir-stripe is currently working some changes to our card brand logic but is on vacation this week. We can discuss this when he returns.

As for the resource issue, it looks like we made most of our resources private years ago to avoid naming conflicts (see #424). We may need to revisit our strategy here. This is something we can discuss as well, though we don't have anything to share right now.

Thanks for bearing with us!

smaskell-stripe avatar Aug 26 '20 19:08 smaskell-stripe

I'm very sorry about this, but we don't intend to make these methods and resources public. For truly custom UI, it may make more sense for you to fork this package. (But keep in mind PCI compliance: Visit the Mobile SDK section of our Integration security guide for details.)

davidme-stripe avatar Aug 04 '22 18:08 davidme-stripe