Browse Source

Minor flow fixes

master
Preyea Regmi 4 years ago
parent
commit
466079d35e
  1. BIN
      .idea/caches/build_file_checksums.ser
  2. 29
      app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/model/CashPickupTxnDetailDTO.java
  3. 3
      app/src/main/java/com/swifttech/remit/android/features/withdraw/gateway/WithdrawGateway.java
  4. 15
      app/src/main/java/com/swifttech/remit/android/features/withdraw/model/WithdrawStatusResponseDTO.java
  5. 2
      app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawGatewayInterface.java
  6. 12
      app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawPresenter.java

BIN
.idea/caches/build_file_checksums.ser

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;

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