From bf0455938fc2203cd02bd542496c8bdfb705cdd2 Mon Sep 17 00:00:00 2001 From: gme_2 Date: Thu, 21 Mar 2019 17:51:10 +0900 Subject: [PATCH] nepali language added --- .../Interactor/ResendExchangeInteractor.swift | 8 +++-- .../SendMoneyVerificationViewController.swift | 10 +++++-- .../Interactor/SendMoneyCodeInteractor.swift | 9 +++++- .../SendMoneyCodeInteractorIO.swift | 5 ++-- .../Service/SendMoneyCodeService.swift | 28 ----------------- .../Service/SendMoneyCodeServiceType.swift | 30 ++++++++++++++++++- .../SendMoneyCodeModuleInterface.swift | 3 +- .../Presenter/SendMoneyCodePresenter.swift | 13 +++++++- .../View/SendMoneyCodeViewController.swift | 29 +++++++++++------- .../View/SendMoneyCodeViewInterface.swift | 4 +++ ne.lproj/Localizable.strings | 21 +++++++++++++ 11 files changed, 112 insertions(+), 48 deletions(-) diff --git a/GMERemittance/Module/ResendExchange/Application Logic/Interactor/ResendExchangeInteractor.swift b/GMERemittance/Module/ResendExchange/Application Logic/Interactor/ResendExchangeInteractor.swift index 3731a2a5..6fc2cf64 100644 --- a/GMERemittance/Module/ResendExchange/Application Logic/Interactor/ResendExchangeInteractor.swift +++ b/GMERemittance/Module/ResendExchange/Application Logic/Interactor/ResendExchangeInteractor.swift @@ -58,7 +58,7 @@ extension ResendExchangeInteractor: ResendExchangeInteractorInput { func calculate(senderAmt: String, senderCurrency: String, recieverAmt: String, recieverCurrency: String, recieverCountryName: String, recieverCountryId: String, paymentMethod: String, paymentMethodId: String, calcBy: String, senderCountryId: String, payoutPartner: String, userId: String, bankId: String) { - let param: [String: String] = + var param: [String: String] = [ ApiConstants.senderAmount : senderAmt, ApiConstants.senderCurrency : senderCurrency, @@ -70,11 +70,15 @@ extension ResendExchangeInteractor: ResendExchangeInteractorInput { ApiConstants.paymentMethodId: paymentMethodId, ApiConstants.calcBy : calcBy, ApiConstants.senderCountryId : senderCountryId, - ApiConstants.payOutPartner : payoutPartner, +// ApiConstants.payOutPartner : payoutPartner, ApiConstants.userId : userId, ApiConstants.bankId : bankId ] + if !payoutPartner.isEmpty { + param[ApiConstants.payOutPartner] = payoutPartner + } + self.service.calculate(params: param, success: { (model) in guard let model = model else {return} self.output?.show(model: model) diff --git a/GMERemittance/Module/SendMoney/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift b/GMERemittance/Module/SendMoney/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift index bad15a50..c488b338 100644 --- a/GMERemittance/Module/SendMoney/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift +++ b/GMERemittance/Module/SendMoney/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift @@ -231,7 +231,7 @@ class SendMoneyVerificationViewController: UITableViewController { } func otpEntered(otp: String) { - self.encryptedNumber = otp + self.password = otp } // start keyboard @@ -316,11 +316,17 @@ extension SendMoneyVerificationViewController: SendMoneyVerificationViewInterfac } func showLoading() { - self.hudDelegate?.showLoading() + if let _ = hudDelegate { + self.hudDelegate?.showLoading() + }else { + self.showProgressHud() + } + } func hideLoading() { self.hudDelegate?.hideLoading() + self.hideProgressHud() } } diff --git a/GMERemittance/Module/SendMoneyCode/Application Logic/Interactor/SendMoneyCodeInteractor.swift b/GMERemittance/Module/SendMoneyCode/Application Logic/Interactor/SendMoneyCodeInteractor.swift index 8e199943..3a195b66 100644 --- a/GMERemittance/Module/SendMoneyCode/Application Logic/Interactor/SendMoneyCodeInteractor.swift +++ b/GMERemittance/Module/SendMoneyCode/Application Logic/Interactor/SendMoneyCodeInteractor.swift @@ -27,5 +27,12 @@ class SendMoneyCodeInteractor { // MARK: SendMoneyCode interactor input interface extension SendMoneyCodeInteractor: SendMoneyCodeInteractorInput { - + func viewIsReady() { + let customerId = Utility.getMyUserName() + self.service.requestOtp(customerId: customerId, success: { (message) in + self.output?.show(message: message) + }) { (error) in + self.output?.show(error: error) + } + } } diff --git a/GMERemittance/Module/SendMoneyCode/Application Logic/Interactor/SendMoneyCodeInteractorIO.swift b/GMERemittance/Module/SendMoneyCode/Application Logic/Interactor/SendMoneyCodeInteractorIO.swift index 902a63ae..73b92bad 100644 --- a/GMERemittance/Module/SendMoneyCode/Application Logic/Interactor/SendMoneyCodeInteractorIO.swift +++ b/GMERemittance/Module/SendMoneyCode/Application Logic/Interactor/SendMoneyCodeInteractorIO.swift @@ -7,9 +7,10 @@ // protocol SendMoneyCodeInteractorInput: class { - + func viewIsReady() } protocol SendMoneyCodeInteractorOutput: class { - + func show(message: String) + func show(error: Error) } diff --git a/GMERemittance/Module/SendMoneyCode/Application Logic/Service/SendMoneyCodeService.swift b/GMERemittance/Module/SendMoneyCode/Application Logic/Service/SendMoneyCodeService.swift index 252c7b82..1631455e 100644 --- a/GMERemittance/Module/SendMoneyCode/Application Logic/Service/SendMoneyCodeService.swift +++ b/GMERemittance/Module/SendMoneyCode/Application Logic/Service/SendMoneyCodeService.swift @@ -7,7 +7,6 @@ // import Foundation -import Alamofire class SendMoneyCodeService: SendMoneyCodeServiceType { @@ -18,30 +17,3 @@ class SendMoneyCodeService: SendMoneyCodeServiceType { // MARK: Data management } - -protocol OtpCodeRequestApiService: ApiServiceType { - func requestOtp(customerId: String, success: @escaping (String) -> (), failure: @escaping (Error) -> ()) -} - - -extension OtpCodeRequestApiService { - func requestOtp(customerId: String, success: @escaping (String) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "v2/kftc/GetOTP/\(customerId)" - auth.request(method: .post, url: url, params: nil, encoding: JSONEncoding.default, success: { (response: SuccessMessageContainer) in - - - if (response.errorCode ?? "") == "1" { - let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) - failure(error) - }else { - let model = response.message - success(model ?? "") - } - - - }) { (error) in - failure(error) - } - } -} -//api/v2/kftc/GetOTP/saroj.chalise@gmail.com diff --git a/GMERemittance/Module/SendMoneyCode/Application Logic/Service/SendMoneyCodeServiceType.swift b/GMERemittance/Module/SendMoneyCode/Application Logic/Service/SendMoneyCodeServiceType.swift index d689e143..884d2cf2 100644 --- a/GMERemittance/Module/SendMoneyCode/Application Logic/Service/SendMoneyCodeServiceType.swift +++ b/GMERemittance/Module/SendMoneyCode/Application Logic/Service/SendMoneyCodeServiceType.swift @@ -7,7 +7,35 @@ // import Foundation +import Alamofire -protocol SendMoneyCodeServiceType: class { +protocol SendMoneyCodeServiceType: class, OtpCodeRequestApiService { } + + +protocol OtpCodeRequestApiService: ApiServiceType { + func requestOtp(customerId: String, success: @escaping (String) -> (), failure: @escaping (Error) -> ()) +} + + +extension OtpCodeRequestApiService { + func requestOtp(customerId: String, success: @escaping (String) -> (), failure: @escaping (Error) -> ()) { + let url = baseUrl + "v2/kftc/GetOTP/\(customerId)" + auth.request(method: .post, url: url, params: nil, encoding: JSONEncoding.default, success: { (response: SuccessMessageContainer) in + + + if (response.errorCode ?? "") == "1" { + let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) + failure(error) + }else { + let model = response.message + success(model ?? "") + } + + + }) { (error) in + failure(error) + } + } +} diff --git a/GMERemittance/Module/SendMoneyCode/Module Interface/SendMoneyCodeModuleInterface.swift b/GMERemittance/Module/SendMoneyCode/Module Interface/SendMoneyCodeModuleInterface.swift index e49a1450..58393bd9 100644 --- a/GMERemittance/Module/SendMoneyCode/Module Interface/SendMoneyCodeModuleInterface.swift +++ b/GMERemittance/Module/SendMoneyCode/Module Interface/SendMoneyCodeModuleInterface.swift @@ -7,5 +7,6 @@ // protocol SendMoneyCodeModuleInterface: class { - + + func viewIsReady() } diff --git a/GMERemittance/Module/SendMoneyCode/User Interface/Presenter/SendMoneyCodePresenter.swift b/GMERemittance/Module/SendMoneyCode/User Interface/Presenter/SendMoneyCodePresenter.swift index f091f390..a50bb7b0 100644 --- a/GMERemittance/Module/SendMoneyCode/User Interface/Presenter/SendMoneyCodePresenter.swift +++ b/GMERemittance/Module/SendMoneyCode/User Interface/Presenter/SendMoneyCodePresenter.swift @@ -22,11 +22,22 @@ class SendMoneyCodePresenter { // MARK: SendMoneyCode module interface extension SendMoneyCodePresenter: SendMoneyCodeModuleInterface { - + func viewIsReady() { + self.view?.showLoading() + interactor?.viewIsReady() + } } // MARK: SendMoneyCode interactor output interface extension SendMoneyCodePresenter: SendMoneyCodeInteractorOutput { + func show(error: Error) { + self.view?.hideLoading() + self.view?.show(error: error.localizedDescription) + } + func show(message: String) { + self.view?.hideLoading() + self.view?.show(message: message) + } } diff --git a/GMERemittance/Module/SendMoneyCode/User Interface/View/SendMoneyCodeViewController.swift b/GMERemittance/Module/SendMoneyCode/User Interface/View/SendMoneyCodeViewController.swift index 66a28e0f..e5a1692d 100644 --- a/GMERemittance/Module/SendMoneyCode/User Interface/View/SendMoneyCodeViewController.swift +++ b/GMERemittance/Module/SendMoneyCode/User Interface/View/SendMoneyCodeViewController.swift @@ -191,15 +191,9 @@ class SendMoneyCodeViewController: UIViewController { private func requestOtpCode() { // request otp - let customerId = Utility.getMyUserName() - self.showProgressHud() - self.requestOtp(customerId: customerId, success: { (message) in - self.hideProgressHud() - self.startTimer() - }) { (error) in - self.hideProgressHud() - self.alert(message: error.localizedDescription) - } + self.presenter?.viewIsReady() + self.startTimer() + } private func startTimer() { @@ -215,12 +209,27 @@ class SendMoneyCodeViewController: UIViewController { private func requestOtpCodeRetryCount() { let _default = UserDefaults.standard -// _default.set(PennyTestStatusCode.requested.rawValue, forKey: AppConstants.pennyTestStatusCode)\ } } // MARK: SendMoneyCodeViewInterface extension SendMoneyCodeViewController: SendMoneyCodeViewInterface { + func showLoading() { + self.showProgressHud() + } + + func hideLoading() { + self.hideProgressHud() + } + + func show(message: String) { + self.alert(message: message) + } + + func show(error: String) { + self.alert(message: error) + } + } diff --git a/GMERemittance/Module/SendMoneyCode/User Interface/View/SendMoneyCodeViewInterface.swift b/GMERemittance/Module/SendMoneyCode/User Interface/View/SendMoneyCodeViewInterface.swift index 16615022..36e8a73d 100644 --- a/GMERemittance/Module/SendMoneyCode/User Interface/View/SendMoneyCodeViewInterface.swift +++ b/GMERemittance/Module/SendMoneyCode/User Interface/View/SendMoneyCodeViewInterface.swift @@ -7,4 +7,8 @@ // protocol SendMoneyCodeViewInterface: class { + func showLoading() + func hideLoading() + func show(message: String) + func show(error: String) } diff --git a/ne.lproj/Localizable.strings b/ne.lproj/Localizable.strings index c5642be8..75cd941a 100644 --- a/ne.lproj/Localizable.strings +++ b/ne.lproj/Localizable.strings @@ -392,3 +392,24 @@ "bengali_language_text" = "বাংলা"; "uzbek_language_text" = "O'zbek"; "english_language_text" = "English"; + + +"resend_money_text" = "पैसा पुन: पठाउनुहोस"; +"resend_search_hint_text" = "GME नम्बर / पाउनेको नाम / बैंकको नाम "; + + +"support_description_text" = "हामी यहाँ सधैं हजुरहरुको मद्दतका लागि छौ "; +"your_request_text" = "यहाँ अनुरोध गर्नुहोस"; +"subject_text" = "बिषय "; +"request_for_cancellation_text" = "रद्द गर्नको लागि अनुरोध "; +"request_for_amendment_text" = "संशोधन अनुरोध "; +"no_subject_error_text" = "कृपया एक विषय लेख्नुहोस"; +"no_message_body_text" = "सन्देश लेख्नुहोस"; +"no_control_id_error_text" = "GME नम्बर फेला परेन"; +"no_transaction_id_error_text" = "कारोबर आईडी फेला परेन"; + + +"account_no_validation_error_text" = "अवैध खाता नम्बर (केवल संख्या र अक्षरहरूलेख्न अनुमति दिइएको छ)"; + + +"resend_code_text" = "फेरि प्रयास गर्नुहोस";