diff --git a/GMERemittance/Api/ApiServiceType.swift b/GMERemittance/Api/ApiServiceType.swift index 0500980f..ae24a0bf 100644 --- a/GMERemittance/Api/ApiServiceType.swift +++ b/GMERemittance/Api/ApiServiceType.swift @@ -10,11 +10,13 @@ import Foundation protocol ApiServiceType { var auth: RestApiMananger {get} - var baseUrl: String {get} + var oldBaseUrl: String {get} + var baseUrl: String {get} } extension ApiServiceType { var auth: RestApiMananger {return RestApiMananger.sharedInstance} + var oldBaseUrl: String {return UrlManager.sharedInstance.oldBaseURL} var baseUrl: String {return UrlManager.sharedInstance.baseURL} } diff --git a/GMERemittance/Api/ExchangeRateApiService.swift b/GMERemittance/Api/ExchangeRateApiService.swift index ae9f6d6f..e62a1f17 100644 --- a/GMERemittance/Api/ExchangeRateApiService.swift +++ b/GMERemittance/Api/ExchangeRateApiService.swift @@ -17,7 +17,7 @@ protocol FetchCountryCurrencyInformation: ApiServiceType { extension FetchCountryCurrencyInformation { func fetchCountryCurrencyInfo(success: @escaping ([ExchangeRateModel]?) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/countriesServices" + let url = oldBaseUrl + "mobile/countriesServices" // let url = "http://www.mocky.io/v2/5b7e22b3300000630084c052" auth.request(method: .get, url: url , params: nil, success: { (response: ExchangeRateContainer) in if (response.errorCode ?? "") == "1" { @@ -39,7 +39,7 @@ protocol getExchangeRateInformation: ApiServiceType { extension getExchangeRateInformation { func getExchangeRateInformation(params: [String: String], success: @escaping (ExchangeRateDetailModel?) -> (), failure: @escaping (Error) -> () ) { - let url = baseUrl + "mobile/calculateDefExRate" + let url = oldBaseUrl + "mobile/calculateDefExRate" // http://121.156.120.71:5001/api/v1/mobile/countriesServices // let url = "http://www.mocky.io/v2/5b7e62d2300000690084c117" diff --git a/GMERemittance/Module/AddReciepient/Application Logic/Service/AddReciepientServiceType.swift b/GMERemittance/Module/AddReciepient/Application Logic/Service/AddReciepientServiceType.swift index 3f3e4290..c6f8cac5 100644 --- a/GMERemittance/Module/AddReciepient/Application Logic/Service/AddReciepientServiceType.swift +++ b/GMERemittance/Module/AddReciepient/Application Logic/Service/AddReciepientServiceType.swift @@ -19,7 +19,7 @@ protocol FetchSendMoneyInformation: ApiServiceType { extension FetchSendMoneyInformation { func fetch(success: @escaping (SendMoneyModel?) -> (), failure: @escaping (Error) -> () ) { - let url = baseUrl + "mobile/loadform/receiver" + let url = oldBaseUrl + "mobile/loadform/receiver" auth.request(method: .get, url: url, params: nil, success: { (response: SendMoneyInformationContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) @@ -41,7 +41,7 @@ protocol SaveReciepientService: ApiServiceType { extension SaveReciepientService { func save(model:[String: String], username: String, success: @escaping (Recipient?) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/receiver/save/" + username + let url = oldBaseUrl + "mobile/receiver/save/" + username auth.request(method: .post, url: url, params: model, success: { (response: RecipientContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/Auto refund/autoRefundService.swift b/GMERemittance/Module/Auto refund/autoRefundService.swift index 55b789b6..b6d6e70b 100644 --- a/GMERemittance/Module/Auto refund/autoRefundService.swift +++ b/GMERemittance/Module/Auto refund/autoRefundService.swift @@ -19,7 +19,7 @@ protocol FetchAutoRefundInfo: ApiServiceType { extension FetchAutoRefundInfo { func fetchAutoRefundInfo(username: String, success: @escaping (AutoRefund) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "refund/\(username)" + let url = oldBaseUrl + "refund/\(username)" auth.request(method: .get, url: url, params: nil, encoding: URLEncoding.default, success: { (response: AutoRefundContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) @@ -44,7 +44,7 @@ protocol RefundService: ApiServiceType { extension RefundService { func refund(amount: String, userName: String, chargeAmount: String, userId: String, success: @escaping (SuccessMessage?) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "refund/proceed" + let url = oldBaseUrl + "refund/proceed" let params = [ "Username": userName, "Amount": amount, diff --git a/GMERemittance/Module/AutoDebit/Application Logic/Service/AutoDebitService.swift b/GMERemittance/Module/AutoDebit/Application Logic/Service/AutoDebitService.swift index e6002d3b..c95a78fb 100644 --- a/GMERemittance/Module/AutoDebit/Application Logic/Service/AutoDebitService.swift +++ b/GMERemittance/Module/AutoDebit/Application Logic/Service/AutoDebitService.swift @@ -28,7 +28,7 @@ protocol FetchAccountList: ApiServiceType { extension FetchAccountList { func fetchAccountList(username: String, success: @escaping (KFTCModel?) -> (), failure: @escaping (Error) -> ()) { - let url = "http://gmeuat.gmeremit.com:5022/api/v2/" + "kftc/GetKftcParameters/" + username + let url = baseUrl + "v2/" + "kftc/GetKftcParameters/" + username auth.request(method: .get, url: url, params: nil, encoding: URLEncoding.default, success: { (response: KftcAccountContainer) in if (response.errorCode ?? "") == "1" { @@ -54,7 +54,7 @@ protocol DeleteAccountService: ApiServiceType { extension DeleteAccountService { func deleteAccount(username: String, account: Account, success: @escaping () -> (), failure: @escaping (Error) -> ()) { - let url = "http://gmeuat.gmeremit.com:5022/api/v2/kftc/DeleteAccount/\(username)" + let url = baseUrl + "v2/kftc/DeleteAccount/\(username)" let params = [ diff --git a/GMERemittance/Module/ForgotPassword/Application Logic/Service/ForgotPasswordServiceType.swift b/GMERemittance/Module/ForgotPassword/Application Logic/Service/ForgotPasswordServiceType.swift index 60598f9e..a5593fd0 100644 --- a/GMERemittance/Module/ForgotPassword/Application Logic/Service/ForgotPasswordServiceType.swift +++ b/GMERemittance/Module/ForgotPassword/Application Logic/Service/ForgotPasswordServiceType.swift @@ -20,7 +20,7 @@ protocol PasswordResetService: ApiServiceType { extension PasswordResetService { func reset(username: String, dob: String, success: @escaping (String) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/passwordReset" + let url = oldBaseUrl + "mobile/passwordReset" let params = ["username": username,"Dob": dob] auth.request(method: .post, url: url, params: params, needsAuthorization: false, success: { (response: ResponseMessage) in diff --git a/GMERemittance/Module/Home/Application Logic/Service/HomeServiceType.swift b/GMERemittance/Module/Home/Application Logic/Service/HomeServiceType.swift index 0b890b43..e61d65a3 100644 --- a/GMERemittance/Module/Home/Application Logic/Service/HomeServiceType.swift +++ b/GMERemittance/Module/Home/Application Logic/Service/HomeServiceType.swift @@ -21,7 +21,7 @@ protocol UserInfoService: ApiServiceType { extension UserInfoService { func fetchUserInfo(param: [String: String], success: @escaping (User) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/CustomerProfile" + let url = oldBaseUrl + "mobile/CustomerProfile" auth.request(method: .post, url: url, params: param, success: { (response: UserContainer ) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: AppConstants.emergencyLogoutErrorCode, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/Login/Application Logic/Service/LoginService.swift b/GMERemittance/Module/Login/Application Logic/Service/LoginService.swift index 187b4cb9..330606a1 100644 --- a/GMERemittance/Module/Login/Application Logic/Service/LoginService.swift +++ b/GMERemittance/Module/Login/Application Logic/Service/LoginService.swift @@ -25,7 +25,7 @@ protocol LoginApiService: ApiServiceType { extension LoginApiService { func _login(userId: String, password: String, success: @escaping (User?) -> (), failure: @escaping (Error) -> ()) { let params = [ "userId": userId, "password": password ] - let url = baseUrl + "users/access-code" + let url = oldBaseUrl + "users/access-code" auth.request(method: .post, url: url, params: params,needsAuthorization: false, success: { (response: UserContainer ) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/MessageCompose/Application Logic/Service/MessageComposeServiceType.swift b/GMERemittance/Module/MessageCompose/Application Logic/Service/MessageComposeServiceType.swift index 0c8ec39c..b572536d 100644 --- a/GMERemittance/Module/MessageCompose/Application Logic/Service/MessageComposeServiceType.swift +++ b/GMERemittance/Module/MessageCompose/Application Logic/Service/MessageComposeServiceType.swift @@ -21,7 +21,7 @@ protocol MessageCancellationRequestApiService: ApiServiceType { extension MessageCancellationRequestApiService { func cancelTransactionRequest(param: [String: String], success: @escaping (SuccessMessage) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/sendmoney/canceltransaction" + let url = oldBaseUrl + "mobile/sendmoney/canceltransaction" self.auth.request(method: .post, url: url, params: param, success: { (response: SuccessMessageContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) @@ -47,7 +47,7 @@ protocol MessageEditRequestApiService: ApiServiceType { extension MessageEditRequestApiService { func editTransactionRequest(param: [String: String], success: @escaping (SuccessMessage) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/sendmoney/amendtransaction" + let url = oldBaseUrl + "mobile/sendmoney/amendtransaction" self.auth.request(method: .post, url: url, params: param, success: { (response: SuccessMessageContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/New Group/Kyc/Application Logic/Service/KycServiceType.swift b/GMERemittance/Module/New Group/Kyc/Application Logic/Service/KycServiceType.swift index 3d955329..d740af76 100644 --- a/GMERemittance/Module/New Group/Kyc/Application Logic/Service/KycServiceType.swift +++ b/GMERemittance/Module/New Group/Kyc/Application Logic/Service/KycServiceType.swift @@ -22,7 +22,7 @@ protocol KYCSubmitApiService: ApiServiceType { extension KYCSubmitApiService { func submit(param: [String: String], images: [String: Data], success: @escaping (KYCResponse?) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/RegisterKyc" + let url = oldBaseUrl + "mobile/RegisterKyc" auth.requestMultipart(method: .post, url, parameters: param, images: images, success: { (response: KYCResponseContainer) in if (response.errorCode ?? "") == "1" { diff --git a/GMERemittance/Module/New Group/kycForm1/Application Logic/Service/kycForm1ServiceType.swift b/GMERemittance/Module/New Group/kycForm1/Application Logic/Service/kycForm1ServiceType.swift index bf36ae8a..2f67ef61 100644 --- a/GMERemittance/Module/New Group/kycForm1/Application Logic/Service/kycForm1ServiceType.swift +++ b/GMERemittance/Module/New Group/kycForm1/Application Logic/Service/kycForm1ServiceType.swift @@ -20,7 +20,7 @@ protocol FetchKycInformation: ApiServiceType { extension FetchKycInformation { func fetch(success: @escaping (KycModel?) -> (), failure: @escaping (Error) -> () ) { - let url = baseUrl + "mobile/loadform/kyc" + let url = oldBaseUrl + "mobile/loadform/kyc" auth.request(method: .get, url: url, params: nil, success: { (response: KycModelContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/PennyTest/Application Logic/Service/PennyTestServiceType.swift b/GMERemittance/Module/PennyTest/Application Logic/Service/PennyTestServiceType.swift index bf07a67c..a90250ec 100644 --- a/GMERemittance/Module/PennyTest/Application Logic/Service/PennyTestServiceType.swift +++ b/GMERemittance/Module/PennyTest/Application Logic/Service/PennyTestServiceType.swift @@ -19,7 +19,7 @@ protocol InitiatePennyTestService: ApiServiceType { extension InitiatePennyTestService { func initiate(userId: String, isResendRequest: String?, success: @escaping (SuccessMessage) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/pennytest/start" + "/\(userId)?reSendCode=\(isResendRequest ?? "N")" + let url = oldBaseUrl + "mobile/pennytest/start" + "/\(userId)?reSendCode=\(isResendRequest ?? "N")" auth.request(method: .post, url: url, params: nil, encoding: URLEncoding.default, success: { (response: SuccessMessageContainer) in @@ -48,7 +48,7 @@ protocol SubmitPennyTestService: ApiServiceType { extension SubmitPennyTestService { func submit(params: [String: String], success: @escaping (SuccessMessage) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/pennytest/getcertified" + let url = oldBaseUrl + "mobile/pennytest/getcertified" auth.request(method: .post, url: url, params: params, success: { (response: SuccessMessageContainer) in if (response.errorCode ?? "") == "1" { diff --git a/GMERemittance/Module/Register/Application Logic/Service/RegisterServiceType.swift b/GMERemittance/Module/Register/Application Logic/Service/RegisterServiceType.swift index 1c108da3..b7803344 100644 --- a/GMERemittance/Module/Register/Application Logic/Service/RegisterServiceType.swift +++ b/GMERemittance/Module/Register/Application Logic/Service/RegisterServiceType.swift @@ -21,7 +21,7 @@ protocol RegisterUserService: ApiServiceType { extension RegisterUserService { func register(params: [String: String], success: @escaping (String?) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/customerRegister" + let url = oldBaseUrl + "mobile/customerRegister" auth.request(method: .post, url: url, params: params, needsAuthorization: false, success: { (response: ResponseMessage) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/SendMoney/SendMoneyExchangeRate/Application Logic/Service/SendMoneyExchangeRateServiceType.swift b/GMERemittance/Module/SendMoney/SendMoneyExchangeRate/Application Logic/Service/SendMoneyExchangeRateServiceType.swift index 4d06d327..3bb2f473 100644 --- a/GMERemittance/Module/SendMoney/SendMoneyExchangeRate/Application Logic/Service/SendMoneyExchangeRateServiceType.swift +++ b/GMERemittance/Module/SendMoney/SendMoneyExchangeRate/Application Logic/Service/SendMoneyExchangeRateServiceType.swift @@ -18,7 +18,7 @@ protocol FetchSendMoneyExchangeRateService: ApiServiceType { extension FetchSendMoneyExchangeRateService { func calculate(params: [String: String], success: @escaping (SendMoneyExchangeRateModel?) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/sendmoney/calculate" + let url = oldBaseUrl + "mobile/sendmoney/calculate" auth.request(method: .post, url: url, params: params, success: { (response: SendMoneyExchangeRateModelContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/SendMoney/SendMoneyPaymentMode/Application Logic/Service/SendMoneyPaymentModeServiceType.swift b/GMERemittance/Module/SendMoney/SendMoneyPaymentMode/Application Logic/Service/SendMoneyPaymentModeServiceType.swift index b1489598..ce4d8dfd 100644 --- a/GMERemittance/Module/SendMoney/SendMoneyPaymentMode/Application Logic/Service/SendMoneyPaymentModeServiceType.swift +++ b/GMERemittance/Module/SendMoney/SendMoneyPaymentMode/Application Logic/Service/SendMoneyPaymentModeServiceType.swift @@ -20,7 +20,7 @@ protocol FetchSendMoneyPaymentModeService: ApiServiceType { // fetch paymentModeServcie extension FetchSendMoneyPaymentModeService { func fetchInformations(countryCode: String, id: String? , success: @escaping (SendMoneyPaymentModel?) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/sendmoney/load/\(countryCode)/?receiver=\(id ?? "")" + let url = oldBaseUrl + "mobile/sendmoney/load/\(countryCode)/?receiver=\(id ?? "")" auth.request(method: .post, url: url, params: nil, success: { (response: SendMoneyPaymentModelContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) @@ -43,7 +43,7 @@ protocol FetchBankBranchService: ApiServiceType { extension FetchBankBranchService { func fetchBranch(countryCode: String, bankId: String, branchName: String, success: @escaping ([SendMoneyBankBranch]) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/sendmoney/load/branch/" + countryCode + "/" + bankId + "/?search=" + branchName + let url = oldBaseUrl + "mobile/sendmoney/load/branch/" + countryCode + "/" + bankId + "/?search=" + branchName self.auth.request(method: .post, url: url, params: nil, success: { (response: SendMoneyBankBranchContainer) in if (response.errorCode ?? "") == "1" { @@ -66,7 +66,7 @@ protocol ValidateAccountNumberService: ApiServiceType { extension ValidateAccountNumberService { func validate(params: [String: String], success: @escaping () -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/sendmoney/validation/account" + let url = oldBaseUrl + "mobile/sendmoney/validation/account" self.auth.request(method: .post, url: url, params: params, success: { (response: SendMoneyBankBranchContainer) in // can use any container. need to map errorcode and message only if (response.errorCode ?? "") == "1" { diff --git a/GMERemittance/Module/SendMoney/SendMoneyReceipt/Application Logic/Service/SendMoneyReceiptServiceType.swift b/GMERemittance/Module/SendMoney/SendMoneyReceipt/Application Logic/Service/SendMoneyReceiptServiceType.swift index 7ba9b552..78f8962f 100644 --- a/GMERemittance/Module/SendMoney/SendMoneyReceipt/Application Logic/Service/SendMoneyReceiptServiceType.swift +++ b/GMERemittance/Module/SendMoney/SendMoneyReceipt/Application Logic/Service/SendMoneyReceiptServiceType.swift @@ -20,7 +20,7 @@ protocol FetchSendMoneyRecieptList: ApiServiceType { extension FetchSendMoneyRecieptList { func fetch(transactionId: String, success: @escaping (SendMoneyReciept?) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/receipt/" + transactionId + let url = oldBaseUrl + "mobile/receipt/" + transactionId self.auth.request(method: .post, url: url, params: nil, success: { (response: SendMoneyRecieptContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/SendMoney/SendMoneyVerification/Application Logic/Service/SendMoneyVerificationServiceType.swift b/GMERemittance/Module/SendMoney/SendMoneyVerification/Application Logic/Service/SendMoneyVerificationServiceType.swift index a534b80c..31ae36a2 100644 --- a/GMERemittance/Module/SendMoney/SendMoneyVerification/Application Logic/Service/SendMoneyVerificationServiceType.swift +++ b/GMERemittance/Module/SendMoney/SendMoneyVerification/Application Logic/Service/SendMoneyVerificationServiceType.swift @@ -20,7 +20,7 @@ protocol SendMoneyVerificationSubmitApi: ApiServiceType { extension SendMoneyVerificationSubmitApi { func submit(params: [String: String], success: @escaping (SendMoneySubmitModelContainer?) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/sendmoney/dotransaction" + let url = oldBaseUrl + "mobile/sendmoney/dotransaction" self.auth.request(method: .post, url: url, params: params, success: { (response: SendMoneySubmitModelContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/SendMoneyCode/Application Logic/Service/SendMoneyCodeService.swift b/GMERemittance/Module/SendMoneyCode/Application Logic/Service/SendMoneyCodeService.swift index a30d9603..6589b692 100644 --- a/GMERemittance/Module/SendMoneyCode/Application Logic/Service/SendMoneyCodeService.swift +++ b/GMERemittance/Module/SendMoneyCode/Application Logic/Service/SendMoneyCodeService.swift @@ -16,3 +16,16 @@ class SendMoneyCodeService: SendMoneyCodeServiceType { // MARK: Data management } + + +protocol OtpCodeRequestApiService: ApiServiceType { + func requestOtp() +} + + +extension OtpCodeRequestApiService { + func requestOtp() { + let url = "/request/otp" + + } +} diff --git a/GMERemittance/Module/SendMoneyCode/User Interface/View/SendMoneyCodeViewController.swift b/GMERemittance/Module/SendMoneyCode/User Interface/View/SendMoneyCodeViewController.swift index 2382a158..d7ffbfef 100644 --- a/GMERemittance/Module/SendMoneyCode/User Interface/View/SendMoneyCodeViewController.swift +++ b/GMERemittance/Module/SendMoneyCode/User Interface/View/SendMoneyCodeViewController.swift @@ -191,3 +191,5 @@ extension SendMoneyCodeViewController: UITextFieldDelegate { return false } } + + diff --git a/GMERemittance/Module/TransactionHistory/Application Logic/Service/TransactionHistoryServiceType.swift b/GMERemittance/Module/TransactionHistory/Application Logic/Service/TransactionHistoryServiceType.swift index 2551205f..0c88b345 100644 --- a/GMERemittance/Module/TransactionHistory/Application Logic/Service/TransactionHistoryServiceType.swift +++ b/GMERemittance/Module/TransactionHistory/Application Logic/Service/TransactionHistoryServiceType.swift @@ -19,7 +19,7 @@ protocol FetchTransactionHistoryService: ApiServiceType { extension FetchTransactionHistoryService { func fetchTransactionHistories(user: String, param: [String: String]?, success: @escaping (([TransactionModel]) -> ()), failure: @escaping ((Error) -> ())) { - let url = baseUrl + "mobile/tranhistory/" + "\(user)" + let url = oldBaseUrl + "mobile/tranhistory/" + "\(user)" self.auth.request(method: .post, url: url, params: param, success: { (response: TransactionModelContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Module/WalletStatement/Application Logic/Service/WalletStatementServiceType.swift b/GMERemittance/Module/WalletStatement/Application Logic/Service/WalletStatementServiceType.swift index 9ca96870..8a180712 100644 --- a/GMERemittance/Module/WalletStatement/Application Logic/Service/WalletStatementServiceType.swift +++ b/GMERemittance/Module/WalletStatement/Application Logic/Service/WalletStatementServiceType.swift @@ -19,7 +19,7 @@ protocol FetchWalletStatementService: ApiServiceType { extension FetchWalletStatementService { func fetchWalletStatement(user: String, param: [String: String]?, success: @escaping (([WalletStatement]) -> ()), failure: @escaping ((Error) -> ())) { - let url = baseUrl + "mobile/walletstatement/" + "\(user)" + let url = oldBaseUrl + "mobile/walletstatement/" + "\(user)" self.auth.request(method: .post, url: url, params: param, success: { (response: WalletStatementContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Profile/ProfileChangePasswordViewController.swift b/GMERemittance/Profile/ProfileChangePasswordViewController.swift index 00c048ed..a0395d8e 100644 --- a/GMERemittance/Profile/ProfileChangePasswordViewController.swift +++ b/GMERemittance/Profile/ProfileChangePasswordViewController.swift @@ -281,7 +281,7 @@ protocol UpdatePasswordService: ApiServiceType { extension UpdatePasswordService { func updatePassword(params: [String: String], success: @escaping (String?) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/ChangePassword" + let url = oldBaseUrl + "mobile/ChangePassword" auth.request(method: .post, url: url, params: params, needsAuthorization: false, success: { (response: SuccessMessageContainer) in if (response.errorCode ?? "") == "1" { let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) diff --git a/GMERemittance/Recipient/ReciepientServcie.swift b/GMERemittance/Recipient/ReciepientServcie.swift index 6470710d..75e7c96b 100644 --- a/GMERemittance/Recipient/ReciepientServcie.swift +++ b/GMERemittance/Recipient/ReciepientServcie.swift @@ -19,7 +19,7 @@ protocol FetchRecipientList: ApiServiceType { //http://localhost:9500/api/v1/mobile/sisir@mailinator.com/receivers?search= extension FetchRecipientList { func fetchReciepientList(username: String, success: @escaping (RecipientListWrapperContainer?) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/" + username + "/receivers" + let url = oldBaseUrl + "mobile/" + username + "/receivers" let params = ["search": ""] auth.request(method: .get, url: url, params: params, encoding: URLEncoding.default, success: { (response: RecipientListContainer) in if (response.errorCode ?? "") == "1" { @@ -45,7 +45,7 @@ protocol DeleteRecipientService: ApiServiceType { extension DeleteRecipientService { func deleteRecipient(username: String, reciepient: Recipient, success: @escaping (Recipient?) -> (), failure: @escaping (Error) -> ()) { - let url = baseUrl + "mobile/receiver/remove/" + username + "/?receiverId=\(reciepient.recipientId ?? "")" + let url = oldBaseUrl + "mobile/receiver/remove/" + username + "/?receiverId=\(reciepient.recipientId ?? "")" auth.request(method: .post, url: url, params: nil, encoding: URLEncoding.default, success: { (response: RecipientContainer) in if (response.errorCode ?? "") == "1" { diff --git a/GMERemittance/UrlManager.swift b/GMERemittance/UrlManager.swift index 0c2a693d..3db9cb59 100644 --- a/GMERemittance/UrlManager.swift +++ b/GMERemittance/UrlManager.swift @@ -16,22 +16,33 @@ class UrlManager { static let sharedInstance = UrlManager() // 121.156.120.71:5001 + var oldBaseURL = "" + var baseURL = "" let baseSocialURL = "" - let staggingServerUrl = "http://gmeuat.gmeremit.com:5022/api/v1/" - let liveServerUrl = "https://mobileapi.gmeremit.com:8002/api/v1/" - let uatServer = "http://gmeuat.gmeremit.com:5012/api/v1/" + + // this is old url that mention version in base url itself. + let oldStaggingServerUrl = "http://gmeuat.gmeremit.com:5022/api/v1/" + let oldLiveServerUrl = "https://mobileapi.gmeremit.com:8002/api/v1/" + let oldUatServer = "http://gmeuat.gmeremit.com:5012/api/v1/" + + // this is the new url without mentioning of version + let staggingServerUrl = "http://gmeuat.gmeremit.com:5022/api/" + let liveServerUrl = "https://mobileapi.gmeremit.com:8002/api/" + let uatServer = "http://gmeuat.gmeremit.com:5012/api/" init() { switch server { case .uat: + self.oldBaseURL = oldUatServer self.baseURL = uatServer case .stagging: + self.oldBaseURL = oldStaggingServerUrl self.baseURL = staggingServerUrl - case .live: + self.oldBaseURL = oldLiveServerUrl self.baseURL = liveServerUrl } }