Skip to content

Commit 5991235

Browse files
author
taiwoadebayo
committed
check card country not currency
1 parent 079b168 commit 5991235

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ public void checkCard(String cardFirstSix, final Payload body, final Boolean isD
198198
public void onSuccess(CheckCardResponse response) {
199199
mCardInteractor.showProgressIndicator(false);
200200

201-
if (response != null && response.getCountry() != null && response.getCountry().getCurrency() != null) {
202-
if (response.getCountry().getCurrency().equalsIgnoreCase(body.getCurrency())) {
201+
if (response != null && response.getCountry() != null && response.getCountry().getAlpha2() != null) {
202+
if (response.getCountry().getAlpha2().equalsIgnoreCase(body.getCountry())) {
203203
continueCharge( isDisplayFee, body, encryptionKey);
204204
} else {
205205
mCardInteractor.onPaymentError(cardNotAllowed);

rave_remote/src/main/java/com/flutterwave/raveandroid/rave_remote/responses/CheckCardResponse.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,14 @@ public String getCurrency() {
111111
public void setCurrency(@Nullable String currency) {
112112
this.currency = currency;
113113
}
114+
115+
public String getAlpha2() {
116+
return alpha2;
117+
}
118+
119+
public void setAlpha2(String alpha2) {
120+
this.alpha2 = alpha2;
121+
}
114122
}
115123

116124
}

0 commit comments

Comments
 (0)