diff --git a/GME Remit.xcodeproj/project.pbxproj b/GME Remit.xcodeproj/project.pbxproj index bc42a3f0..0545eb68 100644 --- a/GME Remit.xcodeproj/project.pbxproj +++ b/GME Remit.xcodeproj/project.pbxproj @@ -8303,7 +8303,7 @@ "$(inherited)", "$(PROJECT_DIR)/GME\\ Remit/ThirdParty/virtualKeyboard/mtk_module", ); - MARKETING_VERSION = 1.4.5; + MARKETING_VERSION = 1.4.7; "OTHER_CODE_SIGN_FLAGS[sdk=*]" = "--generate-entitlement-der"; OTHER_LDFLAGS = ( "$(OTHER_LDFLAGS)", @@ -8348,7 +8348,7 @@ "$(inherited)", "$(PROJECT_DIR)/GME\\ Remit/ThirdParty/virtualKeyboard/mtk_module", ); - MARKETING_VERSION = 1.4.5; + MARKETING_VERSION = 1.4.7; OTHER_LDFLAGS = ( "$(OTHER_LDFLAGS)", "-ObjC", diff --git a/GME Remit.xcodeproj/xcshareddata/xcschemes/GME Remit.xcscheme b/GME Remit.xcodeproj/xcshareddata/xcschemes/GME Remit.xcscheme index 335a0039..b8eea3ab 100644 --- a/GME Remit.xcodeproj/xcshareddata/xcschemes/GME Remit.xcscheme +++ b/GME Remit.xcodeproj/xcshareddata/xcschemes/GME Remit.xcscheme @@ -61,7 +61,7 @@ [String : String] { diff --git a/GME Remit/Modules/RecipientModules/Recipients/User Interface/Wireframe/RecipientsWireframe.swift b/GME Remit/Modules/RecipientModules/Recipients/User Interface/Wireframe/RecipientsWireframe.swift index 035348a4..50a8c008 100644 --- a/GME Remit/Modules/RecipientModules/Recipients/User Interface/Wireframe/RecipientsWireframe.swift +++ b/GME Remit/Modules/RecipientModules/Recipients/User Interface/Wireframe/RecipientsWireframe.swift @@ -12,6 +12,8 @@ class RecipientsWireframe { weak var view: UIViewController! weak var output: RecipientsWireframeOutput? var parentType: RecipientParentType = .sendmoney + var presenter: RecipientsPresenter? + var viewModel: RecipientsViewModel? } extension RecipientsWireframe: RecipientsWireframeInput { @@ -23,9 +25,11 @@ extension RecipientsWireframe: RecipientsWireframeInput { let interactor = RecipientsInteractor(service: service) let presenter = RecipientsPresenter() let viewModel = RecipientsViewModel() + self.viewModel = viewModel let viewController = viewControllerFromStoryboard(of: RecipientsViewController.self) output = presenter + self.presenter = presenter viewController.parentType = self.parentType viewController.viewModel = viewModel interactor.output = presenter @@ -59,6 +63,8 @@ extension RecipientsWireframe: RecipientsWireframeInput { return } let wireframe = SendMoneyParentWireframe() + wireframe.output = self.presenter + wireframe.viewModel = viewModel wireframe.open(for: recipient, in: navigationVC) } diff --git a/GME Remit/Modules/RecipientModules/SetupRecipient/Application Logic/Interactor/SetupRecipientInteractor.swift b/GME Remit/Modules/RecipientModules/SetupRecipient/Application Logic/Interactor/SetupRecipientInteractor.swift index c6225ec1..c693fad1 100644 --- a/GME Remit/Modules/RecipientModules/SetupRecipient/Application Logic/Interactor/SetupRecipientInteractor.swift +++ b/GME Remit/Modules/RecipientModules/SetupRecipient/Application Logic/Interactor/SetupRecipientInteractor.swift @@ -95,7 +95,7 @@ extension SetupRecipientInteractor: SetupRecipientInteractorInput { func checkAccountValidation(request: AccountValidate) { self.service.checkAccountValidation(request: request) {_ in - + self.output?.success() } failure: { self.output?.accountValidationError(error: $0)} } diff --git a/GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/Presenter/SetupRecipientPresenter.swift b/GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/Presenter/SetupRecipientPresenter.swift index e87c94cb..59732fb6 100644 --- a/GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/Presenter/SetupRecipientPresenter.swift +++ b/GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/Presenter/SetupRecipientPresenter.swift @@ -100,6 +100,7 @@ extension SetupRecipientPresenter: SetupRecipientInteractorOutput { } func accountValidationError(error: Error) { + wireframe?.view.hideProgressHud() wireframe?.view.gmeAlert(type:.error, title: "Validation failed", message: error.localizedDescription, @@ -117,6 +118,7 @@ extension SetupRecipientPresenter: SetupRecipientInteractorOutput { } func success() { + wireframe?.view.hideProgressHud() viewModel?.progress(isShow: true) if let recipent = self.recipient { interactor?.editRecipient(at: recipent) diff --git a/GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/View/SetupRecipientViewController.swift b/GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/View/SetupRecipientViewController.swift index a7e865dc..163a0d2d 100644 --- a/GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/View/SetupRecipientViewController.swift +++ b/GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/View/SetupRecipientViewController.swift @@ -718,7 +718,7 @@ extension SetupRecipientViewController: OtpDelegate, UITextFieldDelegate { let randomInt = Int.random(in: 0..<1000) let randomNumber = "\(randomInt)" let accounValidation = AccountValidate(accountNumber: accountTextField.text ?? "", bankCode: self.bankCode, bankCountry: self.countryCode, providerId: self.payoutPartner, paymentMethod: self.selectedPayment, sessionID: randomNumber, firstName: self.firstNameTextField.text ?? "", middleName: middleNameTextField.text ?? "", lastName: lastNameTextField.text ?? "") - + self.showProgressHud() self.viewModel.presenter?.checkAccountValidation(request: accounValidation) } } diff --git a/GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/View/ViewModel/SetupRecipientViewModel.swift b/GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/View/ViewModel/SetupRecipientViewModel.swift index 6bf7534e..b5ea170c 100644 --- a/GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/View/ViewModel/SetupRecipientViewModel.swift +++ b/GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/View/ViewModel/SetupRecipientViewModel.swift @@ -259,7 +259,10 @@ class SetupRecipientViewModel: ViewModelType { bank: selectedBank, branch: recipient.agent?.branch ) - self.presenter?.validateAccount(with: validateModel, recipient: recipient) + if let viewController = viewController { + self.presenter?.saveRecipient(at: recipient, parentType: parentType, viewcontroller: viewController) + } + //self.presenter?.validateAccount(with: validateModel, recipient: recipient) } else { // if let viewController = viewController { // self.presenter?.moveToTermsAndConditionView(at: recipient, viewController) diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Interactor/SendMoneyExchangeRateInteractor.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Interactor/SendMoneyExchangeRateInteractor.swift index 5d881ac2..d3a4a99b 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Interactor/SendMoneyExchangeRateInteractor.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Interactor/SendMoneyExchangeRateInteractor.swift @@ -47,8 +47,8 @@ extension SendMoneyExchangeRateInteractor: SendMoneyExchangeRateInteractorInput ) } - func getRewardPoint() { - self.service.getRewardPoint { model in + func getRewardPoint(receiverID: String, isAccountValidationRequired: String, payoutPartner: String) { + self.service.getRewardPoint(receiverID: receiverID, isAccountValidationRequired: isAccountValidationRequired, payoutPartner: payoutPartner) { model in self.output?.show(model: model) } failure: { error in self.output?.show(error: error) diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Interactor/SendMoneyExchangeRateInteractorIO.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Interactor/SendMoneyExchangeRateInteractorIO.swift index 567bf32c..1eb9a680 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Interactor/SendMoneyExchangeRateInteractorIO.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Interactor/SendMoneyExchangeRateInteractorIO.swift @@ -8,7 +8,7 @@ protocol SendMoneyExchangeRateInteractorInput: class { func calculate(params: [String: String]) - func getRewardPoint() + func getRewardPoint(receiverID: String, isAccountValidationRequired: String, payoutPartner: String) } protocol SendMoneyExchangeRateInteractorOutput: class { diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Service/SendMoneyExchangeRateServiceType.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Service/SendMoneyExchangeRateServiceType.swift index 980c2821..0ae990f1 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Service/SendMoneyExchangeRateServiceType.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Service/SendMoneyExchangeRateServiceType.swift @@ -19,7 +19,7 @@ protocol FetchSendMoneyExchangeRateService: ApiServiceType { failure: @escaping (Error) -> Void ) - func getRewardPoint(success: @escaping (RewardPointModel) -> Void, + func getRewardPoint(receiverID: String, isAccountValidationRequired: String, payoutPartner: String, success: @escaping (RewardPointModel) -> Void, failure: @escaping (Error) -> Void) } @@ -53,8 +53,8 @@ extension FetchSendMoneyExchangeRateService { ) } - func getRewardPoint(success: @escaping (RewardPointModel) -> Void, + func getRewardPoint(receiverID: String, isAccountValidationRequired: String, payoutPartner: String, success: @escaping (RewardPointModel) -> Void, failure: @escaping (Error) -> Void) { - APIRouter.getRewardPoint.json(success: success, failure: failure) + APIRouter.getRewardPoint(receiverID: receiverID, isAccountValidationRequired: isAccountValidationRequired, payoutPartner: payoutPartner).json(needsAuthorization: true, success: success, failure: failure) } } diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Module Interface/SendMoneyExchangeRateModuleInterface.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Module Interface/SendMoneyExchangeRateModuleInterface.swift index 2d320ef9..766dc1cd 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Module Interface/SendMoneyExchangeRateModuleInterface.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Module Interface/SendMoneyExchangeRateModuleInterface.swift @@ -23,5 +23,5 @@ protocol SendMoneyExchangeRateModuleInterface: class { bankId: String?, discountedFee: String? ) - func getRewardPoint() + func getRewardPoint(receiverID: String, isAccountValidationRequired: String, payoutPartner: String) } diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/User Interface/Presenter/SendMoneyExchangeRatePresenter.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/User Interface/Presenter/SendMoneyExchangeRatePresenter.swift index c4e38bd9..1f20a2eb 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/User Interface/Presenter/SendMoneyExchangeRatePresenter.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/User Interface/Presenter/SendMoneyExchangeRatePresenter.swift @@ -84,8 +84,8 @@ extension SendMoneyExchangeRatePresenter: SendMoneyExchangeRateModuleInterface { self.interactor?.calculate(params: param) } - func getRewardPoint() { - interactor?.getRewardPoint() + func getRewardPoint(receiverID: String, isAccountValidationRequired: String, payoutPartner: String) { + interactor?.getRewardPoint(receiverID: receiverID, isAccountValidationRequired: isAccountValidationRequired, payoutPartner: payoutPartner) } } diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/User Interface/View/SendMoneyExchangeRateViewController.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/User Interface/View/SendMoneyExchangeRateViewController.swift index d20bb7e1..688de8f0 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/User Interface/View/SendMoneyExchangeRateViewController.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/User Interface/View/SendMoneyExchangeRateViewController.swift @@ -91,6 +91,8 @@ class SendMoneyExchangeRateViewController: UIViewController { private lazy var couponListTapGesture: UITapGestureRecognizer = UITapGestureRecognizer() private var plainSendingAmount: String? + var output: RecipientsPresenter? + var viewModel: RecipientsViewModel? private var action: ActionBehaviour? { didSet { @@ -182,7 +184,8 @@ class SendMoneyExchangeRateViewController: UIViewController { setup() self.cardView.isHidden = true cardView.layer.cornerRadius = 10 - presenter?.getRewardPoint() + self.showProgressHud() + presenter?.getRewardPoint(receiverID: self.reciepient?.receiverID ?? "", isAccountValidationRequired: self.reciepient?.isAccountValidationRequired ?? "", payoutPartner: self.reciepient?.payoutPartner ?? "") } override func viewWillAppear(_ animated: Bool) { @@ -460,10 +463,12 @@ class SendMoneyExchangeRateViewController: UIViewController { extension SendMoneyExchangeRateViewController: SendMoneyExchangeRateViewInterface { func show(model: SendMoneyExchangeRateModel) { + self.hideProgressHud() exchangeRateModel = model } func show(error: String) { + self.hideProgressHud() showExchangeRateInfomation(isHidden: false) alert(type: .error, message: error) } @@ -477,11 +482,26 @@ extension SendMoneyExchangeRateViewController: SendMoneyExchangeRateViewInterfac } func setError(with error: Error) { + self.hideProgressHud() alert(message: error.localizedDescription) } func show(model: RewardPointModel) { + self.hideProgressHud() self.rewardPointModel = model + if model.showValidationdAlert == "Y" { + self.gmeAlert(type:.error, + title: "Validation failed", + message: model.validationMsg, + rightButtonTitle: "Proceed", + leftButtonTitle: "Edit", rightButtonAction: { + + }, leftButtonAction: { + if let reciepient = self.reciepient, let viewModel = self.viewModel { + self.output?.openEditRecipient(who: reciepient, with: viewModel) + } + }) + } } } diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyParent/User Interface/View/SendMoneyParentViewController.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyParent/User Interface/View/SendMoneyParentViewController.swift index 2b761bd5..827d5c50 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyParent/User Interface/View/SendMoneyParentViewController.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyParent/User Interface/View/SendMoneyParentViewController.swift @@ -85,7 +85,8 @@ class SendMoneyParentViewController: UIViewController { lazy private var requestModel = SendMoneyRequestModel() lazy private var cddiModel = CDDIRequestData() var presenter: SendMoneyParentModuleInterface? - + var output: RecipientsPresenter? + var viewModel: RecipientsViewModel? // Buttons representing the pages marked as 1, 2, 3 in UI. var stateButtons: [UIButton] = [] @@ -184,6 +185,8 @@ class SendMoneyParentViewController: UIViewController { sendMoneyExchangeRateViewController?.reciepient = self.receipient sendMoneyExchangeRateViewController?.actionDelegate = self sendMoneyExchangeRateViewController?.hudDelegate = self + sendMoneyExchangeRateViewController?.output = self.output + sendMoneyExchangeRateViewController?.viewModel = self.viewModel sendMoneyVerificationViewController = SendMoneyVerificationWireframe() .getMainView() as? SendMoneyVerificationViewController diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyParent/User Interface/Wireframe/SendMoneyParentWireframe.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyParent/User Interface/Wireframe/SendMoneyParentWireframe.swift index 38bd54b2..233b024a 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyParent/User Interface/Wireframe/SendMoneyParentWireframe.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyParent/User Interface/Wireframe/SendMoneyParentWireframe.swift @@ -11,6 +11,8 @@ import UIKit class SendMoneyParentWireframe { weak var view: UIViewController! var reciepient: Recipient? + var output: RecipientsPresenter? + var viewModel: RecipientsViewModel? } extension SendMoneyParentWireframe: SendMoneyParentWireframeInput { @@ -26,7 +28,8 @@ extension SendMoneyParentWireframe: SendMoneyParentWireframeInput { let presenter = SendMoneyParentPresenter() let viewController = viewControllerFromStoryboard(of: SendMoneyParentViewController.self) - + viewController.output = self.output + viewController.viewModel = self.viewModel viewController.presenter = presenter interactor.output = presenter presenter.interactor = interactor