Browse Source

Updated with master

new_design
Preyea Regmi 4 years ago
parent
commit
8f8501ef27
  1. BIN
      .idea/caches/build_file_checksums.ser
  2. 4
      app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/gateway/CashPickupToWalletGateway.java
  3. 29
      app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/model/CashPickupTxnDetailDTO.java
  4. 18
      app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/presenter/CashPickupToWalletPresenter.java
  5. 1
      app/src/main/java/com/swifttech/remit/android/features/home/presenter/HomeV2Presenter.java
  6. 3
      app/src/main/java/com/swifttech/remit/android/features/withdraw/gateway/WithdrawGateway.java
  7. 15
      app/src/main/java/com/swifttech/remit/android/features/withdraw/model/WithdrawStatusResponseDTO.java
  8. 2
      app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawGatewayInterface.java
  9. 12
      app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawPresenter.java

BIN
.idea/caches/build_file_checksums.ser

4
app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/gateway/CashPickupToWalletGateway.java

@ -22,8 +22,8 @@ public class CashPickupToWalletGateway extends PrivilegedGateway implements Cash
JsonObject jsonObject=new JsonObject();
jsonObject.addProperty("userID",userID);
jsonObject.addProperty("controlNumber",selectedControlNo);
jsonObject.addProperty("txnId",selectedControlNo);
jsonObject.addProperty("password",selectedControlNo);
jsonObject.addProperty("txnId",txnId);
jsonObject.addProperty("password",password);
return HttpClientV2.getInstance().redeemCashPickup(auth,jsonObject);
}
}

29
app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/model/CashPickupTxnDetailDTO.java

@ -5,46 +5,47 @@ import com.google.gson.annotations.SerializedName;
public class CashPickupTxnDetailDTO {
@SerializedName("txnId")
@SerializedName("TxnId")
@Expose
private String txnId;
@SerializedName("sendingCountryCode")
@SerializedName("SendingCountryCode")
@Expose
private String sendingCountryCode;
@SerializedName("sendingCountryName")
@SerializedName("SendingCountryName")
@Expose
private String sendingCountryName;
@SerializedName("controlNo")
@SerializedName("PinNo")
@Expose
private String controlNo;
@SerializedName("tranDate")
@SerializedName("TransactionDate")
@Expose
private String tranDate;
@SerializedName("senderName")
@SerializedName("SenderName")
@Expose
private String senderName;
@SerializedName("receiverName")
@SerializedName("ReceiverName")
@Expose
private String receiverName;
@SerializedName("receiverAddress")
@SerializedName("ReceiverAddress")
@Expose
private String receiverAddress;
@SerializedName("receiverMobile")
@SerializedName("ReceiverMobile")
@Expose
private String receiverMobile;
@SerializedName("status")
@SerializedName("Status")
@Expose
private String status;
@SerializedName("serviceFee")
@SerializedName("ServiceCharge")
@Expose
private String serviceFee;
@SerializedName("exrate")
@SerializedName("ExRate")
@Expose
private String exrate;
@SerializedName("receivedAmount")
// @SerializedName("receivedAmount")
@SerializedName("ReceivingAmount")
@Expose
private String receivedAmount;
@SerializedName("payoutAgent")
@SerializedName("PayoutAgent")
@Expose
private String payoutAgent;

18
app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/presenter/CashPickupToWalletPresenter.java

@ -34,7 +34,7 @@ public class CashPickupToWalletPresenter extends BaseViewModel implements CashPi
private final CompositeDisposable viewSubs;
private final CompositeDisposable useCaseSubs;
private String selectedControlNo;
private CashPickupTxnDetailDTO currentCashPickupTxnDetail;
private String currentCashPickupTxnId;
public CashPickupToWalletPresenter(CashPickupToWalletPresenterInterface.CashPickupToWalletContract view, CashPickupToWalletGatewayInterface cashPickupToWalletGateway) {
this.view = view;
@ -65,17 +65,9 @@ public class CashPickupToWalletPresenter extends BaseViewModel implements CashPi
.doFinally(() -> view.showProgressBar(false, ""))
.subscribeWith(new CashPickupTxnSearchObserver())
);
//TODO mocked
// showDummyResponse();
}
private void showDummyResponse() {
CashPickupTxnDetailDTO dummy=new CashPickupTxnDetailDTO();
dummy.seedDummyValues();
currentCashPickupTxnDetail=dummy;
cashPickupTxnDetailDTOMutableLiveData.setValue(dummy);
view.showTxnDetailScreen();
}
@Override
public void redeemCashPickup() {
@ -86,15 +78,13 @@ public class CashPickupToWalletPresenter extends BaseViewModel implements CashPi
@Override
public void onRemitAuthSuccess(RemitAuthSuccessResult result) {
useCaseSubs.add(
gateway.redeemCashPickupTxn(gateway.getAuth(), gateway.getUserID(), selectedControlNo, "", "")
gateway.redeemCashPickupTxn(gateway.getAuth(), gateway.getUserID(), selectedControlNo, currentCashPickupTxnId, result.getResult())
.doOnSubscribe(subs -> view.showProgressBar(true, ""))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doFinally(() -> view.showProgressBar(false, ""))
.subscribeWith(new CashPickupTxnRedeemObserver())
);
//TODO mocked
// view.showPopUpMessage("Redeem Success", CustomAlertDialog.AlertType.SUCCESS, alertType -> view.exitView());
}
@Override
@ -158,7 +148,7 @@ public class CashPickupToWalletPresenter extends BaseViewModel implements CashPi
@Override
protected void onSuccess(GenericResponseDataModel<CashPickupTxnDetailDTO> t) {
if (Constants.SUCCESS_CODE_V2.equalsIgnoreCase(t.getErrorCode())) {
currentCashPickupTxnDetail=t.getData();
currentCashPickupTxnId = t.getData().getTxnId();
cashPickupTxnDetailDTOMutableLiveData.setValue(t.getData());
view.showTxnDetailScreen();
} else {

1
app/src/main/java/com/swifttech/remit/android/features/home/presenter/HomeV2Presenter.java

@ -37,7 +37,6 @@ import retrofit2.HttpException;
public class HomeV2Presenter extends BasePresenter implements HomeV2PresenterInterface, HomeV2InteractorInterface, PrivilegedGateway.PrivilegedGatewayDataObserver {
private static final long AUTO_DEBIT_RENEWAL_TIME_LIMIT_IN_DAYS = 30;
private final HomeV2ContractInterface view;
private final HomeV2GatewayInterface gateway;
private final CompositeDisposable compositeDisposable;

3
app/src/main/java/com/swifttech/remit/android/features/withdraw/gateway/WithdrawGateway.java

@ -18,9 +18,10 @@ public class WithdrawGateway extends PrivilegedGateway implements WithdrawGatewa
}
@Override
public Observable<ResponseBody> performWithdraw(String auth, String userID, String amount, String password) {
public Observable<ResponseBody> performWithdraw(String auth, String userID, String amount,String txnId, String password) {
JsonObject jsonObject=new JsonObject();
jsonObject.addProperty("userID",userID);
jsonObject.addProperty("txnId",txnId);
jsonObject.addProperty("amount",amount);
jsonObject.addProperty("password",password);
return HttpClientV2.getInstance().proceedForBankDeposit(auth,jsonObject);

15
app/src/main/java/com/swifttech/remit/android/features/withdraw/model/WithdrawStatusResponseDTO.java

@ -11,6 +11,9 @@ public class WithdrawStatusResponseDTO {
@SerializedName("bankName")
@Expose
private String bankName;
@SerializedName("txnId")
@Expose
private String txnId;
@SerializedName("accountNo")
@Expose
private String accountNo;
@ -65,12 +68,12 @@ public class WithdrawStatusResponseDTO {
this.noticeMessage = noticeMessage;
}
public void seedDummyValues() {
this.bankName="Mongolia Bank";
this.accountNo="010298320";
this.amount="10,000 MNT";
this.serviceCharge="1,000";
this.noticeMessage="";
public String getTxnId() {
return txnId;
}
public void setTxnId(String txnId) {
this.txnId = txnId;
}
public String getFormattedServiceCharge() {

2
app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawGatewayInterface.java

@ -8,5 +8,5 @@ import okhttp3.ResponseBody;
public interface WithdrawGatewayInterface extends PrivilegedGatewayInterface {
Observable<ResponseBody> checkWithdrawStatus(String auth, String userID, String selectedWithdrawAmount);
Observable<ResponseBody> performWithdraw(String auth,String userID,String amount,String password);
Observable<ResponseBody> performWithdraw(String auth,String userID,String amount,String txnID,String password);
}

12
app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawPresenter.java

@ -36,6 +36,7 @@ public class WithdrawPresenter extends BaseViewModel implements WithdrawPresente
private final CompositeDisposable viewSubs;
private WithdrawStatusResponseDTO withdrawStatusDTO;
private String selectedWithdrawAmount;
private String currentTxnId;
public WithdrawPresenter(WithdrawPresenterInterface.WithdrawContract view, WithdrawGatewayInterface withdrawGateway) {
this.view = view;
@ -95,15 +96,13 @@ public class WithdrawPresenter extends BaseViewModel implements WithdrawPresente
@Override
public void onRemitAuthSuccess(RemitAuthSuccessResult result) {
useCaseSubs.add(
gateway.performWithdraw(gateway.getAuth(), gateway.getUserID(), selectedWithdrawAmount, result.getResult())
gateway.performWithdraw(gateway.getAuth(), gateway.getUserID(), selectedWithdrawAmount, currentTxnId,result.getResult())
.doOnSubscribe(subs -> view.showProgressBar(true, ""))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doFinally(() -> view.showProgressBar(false, ""))
.subscribeWith(new WithdrawTxnbserver())
);
//TODO Mock Success Response
view.showPopUpMessage("Withdraw Success", CustomAlertDialog.AlertType.SUCCESS, alertType -> view.exitView());
}
@Override
@ -129,12 +128,6 @@ public class WithdrawPresenter extends BaseViewModel implements WithdrawPresente
.doFinally(() -> view.showProgressBar(false, ""))
.subscribeWith(new WithdrawStatusObserver())
);
//TODO Mock Success Response
// WithdrawStatusResponseDTO dummyData = new WithdrawStatusResponseDTO();
// dummyData.seedDummyValues();
// onReceivingWithdrawStatus(dummyData);
}
private Boolean validateAmount(CharSequence amount) {
@ -178,6 +171,7 @@ public class WithdrawPresenter extends BaseViewModel implements WithdrawPresente
@Override
protected void onSuccess(GenericResponseDataModel<WithdrawStatusResponseDTO> t) {
if (Constants.SUCCESS_CODE_V2.equalsIgnoreCase(t.getErrorCode()) && t.getData() != null) {
currentTxnId=t.getData().getTxnId();
onReceivingWithdrawStatus(t.getData());
} else {
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.FAILED, null);

Loading…
Cancel
Save