Skip to content

Commit ee1ae76

Browse files
committed
Upgrade MasterCard Validation Regex and allow invalid card to submit let backend handle this check
1 parent 852ce8d commit ee1ae76

4 files changed

Lines changed: 2 additions & 18 deletions

File tree

app/build.gradle

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ android {
3939
}
4040

4141
dependencies {
42-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
43-
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
44-
testImplementation 'junit:junit:4.13.2'
4542

4643
implementation project(':expresspay-sdk')
4744

@@ -50,13 +47,5 @@ dependencies {
5047
implementation 'com.google.android.material:material:1.8.0'
5148
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.7.20"
5249

53-
implementation "androidx.browser:browser:1.5.0"
5450
implementation 'com.google.code.gson:gson:2.9.0'
55-
56-
implementation 'androidx.fragment:fragment-ktx:1.5.5'
57-
58-
implementation "com.squareup.okhttp3:okhttp:4.10.0"
59-
implementation "com.squareup.okhttp3:logging-interceptor:4.10.0"
60-
implementation "com.squareup.retrofit2:retrofit:2.9.0"
61-
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
6251
}

expresspay-sdk/build.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,6 @@ dependencies {
5555

5656
// mv expresspay-sdk-release.aar /Volumes/EdfaPay/Codes/Github/ExpressPay/Flutter/expresspay_sdk/android/libs
5757

58-
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
59-
testImplementation 'junit:junit:4.13.2'
60-
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
61-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
62-
6358
implementation 'androidx.appcompat:appcompat:1.6.1'
6459
implementation 'androidx.core:core-ktx:1.9.0'
6560
implementation 'com.google.android.material:material:1.8.0'

expresspay-sdk/src/main/java/com/expresspay/sdk/views/expresscardpay/ExpressCardPayFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ internal class ExpressCardPayFragment : Fragment(), TextWatcher, OnFocusChangeLi
123123
binding.btnPay.isEnabled =
124124
binding.card.cardData.isExpiryValid()
125125
&& binding.card.cardData.isNumberValid()
126-
&& binding.card.cardData.brand != Brand.GENERIC
126+
// && binding.card.cardData.brand != Brand.GENERIC
127127
&& binding.card.cardData.number.replace(" ", "").trim().length == 16
128128
&& binding.card.cardData.isCvvValid()
129129
&& binding.card.holder.length > 3

expresspay-sdk/src/main/java/com/expresspay/sdk/views/expresscardpay/creditcardview/models/Brand.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ package com.expresspay.sdk.views.expresscardpay.creditcardview.models
88
enum class Brand {
99
MADA("^(588845|440647|44079x5|446404|457865|968208|588846|493428|539931|558848|557606|968210|636120|417633|468540|468541|468542|468543|968201|446393|588847|400861|409201|458456|484783|968205|462220|455708|588848|455036|968203|486094|486095|486096|504300|440533|489317|489318|489319|445564|968211|401757|410685|432328|428671|428672|428673|968206|446672|543357|434107|431361|604906|521076|588850|968202|535825|529415|543085|524130|554180|549760|588849|968209|524514|529741|537767|535989|536023|513213|585265|588983|588982|589005|508160|531095|530906|532013|588851|605141|968204|422817|422818|422819|428331|483010|483011|483012|589206|968207|419593|439954|407197|407395|520058|530060|531196|412565|506968)[0-9]{0,10}$"),
1010
VISA("^4[0-9]{6,}$"),
11-
MASTERCARD("^5[1-5][0-9]{4}$"),
11+
MASTERCARD("^5[1-5][0-9]{4,}$"),
1212
AMEX("^3[47][0-9]{5,}$"),
1313
DINERS("^3(?:0[0-5]|[68][0-9])[0-9]{4,}$"),
1414
DISCOVER("^6(?:011|5[0-9]{2})[0-9]{3,}$"),

0 commit comments

Comments
 (0)