PaystackHQ / paystack-android

Paystack SDK for Android. Accept payments on Android
Apache License 2.0
126 stars 102 forks source link

Kindly make some static final Strings public #12

Closed stonekase closed 7 years ago

stonekase commented 7 years ago

Kindly make the below statics public to aid us not to recreate a job u have done twice in the class "Card". I had to recreate it so that my edittext text-watcher can update card type in realtime and to verify if card belongs to acceptable cards in Nigeria. publicstatic

static final String PATTERN_VISA = "^4[0-9]{6,}$"; static final String PATTERN_MASTERCARD = "^5[1-5][0-9]{5,}$"; static final String PATTERN_AMERICAN_EXPRESS = "^3[47][0-9]{5,}$"; static final String PATTERN_DINERS_CLUB = "^3(?:0[0-5]|[68][0-9])[0-9]{4,}$"; static final String PATTERN_DISCOVER = "^6(?:011|5[0-9]{2})[0-9]{3,}$"; static final String PATTERN_JCB = "^(?:2131|1800|35[0-9]{3})[0-9]{3,}$"; static final String PATTERN_VERVE = "^506[0-9]{6,}$";

ibrahimlawal commented 7 years ago

Ha, you are doing too much work :(

card.validNumber() should do this for you just fine, no?

stonekase commented 7 years ago

There is no default constructor and i want to detect each individual input before creating the Card Class object.I have run into issues with these method of depending on a class object before and then alot of other null issues start to arise.

stonekase commented 7 years ago

Please see attached the activity class i am working on so you have an idea of what i a doing,i am not good at explaining code(too much work) AddCard.zip