braintree / android-card-form

A ready-made card form layout that can be included in your Android app, making it easy to accept credit and debit cards.
MIT License
366 stars 128 forks source link

Update to set ccv length #45

Closed amolood closed 6 years ago

amolood commented 6 years ago

Update to set ccv length from any where :)

crookedneighbor commented 6 years ago

Can you explain why you think the sdk needs this functionality?

Right now, if there is no card number present, it defaults the security code length to 3 (as all but American Express have security codes of length 3). When an American Express card is detected, it automatically sets the max length to 4.

amolood commented 6 years ago

IF someone want to use it with local payment gateway like i do , the length of ccv code is 4

crookedneighbor commented 6 years ago

Can you explain that a little more?

quinnjn commented 6 years ago

The payment gateway wouldn't matter since those card types are defined in this library. There are no external dependencies notifying android-card-form for the CVV length.

We have defined card types that know their CVV length. We wouldn't want CVV length set to any length except what the card type tells us. So allowing the consumer to update it dynamically doesn't make sense for CVV length.

I think we need more detail on the problem we're trying to solve in this PR. I'm going to close this for now. If you can give us a more detailed use case we can help guide you to submitting a PR to fix the problem!

amolood commented 6 years ago

@crookedneighbor I'm form sudan , in sudan we have local card Like "Visacard" but local and the length of the ccv is 4 , so i hope we can use this library , and set the card icon + ccv length

crookedneighbor commented 6 years ago

I think for your use case, you would be better served to use your fork of the repo and edit the Card Type file https://github.com/braintree/android-card-form/blob/ab72e02ae81cd5229598abf49cb39a5d2bcfd57a/CardForm/src/main/java/com/braintreepayments/cardform/utils/CardType.java