diff --git a/GME Remit.xcodeproj/project.pbxproj b/GME Remit.xcodeproj/project.pbxproj index ed4db29b..7f035dfd 100644 --- a/GME Remit.xcodeproj/project.pbxproj +++ b/GME Remit.xcodeproj/project.pbxproj @@ -244,6 +244,7 @@ 735F68E12394A76800A2DBC8 /* NewRegisterWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 735F68D72394A76800A2DBC8 /* NewRegisterWireframe.swift */; }; 735F68E22394A76800A2DBC8 /* NewRegister.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 735F68D92394A76800A2DBC8 /* NewRegister.storyboard */; }; 735F68E32394A76800A2DBC8 /* NewRegisterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 735F68DA2394A76800A2DBC8 /* NewRegisterViewController.swift */; }; + 7366006D271C62B50091C521 /* CDDIModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7366006C271C62B50091C521 /* CDDIModel.swift */; }; 7367FF5E237401860005F644 /* PushNotificationParam.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7367FF5D237401860005F644 /* PushNotificationParam.swift */; }; 73684456237BD23B00796620 /* InboundTransactionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73684455237BD23B00796620 /* InboundTransactionCell.swift */; }; 736A8C402277EB2A00337A50 /* BiometricNotificationModuleInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 736A8C2D2277EB2900337A50 /* BiometricNotificationModuleInterface.swift */; }; @@ -975,6 +976,7 @@ 735F68D72394A76800A2DBC8 /* NewRegisterWireframe.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NewRegisterWireframe.swift; sourceTree = ""; }; 735F68D92394A76800A2DBC8 /* NewRegister.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NewRegister.storyboard; sourceTree = ""; }; 735F68DA2394A76800A2DBC8 /* NewRegisterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NewRegisterViewController.swift; sourceTree = ""; }; + 7366006C271C62B50091C521 /* CDDIModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CDDIModel.swift; sourceTree = ""; }; 7367FF5D237401860005F644 /* PushNotificationParam.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushNotificationParam.swift; sourceTree = ""; }; 73684455237BD23B00796620 /* InboundTransactionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InboundTransactionCell.swift; sourceTree = ""; }; 736A8C2D2277EB2900337A50 /* BiometricNotificationModuleInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BiometricNotificationModuleInterface.swift; sourceTree = ""; }; @@ -3645,6 +3647,7 @@ 73D3F3D8270C65B5006C3F97 /* ViewModels */ = { isa = PBXGroup; children = ( + 7366006C271C62B50091C521 /* CDDIModel.swift */, ); path = ViewModels; sourceTree = ""; @@ -7200,6 +7203,7 @@ D9DC108421639E56008F3C51 /* SuccessMessage.swift in Sources */, 89739E4A24459A630016251B /* SendMoneyExchangeRateWireframe.swift in Sources */, 7EDBFBDA24B2C5DA00AD5D4D /* RedeemCashPickUpServiceType.swift in Sources */, + 7366006D271C62B50091C521 /* CDDIModel.swift in Sources */, 7318534E230EACA400BA9AE3 /* SendMoneyTransFerReasonViewModel.swift in Sources */, 73195ABB22FD14D500151434 /* SetupRecipientViewModelInterface.swift in Sources */, 7389601922C2FADD003FEA90 /* TableCell.swift in Sources */, diff --git a/GME Remit/APIs/Router/APIRouter.swift b/GME Remit/APIs/Router/APIRouter.swift index 59c38500..d090f6c8 100644 --- a/GME Remit/APIs/Router/APIRouter.swift +++ b/GME Remit/APIs/Router/APIRouter.swift @@ -71,6 +71,7 @@ enum APIRouter { // MARK: - New Registration case loadKYCInformation + case cddiInfo // case saveKYCInformation(model: KYCSave) case requestPennyTestAtRegister(resend: String) case pennyTestSubmitAtRegister(accountNumber: String, certNumber: String) @@ -524,6 +525,9 @@ extension APIRouter { return "\(baseUrlWithoutVersion)v1/mobile/requestOTP" case .submitRegisterOTP: return "\(baseUrlWithoutVersion)v1/mobile/submitOTP" + case .cddiInfo: + let userID = GMEDB.shared.user.string(.userId) ?? "" + return "\(baseUrl)/mobile/sendmoney/getcddi/\(userID)" } } } @@ -622,6 +626,8 @@ extension APIRouter { return .post case .submitRegisterOTP: return .post + case .cddiInfo: + return .get } } } @@ -639,14 +645,16 @@ extension APIRouter { "uuid": self.uuid, "fcmId": firebaseToken, "clientId": "192.168.10.1", - "accessCode": "" + "accessCode": "", + "IsBiometricLogin": false, + "BiometricLoginType": "" ] case .customerProfile(let firebaseToken): return [ - "userId" : Utility.getMyUserName(), + "UserId" : Utility.getMyUserName(), "uuid": self.uuid, - "appVersion": Utility.getAppVersion() ?? "", + "AppVersion": Utility.getAppVersion() ?? "", "phoneBrand": UIDevice.modelName, "phoneOs": Utility.getPhoneOs(), "fcmId": firebaseToken, diff --git a/GME Remit/Modules/RecipientModules/Recipients/Application Logic/Model/Recipient/Recipient.swift b/GME Remit/Modules/RecipientModules/Recipients/Application Logic/Model/Recipient/Recipient.swift index 7be468b6..7401b6d9 100644 --- a/GME Remit/Modules/RecipientModules/Recipients/Application Logic/Model/Recipient/Recipient.swift +++ b/GME Remit/Modules/RecipientModules/Recipients/Application Logic/Model/Recipient/Recipient.swift @@ -45,6 +45,7 @@ struct Recipient: Mappable { var districtID: String? var purposeOfRemit: String? + var sourceOfFund: String? var purposeOfRemitID: String? var idType: String? @@ -121,6 +122,7 @@ struct Recipient: Mappable { relationship <- map["relationship"] district <- map["district"] purposeOfRemit <- map["purposeOfRemit"] + sourceOfFund <- map["SourceOfFund"] fullName <- map["fullName"] idType <- map["idType"] idNumber <- map["idNumber"] @@ -172,3 +174,8 @@ struct Recipient: Mappable { ] } } + +struct CDDIRequestData { + var sourceOfFund: String? + var purposeOfRemittance: String? +} diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/Application Logic/Interactor/CDDIViewControllerInteractorIO.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/Application Logic/Interactor/CDDIViewControllerInteractorIO.swift index f53e2a94..9d933d30 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/Application Logic/Interactor/CDDIViewControllerInteractorIO.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/Application Logic/Interactor/CDDIViewControllerInteractorIO.swift @@ -13,6 +13,6 @@ protocol CDDIViewControllerInteractorInput: class { protocol CDDIViewControllerInteractorOutput: class { func show(error: Error) func success(message: String) - func setModel(with model: KYCInfoModel) + func setModel(with model: CDDIModel) func setError(with error: Error) } diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/Application Logic/Service/CDDIViewControllerService.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/Application Logic/Service/CDDIViewControllerService.swift index 8472f725..07dc9bb6 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/Application Logic/Service/CDDIViewControllerService.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/Application Logic/Service/CDDIViewControllerService.swift @@ -10,11 +10,11 @@ import Foundation class CDDIViewControllerService: CDDIViewControllerServiceType { func fetchKycInfo( - success: @escaping (KYCInfoModel) -> Void, + success: @escaping (CDDIModel) -> Void, failure: @escaping (Error) -> Void ) { - APIRouter.loadKYCInformation.json( - needsAuthorization: false, + APIRouter.cddiInfo.json( + needsAuthorization: true, success: success, failure: failure ) diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/Application Logic/Service/CDDIViewControllerServiceType.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/Application Logic/Service/CDDIViewControllerServiceType.swift index aab7996c..e4a1fb09 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/Application Logic/Service/CDDIViewControllerServiceType.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/Application Logic/Service/CDDIViewControllerServiceType.swift @@ -10,7 +10,7 @@ import Foundation protocol CDDIViewControllerServiceType: class { func fetchKycInfo( - success: @escaping (KYCInfoModel) -> Void, + success: @escaping (CDDIModel) -> Void, failure: @escaping (Error) -> Void ) } diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/User Interface/Presenter/CDDIViewControllerPresenter.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/User Interface/Presenter/CDDIViewControllerPresenter.swift index d277a10b..6e117312 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/User Interface/Presenter/CDDIViewControllerPresenter.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/User Interface/Presenter/CDDIViewControllerPresenter.swift @@ -9,6 +9,7 @@ import Foundation import RxSwift import RxCocoa +import Protobuf class CDDIViewControllerPresenter: ViewModelType { @@ -17,7 +18,8 @@ class CDDIViewControllerPresenter: ViewModelType { weak var view: CDDIViewControllerViewInterface? var interactor: CDDIViewControllerInteractorInput? var wireframe: CDDIViewControllerWireframeInput? - + weak var actionDelegate: SendMoneyExchangeRateActionDelegate? + // MARK: Converting entities func fetchInformation() { @@ -36,20 +38,34 @@ class CDDIViewControllerPresenter: ViewModelType { let isProgress: Driver let purposes: Driver<[KeyValue]?> let sourceOfFund: Driver<[KeyValue]?> + let sourceOfFundId: Driver + let purposeId: Driver } private let disposeBag = DisposeBag() private let errorLinker = PublishSubject() private let progressLinker = PublishSubject() - private let model = PublishSubject() + private let model = PublishSubject() + private let sourceofFundId = PublishSubject() + private let purposeOfRemitId = PublishSubject() func transform(input: Input) -> Output { - + + input.sourceOfFund.map {$0?.id ?? ""}.drive(onNext: { + self.sourceofFundId.onNext($0) + }).disposed(by: disposeBag) + + input.purpose.map {$0?.id ?? ""}.drive(onNext: { + self.purposeOfRemitId.onNext($0) + }).disposed(by: disposeBag) + return Output( isError: errorLinker.asDriverOnErrorJustComplete(), isProgress: progressLinker.asDriverOnErrorJustComplete(), - purposes: model.map {$0.purpose}.asDriverOnErrorJustComplete(), - sourceOfFund: model.map {$0.sourceOfFund}.asDriverOnErrorJustComplete() + purposes: model.map {$0.purposeOfRemit}.asDriverOnErrorJustComplete(), + sourceOfFund: model.map {$0.sourceOfFund}.asDriverOnErrorJustComplete(), + sourceOfFundId: sourceofFundId.asDriverOnErrorJustComplete(), + purposeId: purposeOfRemitId.asDriverOnErrorJustComplete() ) } @@ -64,7 +80,7 @@ extension CDDIViewControllerPresenter: CDDIViewControllerModuleInterface { // MARK: CDDIViewController interactor output interface extension CDDIViewControllerPresenter: CDDIViewControllerInteractorOutput { - func setModel(with model: KYCInfoModel) { + func setModel(with model: CDDIModel) { progressLinker.onNext(false) self.model.onNext(model) } diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/User Interface/View/CDDIViewControllerViewController.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/User Interface/View/CDDIViewControllerViewController.swift index 32e76099..aba04cfe 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/User Interface/View/CDDIViewControllerViewController.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/User Interface/View/CDDIViewControllerViewController.swift @@ -21,6 +21,8 @@ class CDDIViewControllerViewController: UIViewController { weak var actionDelegate: SendMoneyExchangeRateActionDelegate? var exchangeRateModel: SendMoneyExchangeRateModel? private let disposeBag = DisposeBag() + var fund: String? + var purpose: String? // MARK: IBOutlets @IBOutlet weak var purposeOfRemit: ValidationTextField! @@ -42,7 +44,8 @@ class CDDIViewControllerViewController: UIViewController { // MARK: IBActions @IBAction func continueButton(_ sender: UIButton) { view.endEditing(true) - actionDelegate?.continueToVerificationAction() + let model = CDDIRequestData(sourceOfFund: fund, purposeOfRemittance: purpose) + actionDelegate?.continueToVerificationAction(model: model) } // MARK: Other Functions @@ -110,6 +113,14 @@ class CDDIViewControllerViewController: UIViewController { let configure = TablePresenterConfiguration(presenterTitle: "select_source_of_fund_text".localized()) self?.sourceOfFund.useAsDropDown(with: configure, items: $0) }).disposed(by: disposeBag) + + output.sourceOfFundId.drive(onNext: { [weak self] in + self?.fund = $0 + }).disposed(by: disposeBag) + + output.purposeId.drive(onNext: { [weak self] in + self?.purpose = $0 + }).disposed(by: disposeBag) } } diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/User Interface/View/ViewModels/CDDIModel.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/User Interface/View/ViewModels/CDDIModel.swift new file mode 100644 index 00000000..a08bc139 --- /dev/null +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/User Interface/View/ViewModels/CDDIModel.swift @@ -0,0 +1,60 @@ +// +// CDDIModel.swift +// GME Remit +// +// Created by Swift Tech on 17/10/2021. +// Copyright © 2021 Gobal Money Express Co. Ltd. All rights reserved. +// + +import Foundation +import ObjectMapper + +class CDDIModel: Mappable { + var userId: String? + var sourceOfFund: [KeyValue]? + var purposeOfRemit: [KeyValue]? + + required init?(map: Map) { + + } + + func mapping(map: Map) { + userId <- map["UserId"] + sourceOfFund <- map["SourceOfFund"] + purposeOfRemit <- map["PurposeOfRemittance"] + } + + +} + +class SourceOfFundModel: Mappable { + var id: String? + var text: String? + + required init?(map: Map) { + + } + + func mapping(map: Map) { + id <- map["id"] + text <- map["text"] + } + + +} + +class PurposeOfRemitModel: Mappable { + var id: String? + var text: String? + + required init?(map: Map) { + + } + + func mapping(map: Map) { + id <- map["id"] + text <- map["text"] + } + + +} 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 ee5b80c0..377d6c4c 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 @@ -17,7 +17,7 @@ protocol HUDStatusDelegate: class { // Actions from SendMoneyExchangeRateViewController are delegated to Parent View protocol SendMoneyExchangeRateActionDelegate: class { - func continueToVerificationAction() + func continueToVerificationAction(model: CDDIRequestData) func calculated(model: SendMoneyExchangeRateModel?) func continueToCDDI() func continueToTermsAndConditions() @@ -80,7 +80,7 @@ class SendMoneyParentViewController: UIViewController { var termsViewController: TermsAndConditionViewController? lazy private var requestModel = SendMoneyRequestModel() - + lazy private var cddiModel = CDDIRequestData() var presenter: SendMoneyParentModuleInterface? // Buttons representing the pages marked as 1, 2, 3 in UI. @@ -402,7 +402,7 @@ class SendMoneyParentViewController: UIViewController { guard let termsView = termsViewController else {return} termsView.reciepient = self.receipient termsView.requestModel = self.requestModel - + termsView.cddiModel = self.cddiModel self.addChild(termsView) UIView.transition( @@ -449,7 +449,9 @@ extension SendMoneyParentViewController: SendMoneyExchangeRateActionDelegate { self.state = StateButtons.terms } - func continueToVerificationAction() { + func continueToVerificationAction(model: CDDIRequestData) { + self.cddiModel = model + print("model:\(model)") self.addVerificationViewController() self.state = StateButtons.verification } diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Application Logic/Interactor/TermsAndConditionInteractor.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Application Logic/Interactor/TermsAndConditionInteractor.swift index 7384e593..34bb1cd1 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Application Logic/Interactor/TermsAndConditionInteractor.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Application Logic/Interactor/TermsAndConditionInteractor.swift @@ -27,8 +27,9 @@ class TermsAndConditionInteractor { // MARK: TermsAndCondition interactor input interface extension TermsAndConditionInteractor: TermsAndConditionInteractorInput { - func submit(model: SendMoneyRequestModel, reciepient: Recipient) { - let params = self.getParams(model: model, reciepient: reciepient) + + func submit(model: SendMoneyRequestModel, reciepient: Recipient, cddiModel: CDDIRequestData) { + let params = self.getParams(model: model, reciepient: reciepient, cddiModel: cddiModel) self.service.submit( params: params, success: { (response) in @@ -74,7 +75,7 @@ extension TermsAndConditionInteractor: TermsAndConditionInteractorInput { } } - func getParams(model: SendMoneyRequestModel, reciepient: Recipient) -> [String: Any] { + func getParams(model: SendMoneyRequestModel, reciepient: Recipient, cddiModel: CDDIRequestData) -> [String: Any] { guard let username = GMEDB.shared.user.string(.userId) else {return [:]} let senderId = GMEDB.shared.user.string(.senderId) let recieverId = reciepient.receiverID @@ -98,8 +99,8 @@ extension TermsAndConditionInteractor: TermsAndConditionInteractorInput { "ExRate": model.exchangeRateDetail?.apiExchangeRate ?? "", "CalBy": model.exchangeRateDetail?.calcBy ?? "", "FOREX_SESSION_ID": model.exchangeRateDetail?.forexId ?? "", - "PurposeOfRemittance": reciepient.purposeOfRemitID ?? "others", - "SourceOfFund": "3902", + "PurposeOfRemittance": cddiModel.purposeOfRemittance ?? "others", + "SourceOfFund": cddiModel.sourceOfFund ?? "", "RelWithSender": reciepient.relationshipID ?? "", "Occupation": "", "IpAddress": "", @@ -118,4 +119,12 @@ extension TermsAndConditionInteractor: TermsAndConditionInteractorInput { return params } + + func getAvailableBalanceNotificationName() -> Notification.Name { + return Notification.Name.init(rawValue: SideMenuNavigationNotifications.availableBalance) + } + + @objc private func getYearlyLimitNotificationName() -> Notification.Name { + return Notification.Name.init(AppConstants.yearlyLimitNotification) + } } diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Application Logic/Interactor/TermsAndConditionInteractorIO.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Application Logic/Interactor/TermsAndConditionInteractorIO.swift index 517b4b78..3eec99fb 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Application Logic/Interactor/TermsAndConditionInteractorIO.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Application Logic/Interactor/TermsAndConditionInteractorIO.swift @@ -8,7 +8,7 @@ protocol TermsAndConditionInteractorInput: class { func makeApiRequest() - func submit(model: SendMoneyRequestModel, reciepient: Recipient) + func submit(model: SendMoneyRequestModel, reciepient: Recipient, cddiModel: CDDIRequestData) } protocol TermsAndConditionInteractorOutput: class { diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Module Interface/TermsAndConditionModuleInterface.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Module Interface/TermsAndConditionModuleInterface.swift index cb0358ca..5c9e89ad 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Module Interface/TermsAndConditionModuleInterface.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Module Interface/TermsAndConditionModuleInterface.swift @@ -8,6 +8,6 @@ protocol TermsAndConditionModuleInterface: class { func makeApiRequest() - func submit(model: SendMoneyRequestModel, reciepient: Recipient) + func submit(model: SendMoneyRequestModel, reciepient: Recipient, cddiModel: CDDIRequestData) func openReciept(transactionId: String) } diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/Presenter/TermsAndConditionPresenter.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/Presenter/TermsAndConditionPresenter.swift index f3c4ebe1..f25dded8 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/Presenter/TermsAndConditionPresenter.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/Presenter/TermsAndConditionPresenter.swift @@ -27,9 +27,9 @@ extension TermsAndConditionPresenter: TermsAndConditionModuleInterface { self.interactor?.makeApiRequest() } - func submit(model: SendMoneyRequestModel, reciepient: Recipient) { + func submit(model: SendMoneyRequestModel, reciepient: Recipient, cddiModel: CDDIRequestData) { self.view?.showLoading() - self.interactor?.submit(model: model, reciepient: reciepient) + self.interactor?.submit(model: model, reciepient: reciepient, cddiModel: cddiModel) } func openReciept(transactionId: String) { diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/View/TermsAndConditionViewController.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/View/TermsAndConditionViewController.swift index af4e5d59..a87dcfe0 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/View/TermsAndConditionViewController.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/View/TermsAndConditionViewController.swift @@ -16,6 +16,7 @@ class TermsAndConditionViewController: UIViewController { var presenter: TermsAndConditionModuleInterface? var reciepient: Recipient? var requestModel: SendMoneyRequestModel? + var cddiModel: CDDIRequestData? weak var hudDelegate: HUDStatusDelegate? private var isSelected = false lazy var pinViewOption: Options = { @@ -29,6 +30,7 @@ class TermsAndConditionViewController: UIViewController { var password: String? { didSet { guard + let cddiInfoModel = cddiModel, let model = self.requestModel, let reciepient = self.reciepient, let password = self.password, @@ -38,7 +40,7 @@ class TermsAndConditionViewController: UIViewController { } model.transactionPassword = password print(password) - self.presenter?.submit(model: model, reciepient: reciepient) + self.presenter?.submit(model: model, reciepient: reciepient, cddiModel: cddiInfoModel) } } @@ -128,4 +130,24 @@ extension TermsAndConditionViewController: TermsAndConditionViewInterface { ) { } } + + func show(model: SendMoneySubmitModelContainer?) { + guard let message = model?.message, let expectedPoint = model?.extra2 else { + return + } + // let successMessage = "\(message)\n(\("estimated_earning_points_text".localized()): \(expectedPoint.likeCommaMoney() ?? "0"))" + + self.alertWithOk( + type: .success, + message: "Transfer Successful", + title: "Success", + okTitle: "OK" + ) { + if let id = model?.id { + self.presenter?.openReciept(transactionId: id) + } else { + self.alert(type: .error, message: "No Transaction received.") + } + } + } } diff --git a/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/View/TermsAndConditionViewInterface.swift b/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/View/TermsAndConditionViewInterface.swift index af747ebd..692e5fab 100644 --- a/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/View/TermsAndConditionViewInterface.swift +++ b/GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/View/TermsAndConditionViewInterface.swift @@ -11,4 +11,5 @@ protocol TermsAndConditionViewInterface: class { func hideLoading() func show(error: String) func show(message: String) + func show(model: SendMoneySubmitModelContainer?) }