diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index f04c1a58..2382035d 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/model/CashPickupTxnDetailDTO.java b/app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/model/CashPickupTxnDetailDTO.java index 77cf11a3..f3c234dc 100644 --- a/app/src/main/java/com/swifttech/remit/android/features/cashpickuptowallet/model/CashPickupTxnDetailDTO.java +++ b/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; diff --git a/app/src/main/java/com/swifttech/remit/android/features/withdraw/gateway/WithdrawGateway.java b/app/src/main/java/com/swifttech/remit/android/features/withdraw/gateway/WithdrawGateway.java index 386afaee..3003f3bd 100644 --- a/app/src/main/java/com/swifttech/remit/android/features/withdraw/gateway/WithdrawGateway.java +++ b/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 performWithdraw(String auth, String userID, String amount, String password) { + public Observable 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); diff --git a/app/src/main/java/com/swifttech/remit/android/features/withdraw/model/WithdrawStatusResponseDTO.java b/app/src/main/java/com/swifttech/remit/android/features/withdraw/model/WithdrawStatusResponseDTO.java index 780215b5..46200df9 100644 --- a/app/src/main/java/com/swifttech/remit/android/features/withdraw/model/WithdrawStatusResponseDTO.java +++ b/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() { diff --git a/app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawGatewayInterface.java b/app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawGatewayInterface.java index 86f0a7e1..1cadbe71 100644 --- a/app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawGatewayInterface.java +++ b/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 checkWithdrawStatus(String auth, String userID, String selectedWithdrawAmount); - Observable performWithdraw(String auth,String userID,String amount,String password); + Observable performWithdraw(String auth,String userID,String amount,String txnID,String password); } diff --git a/app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawPresenter.java b/app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawPresenter.java index 97fec7dd..0d2015be 100644 --- a/app/src/main/java/com/swifttech/remit/android/features/withdraw/presenter/WithdrawPresenter.java +++ b/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 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);