Browse Source

Exchange Rate Seed Value fixes

master
preyearegmi 6 years ago
parent
commit
619931061c
  1. 14
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/presenter/ExchangeRateV2Presenter.java
  2. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/Constants.java

14
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/presenter/ExchangeRateV2Presenter.java

@ -1,5 +1,6 @@
package com.gmeremit.online.gmeremittance_native.exchange_rate.presenter; package com.gmeremit.online.gmeremittance_native.exchange_rate.presenter;
import com.crashlytics.android.Crashlytics;
import com.gmeremit.online.gmeremittance_native.base.BasePresenter; import com.gmeremit.online.gmeremittance_native.base.BasePresenter;
import com.gmeremit.online.gmeremittance_native.customwidgets.CustomAlertDialog; import com.gmeremit.online.gmeremittance_native.customwidgets.CustomAlertDialog;
import com.gmeremit.online.gmeremittance_native.exchange_rate.gateway.ExchangeRateV2Gateway; import com.gmeremit.online.gmeremittance_native.exchange_rate.gateway.ExchangeRateV2Gateway;
@ -107,8 +108,15 @@ public class ExchangeRateV2Presenter extends BasePresenter implements ExchangeRa
protected void onSuccess(PaymentServiceData paymentServiceApiResponse) { protected void onSuccess(PaymentServiceData paymentServiceApiResponse) {
if(paymentServiceApiResponse.paymentServiceApiResponse.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) { if(paymentServiceApiResponse.paymentServiceApiResponse.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) {
CountryPaymentServiceSeedValueModel seedValueModel = paymentServiceApiResponse.getCountryPaymentServiceSeedValueModel(); CountryPaymentServiceSeedValueModel seedValueModel = paymentServiceApiResponse.getCountryPaymentServiceSeedValueModel();
CountryPaymentService defaultSelectedCountryService = paymentServiceApiResponse.getPaymentServiceApiResponse().getCountryPaymentServiceFromCountryCodeAndCurrency(seedValueModel.getCountryCode(), seedValueModel.getCurrency());
CountryPaymentService defaultSelectedCountryService ;
try {
defaultSelectedCountryService = paymentServiceApiResponse.getPaymentServiceApiResponse().getCountryPaymentServiceFromCountryCodeAndCurrency(seedValueModel.getCountryCode(), seedValueModel.getCurrency());
}
catch(Exception e)
{
Crashlytics.log("Default seed value is null");
defaultSelectedCountryService=null;
}
if (defaultSelectedCountryService == null || defaultSelectedCountryService.getCountryCode() == null || defaultSelectedCountryService.getCountry() == null || defaultSelectedCountryService.getCurrency() == null) { if (defaultSelectedCountryService == null || defaultSelectedCountryService.getCountryCode() == null || defaultSelectedCountryService.getCountry() == null || defaultSelectedCountryService.getCurrency() == null) {
// //
@ -122,7 +130,7 @@ public class ExchangeRateV2Presenter extends BasePresenter implements ExchangeRa
// defaultSelectedCountryService, // defaultSelectedCountryService,
// paymentServiceApiResponse.getCountryPaymentServiceSeedValueModel().getRecipientSeedValue()); // paymentServiceApiResponse.getCountryPaymentServiceSeedValueModel().getRecipientSeedValue());
view.showCountryServiceDataForListedNativeCountry(paymentServiceApiResponse.getPaymentServiceApiResponse().getCountryPaymentServices(),defaultSelectedCountryService,Constants.DEFAULT_EXCHANGE_SEND_AMOUNT);
view.showCountryServiceDataForListedNativeCountry(paymentServiceApiResponse.getPaymentServiceApiResponse().getCountryPaymentServices(),defaultSelectedCountryService,seedValueModel.getRecipientSeedValue());
} }
} }

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/Constants.java

@ -127,7 +127,7 @@ public class Constants {
public static final String RECIPIENT_UPDATE = "RECIPIENT_UPDATE"; public static final String RECIPIENT_UPDATE = "RECIPIENT_UPDATE";
// User Request // User Request
public static final String USER_REQUEST_PAGE = "USER_REQUEST_PAGE"; public static final String USER_REQUEST_PAGE = "USER_REQUEST_PAGE";
public static final String DEFAULT_EXCHANGE_SEND_AMOUNT = "100000";
public static final String DEFAULT_EXCHANGE_SEND_AMOUNT = "1000000";
public static final String CALC_BY_RECIPEINT = "p"; public static final String CALC_BY_RECIPEINT = "p";
public static final String CALC_BY_SENDER = "c"; public static final String CALC_BY_SENDER = "c";
public static final String SUCCESS_CODE_V2 = "0"; public static final String SUCCESS_CODE_V2 = "0";

Loading…
Cancel
Save