Skip to content

Commit da9d97c

Browse files
committed
Update country code check for card BINs
1 parent 34ee072 commit da9d97c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rave_presentation/src/main/java/com/flutterwave/raveandroid/rave_presentation/card/CardPaymentHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ public void onSuccess(CheckCardResponse response) {
199199
mCardInteractor.showProgressIndicator(false);
200200

201201
try{
202-
if (response.getCountry().split(" ")[1].equalsIgnoreCase(barterCountry)){
202+
String[] countryArray = response.getCountry().split(" ");
203+
String countryCode = countryArray[countryArray.length-1];
204+
if (countryCode.equalsIgnoreCase(barterCountry)){
203205
continueCharge( isDisplayFee, body, encryptionKey);
204206
} else {
205207
mCardInteractor.onPaymentError(cardNotAllowed);

0 commit comments

Comments
 (0)