Browse Source

version changed over all url

pull/1/head
gme_2 6 years ago
parent
commit
80f53ceddd
  1. 8
      GMERemittance/Api/ApiServiceType.swift
  2. 7
      GMERemittance/Api/ExchangeRateApiService.swift
  3. 4
      GMERemittance/Module/AddReciepient/Application Logic/Service/AddReciepientServiceType.swift
  4. 4
      GMERemittance/Module/Auto refund/autoRefundService.swift
  5. 4
      GMERemittance/Module/AutoDebit/Application Logic/Service/AutoDebitService.swift
  6. 2
      GMERemittance/Module/ForgotPassword/Application Logic/Service/ForgotPasswordServiceType.swift
  7. 2
      GMERemittance/Module/Home/Application Logic/Service/HomeServiceType.swift
  8. 2
      GMERemittance/Module/Login/Application Logic/Service/LoginService.swift
  9. 5
      GMERemittance/Module/MessageCompose/Application Logic/Service/MessageComposeServiceType.swift
  10. 4
      GMERemittance/Module/New Group/Kyc/Application Logic/Service/KycServiceType.swift
  11. 2
      GMERemittance/Module/New Group/kycForm1/Application Logic/Service/kycForm1ServiceType.swift
  12. 4
      GMERemittance/Module/PennyTest/Application Logic/Service/PennyTestServiceType.swift
  13. 2
      GMERemittance/Module/Register/Application Logic/Service/RegisterServiceType.swift
  14. 3
      GMERemittance/Module/Resend/Application Logic/Service/ResendServiceType.swift
  15. 2
      GMERemittance/Module/ResendExchange/Application Logic/Service/ResendExchangeServiceType.swift
  16. 2
      GMERemittance/Module/SendMoney/SendMoneyExchangeRate/Application Logic/Service/SendMoneyExchangeRateServiceType.swift
  17. 6
      GMERemittance/Module/SendMoney/SendMoneyPaymentMode/Application Logic/Service/SendMoneyPaymentModeServiceType.swift
  18. 2
      GMERemittance/Module/SendMoney/SendMoneyReceipt/Application Logic/Service/SendMoneyReceiptServiceType.swift
  19. 2
      GMERemittance/Module/SendMoney/SendMoneyVerification/Application Logic/Service/SendMoneyVerificationServiceType.swift
  20. 2
      GMERemittance/Module/SendMoneyCode/Application Logic/Service/SendMoneyCodeServiceType.swift
  21. 2
      GMERemittance/Module/TransactionHistory/Application Logic/Service/TransactionHistoryServiceType.swift
  22. 2
      GMERemittance/Module/WalletStatement/Application Logic/Service/WalletStatementServiceType.swift
  23. 2
      GMERemittance/Profile/ProfileChangePasswordViewController.swift
  24. 4
      GMERemittance/Recipient/ReciepientServcie.swift
  25. 1
      GMERemittance/SideMenu/SideMenuViewController.swift
  26. 16
      GMERemittance/UrlManager.swift

8
GMERemittance/Api/ApiServiceType.swift

@ -10,14 +10,16 @@ import Foundation
protocol ApiServiceType { protocol ApiServiceType {
var auth: RestApiMananger {get} var auth: RestApiMananger {get}
var oldBaseUrl: String {get}
var baseUrl: String {get} var baseUrl: String {get}
var version: String {get}
var baseUrlWithoutVersion: String {get}
} }
extension ApiServiceType { extension ApiServiceType {
var auth: RestApiMananger {return RestApiMananger.sharedInstance} var auth: RestApiMananger {return RestApiMananger.sharedInstance}
var oldBaseUrl: String {return UrlManager.sharedInstance.oldBaseURL}
var baseUrl: String {return UrlManager.sharedInstance.baseURL}
var baseUrl: String {return UrlManager.sharedInstance.baseURL + UrlManager.sharedInstance.version}
var baseUrlWithoutVersion: String {return UrlManager.sharedInstance.baseURL}
var version: String {return UrlManager.sharedInstance.version }
} }

7
GMERemittance/Api/ExchangeRateApiService.swift

@ -17,8 +17,7 @@ protocol FetchCountryCurrencyInformation: ApiServiceType {
extension FetchCountryCurrencyInformation { extension FetchCountryCurrencyInformation {
func fetchCountryCurrencyInfo(success: @escaping ([ExchangeRateModel]?) -> (), failure: @escaping (Error) -> ()) { func fetchCountryCurrencyInfo(success: @escaping ([ExchangeRateModel]?) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/countriesServices"
// let url = "http://www.mocky.io/v2/5b7e22b3300000630084c052"
let url = baseUrl + "/mobile/countriesServices"
auth.request(method: .get, url: url , params: nil, success: { (response: ExchangeRateContainer) in auth.request(method: .get, url: url , params: nil, success: { (response: ExchangeRateContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])
@ -39,9 +38,7 @@ protocol getExchangeRateInformation: ApiServiceType {
extension getExchangeRateInformation { extension getExchangeRateInformation {
func getExchangeRateInformation(params: [String: String], success: @escaping (ExchangeRateDetailModel?) -> (), failure: @escaping (Error) -> () ) { func getExchangeRateInformation(params: [String: String], success: @escaping (ExchangeRateDetailModel?) -> (), failure: @escaping (Error) -> () ) {
let url = oldBaseUrl + "mobile/calculateDefExRate"
// http://121.156.120.71:5001/api/v1/mobile/countriesServices
// let url = "http://www.mocky.io/v2/5b7e62d2300000690084c117"
let url = baseUrl + "/mobile/calculateDefExRate"
auth.request(method: .post, url: url, params: params, success: { (response: ExchangeRateDetailContainer) in auth.request(method: .post, url: url, params: params, success: { (response: ExchangeRateDetailContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {

4
GMERemittance/Module/AddReciepient/Application Logic/Service/AddReciepientServiceType.swift

@ -19,7 +19,7 @@ protocol FetchSendMoneyInformation: ApiServiceType {
extension FetchSendMoneyInformation { extension FetchSendMoneyInformation {
func fetch(success: @escaping (SendMoneyModel?) -> (), failure: @escaping (Error) -> () ) { func fetch(success: @escaping (SendMoneyModel?) -> (), failure: @escaping (Error) -> () ) {
let url = oldBaseUrl + "mobile/loadform/receiver"
let url = baseUrl + "/mobile/loadform/receiver"
auth.request(method: .get, url: url, params: nil, success: { (response: SendMoneyInformationContainer) in auth.request(method: .get, url: url, params: nil, success: { (response: SendMoneyInformationContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])
@ -41,7 +41,7 @@ protocol SaveReciepientService: ApiServiceType {
extension SaveReciepientService { extension SaveReciepientService {
func save(model:[String: String], username: String, success: @escaping (Recipient?) -> (), failure: @escaping (Error) -> ()) { func save(model:[String: String], username: String, success: @escaping (Recipient?) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/receiver/save/" + username
let url = baseUrl + "/mobile/receiver/save/" + username
auth.request(method: .post, url: url, params: model, success: { (response: RecipientContainer) in auth.request(method: .post, url: url, params: model, success: { (response: RecipientContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])

4
GMERemittance/Module/Auto refund/autoRefundService.swift

@ -19,7 +19,7 @@ protocol FetchAutoRefundInfo: ApiServiceType {
extension FetchAutoRefundInfo { extension FetchAutoRefundInfo {
func fetchAutoRefundInfo(username: String, success: @escaping (AutoRefund) -> (), failure: @escaping (Error) -> ()) { func fetchAutoRefundInfo(username: String, success: @escaping (AutoRefund) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "refund/\(username)"
let url = baseUrl + "/refund/\(username)"
auth.request(method: .get, url: url, params: nil, encoding: URLEncoding.default, success: { (response: AutoRefundContainer) in auth.request(method: .get, url: url, params: nil, encoding: URLEncoding.default, success: { (response: AutoRefundContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])
@ -44,7 +44,7 @@ protocol RefundService: ApiServiceType {
extension RefundService { extension RefundService {
func refund(amount: String, userName: String, chargeAmount: String, userId: String, success: @escaping (SuccessMessage?) -> (), failure: @escaping (Error) -> ()) { func refund(amount: String, userName: String, chargeAmount: String, userId: String, success: @escaping (SuccessMessage?) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "refund/proceed"
let url = baseUrl + "/refund/proceed"
let params = [ let params = [
"Username": userName, "Username": userName,
"Amount": amount, "Amount": amount,

4
GMERemittance/Module/AutoDebit/Application Logic/Service/AutoDebitService.swift

@ -28,7 +28,7 @@ protocol FetchAccountList: ApiServiceType {
extension FetchAccountList { extension FetchAccountList {
func fetchAccountList(username: String, success: @escaping (KFTCModel?) -> (), failure: @escaping (Error) -> ()) { func fetchAccountList(username: String, success: @escaping (KFTCModel?) -> (), failure: @escaping (Error) -> ()) {
let url = baseUrl + "v2/" + "kftc/GetKftcParameters/" + username
let url = baseUrl + "/kftc/GetKftcParameters/" + username
auth.request(method: .get, url: url, params: nil, encoding: URLEncoding.default, success: { (response: KftcAccountContainer) in auth.request(method: .get, url: url, params: nil, encoding: URLEncoding.default, success: { (response: KftcAccountContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
@ -54,7 +54,7 @@ protocol DeleteAccountService: ApiServiceType {
extension DeleteAccountService { extension DeleteAccountService {
func deleteAccount(username: String, account: Account, success: @escaping () -> (), failure: @escaping (Error) -> ()) { func deleteAccount(username: String, account: Account, success: @escaping () -> (), failure: @escaping (Error) -> ()) {
let url = baseUrl + "v2/kftc/DeleteAccount/\(username)"
let url = baseUrl + "/kftc/DeleteAccount/\(username)"
let params = let params =
[ [

2
GMERemittance/Module/ForgotPassword/Application Logic/Service/ForgotPasswordServiceType.swift

@ -20,7 +20,7 @@ protocol PasswordResetService: ApiServiceType {
extension PasswordResetService { extension PasswordResetService {
func reset(username: String, dob: String, success: @escaping (String) -> (), failure: @escaping (Error) -> ()) { func reset(username: String, dob: String, success: @escaping (String) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/passwordReset"
let url = baseUrl + "/mobile/passwordReset"
let params = ["username": username,"Dob": dob] let params = ["username": username,"Dob": dob]
auth.request(method: .post, url: url, params: params, needsAuthorization: false, success: { (response: ResponseMessage) in auth.request(method: .post, url: url, params: params, needsAuthorization: false, success: { (response: ResponseMessage) in

2
GMERemittance/Module/Home/Application Logic/Service/HomeServiceType.swift

@ -21,7 +21,7 @@ protocol UserInfoService: ApiServiceType {
extension UserInfoService { extension UserInfoService {
func fetchUserInfo(param: [String: String], success: @escaping (User) -> (), failure: @escaping (Error) -> ()) { func fetchUserInfo(param: [String: String], success: @escaping (User) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/CustomerProfile"
let url = baseUrl + "/mobile/CustomerProfile"
auth.request(method: .post, url: url, params: param, success: { (response: UserContainer ) in auth.request(method: .post, url: url, params: param, success: { (response: UserContainer ) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: AppConstants.emergencyLogoutErrorCode, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: AppConstants.emergencyLogoutErrorCode, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])

2
GMERemittance/Module/Login/Application Logic/Service/LoginService.swift

@ -25,7 +25,7 @@ protocol LoginApiService: ApiServiceType {
extension LoginApiService { extension LoginApiService {
func _login(userId: String, password: String, success: @escaping (User?) -> (), failure: @escaping (Error) -> ()) { func _login(userId: String, password: String, success: @escaping (User?) -> (), failure: @escaping (Error) -> ()) {
let params = [ "userId": userId, "password": password ] let params = [ "userId": userId, "password": password ]
let url = oldBaseUrl + "users/access-code"
let url = baseUrl + "/users/access-code"
auth.request(method: .post, url: url, params: params,needsAuthorization: false, success: { (response: UserContainer ) in auth.request(method: .post, url: url, params: params,needsAuthorization: false, success: { (response: UserContainer ) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])

5
GMERemittance/Module/MessageCompose/Application Logic/Service/MessageComposeServiceType.swift

@ -21,7 +21,7 @@ protocol MessageCancellationRequestApiService: ApiServiceType {
extension MessageCancellationRequestApiService { extension MessageCancellationRequestApiService {
func cancelTransactionRequest(param: [String: String], success: @escaping (SuccessMessage) -> (), failure: @escaping (Error) -> ()) { func cancelTransactionRequest(param: [String: String], success: @escaping (SuccessMessage) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/sendmoney/canceltransaction"
let url = baseUrl + "/mobile/sendmoney/canceltransaction"
self.auth.request(method: .post, url: url, params: param, success: { (response: SuccessMessageContainer) in self.auth.request(method: .post, url: url, params: param, success: { (response: SuccessMessageContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])
@ -47,7 +47,7 @@ protocol MessageEditRequestApiService: ApiServiceType {
extension MessageEditRequestApiService { extension MessageEditRequestApiService {
func editTransactionRequest(param: [String: String], success: @escaping (SuccessMessage) -> (), failure: @escaping (Error) -> ()) { func editTransactionRequest(param: [String: String], success: @escaping (SuccessMessage) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/sendmoney/amendtransaction"
let url = baseUrl + "/mobile/sendmoney/amendtransaction"
self.auth.request(method: .post, url: url, params: param, success: { (response: SuccessMessageContainer) in self.auth.request(method: .post, url: url, params: param, success: { (response: SuccessMessageContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])
@ -67,4 +67,3 @@ extension MessageEditRequestApiService {
} }
///api/v1/mobile/sendmoney/amendtransaction

4
GMERemittance/Module/New Group/Kyc/Application Logic/Service/KycServiceType.swift

@ -18,11 +18,11 @@ protocol KycServiceType: class, KYCSubmitApiService, UserInfoService {
protocol KYCSubmitApiService: ApiServiceType { protocol KYCSubmitApiService: ApiServiceType {
func submit(param: [String: String], images: [String: Data], success: @escaping (KYCResponse?) -> (), failure: @escaping (Error) -> ()) func submit(param: [String: String], images: [String: Data], success: @escaping (KYCResponse?) -> (), failure: @escaping (Error) -> ())
} }
//http://gmeuat.gmeremit.com:5011/api/v1/mobile/RegisterKyc
extension KYCSubmitApiService { extension KYCSubmitApiService {
func submit(param: [String: String], images: [String: Data], success: @escaping (KYCResponse?) -> (), failure: @escaping (Error) -> ()) { func submit(param: [String: String], images: [String: Data], success: @escaping (KYCResponse?) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/RegisterKyc"
let url = baseUrl + "/mobile/RegisterKyc"
auth.requestMultipart(method: .post, url, parameters: param, images: images, success: { (response: KYCResponseContainer) in auth.requestMultipart(method: .post, url, parameters: param, images: images, success: { (response: KYCResponseContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {

2
GMERemittance/Module/New Group/kycForm1/Application Logic/Service/kycForm1ServiceType.swift

@ -20,7 +20,7 @@ protocol FetchKycInformation: ApiServiceType {
extension FetchKycInformation { extension FetchKycInformation {
func fetch(success: @escaping (KycModel?) -> (), failure: @escaping (Error) -> () ) { func fetch(success: @escaping (KycModel?) -> (), failure: @escaping (Error) -> () ) {
let url = oldBaseUrl + "mobile/loadform/kyc"
let url = baseUrl + "/mobile/loadform/kyc"
auth.request(method: .get, url: url, params: nil, success: { (response: KycModelContainer) in auth.request(method: .get, url: url, params: nil, success: { (response: KycModelContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])

4
GMERemittance/Module/PennyTest/Application Logic/Service/PennyTestServiceType.swift

@ -19,7 +19,7 @@ protocol InitiatePennyTestService: ApiServiceType {
extension InitiatePennyTestService { extension InitiatePennyTestService {
func initiate(userId: String, isResendRequest: String?, success: @escaping (SuccessMessage) -> (), failure: @escaping (Error) -> ()) { func initiate(userId: String, isResendRequest: String?, success: @escaping (SuccessMessage) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/pennytest/start" + "/\(userId)?reSendCode=\(isResendRequest ?? "N")"
let url = baseUrl + "/mobile/pennytest/start" + "/\(userId)?reSendCode=\(isResendRequest ?? "N")"
auth.request(method: .post, url: url, params: nil, encoding: URLEncoding.default, success: { (response: SuccessMessageContainer) in auth.request(method: .post, url: url, params: nil, encoding: URLEncoding.default, success: { (response: SuccessMessageContainer) in
@ -48,7 +48,7 @@ protocol SubmitPennyTestService: ApiServiceType {
extension SubmitPennyTestService { extension SubmitPennyTestService {
func submit(params: [String: String], success: @escaping (SuccessMessage) -> (), failure: @escaping (Error) -> ()) { func submit(params: [String: String], success: @escaping (SuccessMessage) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/pennytest/getcertified"
let url = baseUrl + "/mobile/pennytest/getcertified"
auth.request(method: .post, url: url, params: params, success: { (response: SuccessMessageContainer) in auth.request(method: .post, url: url, params: params, success: { (response: SuccessMessageContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {

2
GMERemittance/Module/Register/Application Logic/Service/RegisterServiceType.swift

@ -21,7 +21,7 @@ protocol RegisterUserService: ApiServiceType {
extension RegisterUserService { extension RegisterUserService {
func register(params: [String: String], success: @escaping (String?) -> (), failure: @escaping (Error) -> ()) { func register(params: [String: String], success: @escaping (String?) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/customerRegister"
let url = baseUrl + "/mobile/customerRegister"
auth.request(method: .post, url: url, params: params, needsAuthorization: false, success: { (response: ResponseMessage) in auth.request(method: .post, url: url, params: params, needsAuthorization: false, success: { (response: ResponseMessage) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])

3
GMERemittance/Module/Resend/Application Logic/Service/ResendServiceType.swift

@ -20,8 +20,7 @@ protocol FetchResendService: ApiServiceType {
extension FetchResendService { extension FetchResendService {
func fetchResendService(user: String, param: [String: String]?, success: @escaping ((ResendListModel?) -> ()), failure: @escaping ((Error) -> ())) { func fetchResendService(user: String, param: [String: String]?, success: @escaping ((ResendListModel?) -> ()), failure: @escaping ((Error) -> ())) {
// let url = baseUrl + "v1/resend/list/" + "\(user)"
let url = baseUrl + "v1/resend/list"
let url = baseUrl + "/resend/list"
self.auth.request(method: .post, url: url, params: param, success: { (response: ResendListModelContainer) in self.auth.request(method: .post, url: url, params: param, success: { (response: ResendListModelContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])

2
GMERemittance/Module/ResendExchange/Application Logic/Service/ResendExchangeServiceType.swift

@ -20,7 +20,7 @@ protocol FetchResendDetailService: ApiServiceType {
extension FetchResendDetailService { extension FetchResendDetailService {
func fetch(transactionId: String, success: @escaping (ResendDetail?) -> (), failure: @escaping (Error) -> ()) { func fetch(transactionId: String, success: @escaping (ResendDetail?) -> (), failure: @escaping (Error) -> ()) {
let url = baseUrl + "v1/resend/detail/" + "\(transactionId)"
let url = baseUrl + "/resend/detail/" + "\(transactionId)"
self.auth.request(method: .get, url: url, params: nil, success: { (response: ResendDetailModelContainer) in self.auth.request(method: .get, url: url, params: nil, success: { (response: ResendDetailModelContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])

2
GMERemittance/Module/SendMoney/SendMoneyExchangeRate/Application Logic/Service/SendMoneyExchangeRateServiceType.swift

@ -18,7 +18,7 @@ protocol FetchSendMoneyExchangeRateService: ApiServiceType {
extension FetchSendMoneyExchangeRateService { extension FetchSendMoneyExchangeRateService {
func calculate(params: [String: String], success: @escaping (SendMoneyExchangeRateModel?) -> (), failure: @escaping (Error) -> ()) { func calculate(params: [String: String], success: @escaping (SendMoneyExchangeRateModel?) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/sendmoney/calculate"
let url = baseUrl + "/mobile/sendmoney/calculate"
auth.request(method: .post, url: url, params: params, success: { (response: SendMoneyExchangeRateModelContainer) in auth.request(method: .post, url: url, params: params, success: { (response: SendMoneyExchangeRateModelContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])

6
GMERemittance/Module/SendMoney/SendMoneyPaymentMode/Application Logic/Service/SendMoneyPaymentModeServiceType.swift

@ -20,7 +20,7 @@ protocol FetchSendMoneyPaymentModeService: ApiServiceType {
// fetch paymentModeServcie // fetch paymentModeServcie
extension FetchSendMoneyPaymentModeService { extension FetchSendMoneyPaymentModeService {
func fetchInformations(countryCode: String, id: String? , success: @escaping (SendMoneyPaymentModel?) -> (), failure: @escaping (Error) -> ()) { func fetchInformations(countryCode: String, id: String? , success: @escaping (SendMoneyPaymentModel?) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/sendmoney/load/\(countryCode)/?receiver=\(id ?? "")"
let url = baseUrl + "/mobile/sendmoney/load/\(countryCode)/?receiver=\(id ?? "")"
auth.request(method: .post, url: url, params: nil, success: { (response: SendMoneyPaymentModelContainer) in auth.request(method: .post, url: url, params: nil, success: { (response: SendMoneyPaymentModelContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])
@ -43,7 +43,7 @@ protocol FetchBankBranchService: ApiServiceType {
extension FetchBankBranchService { extension FetchBankBranchService {
func fetchBranch(countryCode: String, bankId: String, branchName: String, success: @escaping ([SendMoneyBankBranch]) -> (), failure: @escaping (Error) -> ()) { func fetchBranch(countryCode: String, bankId: String, branchName: String, success: @escaping ([SendMoneyBankBranch]) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/sendmoney/load/branch/" + countryCode + "/" + bankId + "/?search=" + branchName
let url = baseUrl + "/mobile/sendmoney/load/branch/" + countryCode + "/" + bankId + "/?search=" + branchName
self.auth.request(method: .post, url: url, params: nil, success: { (response: SendMoneyBankBranchContainer) in self.auth.request(method: .post, url: url, params: nil, success: { (response: SendMoneyBankBranchContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
@ -66,7 +66,7 @@ protocol ValidateAccountNumberService: ApiServiceType {
extension ValidateAccountNumberService { extension ValidateAccountNumberService {
func validate(params: [String: String], success: @escaping () -> (), failure: @escaping (Error) -> ()) { func validate(params: [String: String], success: @escaping () -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/sendmoney/validation/account"
let url = baseUrl + "/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 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" { if (response.errorCode ?? "") == "1" {

2
GMERemittance/Module/SendMoney/SendMoneyReceipt/Application Logic/Service/SendMoneyReceiptServiceType.swift

@ -20,7 +20,7 @@ protocol FetchSendMoneyRecieptList: ApiServiceType {
extension FetchSendMoneyRecieptList { extension FetchSendMoneyRecieptList {
func fetch(transactionId: String, success: @escaping (SendMoneyReciept?) -> (), failure: @escaping (Error) -> ()) { func fetch(transactionId: String, success: @escaping (SendMoneyReciept?) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/receipt/" + transactionId
let url = baseUrl + "/mobile/receipt/" + transactionId
self.auth.request(method: .post, url: url, params: nil, success: { (response: SendMoneyRecieptContainer) in self.auth.request(method: .post, url: url, params: nil, success: { (response: SendMoneyRecieptContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])

2
GMERemittance/Module/SendMoney/SendMoneyVerification/Application Logic/Service/SendMoneyVerificationServiceType.swift

@ -20,7 +20,7 @@ protocol SendMoneyVerificationSubmitApi: ApiServiceType {
extension SendMoneyVerificationSubmitApi { extension SendMoneyVerificationSubmitApi {
func submit(params: [String: String], success: @escaping (SendMoneySubmitModelContainer?) -> (), failure: @escaping (Error) -> ()) { func submit(params: [String: String], success: @escaping (SendMoneySubmitModelContainer?) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/sendmoney/dotransaction"
let url = baseUrl + "/mobile/sendmoney/dotransaction"
self.auth.request(method: .post, url: url, params: params, success: { (response: SendMoneySubmitModelContainer) in self.auth.request(method: .post, url: url, params: params, success: { (response: SendMoneySubmitModelContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])

2
GMERemittance/Module/SendMoneyCode/Application Logic/Service/SendMoneyCodeServiceType.swift

@ -21,7 +21,7 @@ protocol OtpCodeRequestApiService: ApiServiceType {
extension OtpCodeRequestApiService { extension OtpCodeRequestApiService {
func requestOtp(customerId: String, success: @escaping (String) -> (), failure: @escaping (Error) -> ()) { func requestOtp(customerId: String, success: @escaping (String) -> (), failure: @escaping (Error) -> ()) {
let url = baseUrl + "v2/kftc/GetOTP/\(customerId)"
let url = baseUrl + "/kftc/GetOTP/\(customerId)"
auth.request(method: .post, url: url, params: nil, encoding: JSONEncoding.default, success: { (response: SuccessMessageContainer) in auth.request(method: .post, url: url, params: nil, encoding: JSONEncoding.default, success: { (response: SuccessMessageContainer) in

2
GMERemittance/Module/TransactionHistory/Application Logic/Service/TransactionHistoryServiceType.swift

@ -19,7 +19,7 @@ protocol FetchTransactionHistoryService: ApiServiceType {
extension FetchTransactionHistoryService { extension FetchTransactionHistoryService {
func fetchTransactionHistories(user: String, param: [String: String]?, success: @escaping (([TransactionModel]) -> ()), failure: @escaping ((Error) -> ())) { func fetchTransactionHistories(user: String, param: [String: String]?, success: @escaping (([TransactionModel]) -> ()), failure: @escaping ((Error) -> ())) {
let url = oldBaseUrl + "mobile/tranhistory/" + "\(user)"
let url = baseUrl + "/mobile/tranhistory/" + "\(user)"
self.auth.request(method: .post, url: url, params: param, success: { (response: TransactionModelContainer) in self.auth.request(method: .post, url: url, params: param, success: { (response: TransactionModelContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])

2
GMERemittance/Module/WalletStatement/Application Logic/Service/WalletStatementServiceType.swift

@ -19,7 +19,7 @@ protocol FetchWalletStatementService: ApiServiceType {
extension FetchWalletStatementService { extension FetchWalletStatementService {
func fetchWalletStatement(user: String, param: [String: String]?, success: @escaping (([WalletStatement]) -> ()), failure: @escaping ((Error) -> ())) { func fetchWalletStatement(user: String, param: [String: String]?, success: @escaping (([WalletStatement]) -> ()), failure: @escaping ((Error) -> ())) {
let url = oldBaseUrl + "mobile/walletstatement/" + "\(user)"
let url = baseUrl + "/mobile/walletstatement/" + "\(user)"
self.auth.request(method: .post, url: url, params: param, success: { (response: WalletStatementContainer) in self.auth.request(method: .post, url: url, params: param, success: { (response: WalletStatementContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])

2
GMERemittance/Profile/ProfileChangePasswordViewController.swift

@ -281,7 +281,7 @@ protocol UpdatePasswordService: ApiServiceType {
extension UpdatePasswordService { extension UpdatePasswordService {
func updatePassword(params: [String: String], success: @escaping (String?) -> (), failure: @escaping (Error) -> ()) { func updatePassword(params: [String: String], success: @escaping (String?) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/ChangePassword"
let url = baseUrl + "/mobile/ChangePassword"
auth.request(method: .post, url: url, params: params, needsAuthorization: true, success: { (response: SuccessMessageContainer) in auth.request(method: .post, url: url, params: params, needsAuthorization: true, success: { (response: SuccessMessageContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""])

4
GMERemittance/Recipient/ReciepientServcie.swift

@ -19,7 +19,7 @@ protocol FetchRecipientList: ApiServiceType {
//http://localhost:9500/api/v1/mobile/sisir@mailinator.com/receivers?search= //http://localhost:9500/api/v1/mobile/sisir@mailinator.com/receivers?search=
extension FetchRecipientList { extension FetchRecipientList {
func fetchReciepientList(username: String, success: @escaping (RecipientListWrapperContainer?) -> (), failure: @escaping (Error) -> ()) { func fetchReciepientList(username: String, success: @escaping (RecipientListWrapperContainer?) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/" + username + "/receivers"
let url = baseUrl + "/mobile/" + username + "/receivers"
let params = ["search": ""] let params = ["search": ""]
auth.request(method: .get, url: url, params: params, encoding: URLEncoding.default, success: { (response: RecipientListContainer) in auth.request(method: .get, url: url, params: params, encoding: URLEncoding.default, success: { (response: RecipientListContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {
@ -45,7 +45,7 @@ protocol DeleteRecipientService: ApiServiceType {
extension DeleteRecipientService { extension DeleteRecipientService {
func deleteRecipient(username: String, reciepient: Recipient, success: @escaping (Recipient?) -> (), failure: @escaping (Error) -> ()) { func deleteRecipient(username: String, reciepient: Recipient, success: @escaping (Recipient?) -> (), failure: @escaping (Error) -> ()) {
let url = oldBaseUrl + "mobile/receiver/remove/" + username + "/?receiverId=\(reciepient.recipientId ?? "")"
let url = baseUrl + "/mobile/receiver/remove/" + username + "/?receiverId=\(reciepient.recipientId ?? "")"
auth.request(method: .post, url: url, params: nil, encoding: URLEncoding.default, success: { (response: RecipientContainer) in auth.request(method: .post, url: url, params: nil, encoding: URLEncoding.default, success: { (response: RecipientContainer) in
if (response.errorCode ?? "") == "1" { if (response.errorCode ?? "") == "1" {

1
GMERemittance/SideMenu/SideMenuViewController.swift

@ -63,7 +63,6 @@ class SideMenuViewController: UIViewController {
// Life Cycle // Life Cycle
override func viewDidLoad() { override func viewDidLoad() {

16
GMERemittance/UrlManager.swift

@ -16,37 +16,27 @@ class UrlManager {
static let sharedInstance = UrlManager() static let sharedInstance = UrlManager()
// 121.156.120.71:5001 // 121.156.120.71:5001
var oldBaseURL = ""
var version = "v1"
var baseURL = "" var baseURL = ""
let baseSocialURL = "" let baseSocialURL = ""
// 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/"
let oldUatServer = "http://gmeuat.gmeremit.com:5012/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 staggingServerUrl = "http://gmeuat.gmeremit.com:5022/api/"
let liveServerUrl = "https://mobileapi.gmeremit.com:8002/api/" let liveServerUrl = "https://mobileapi.gmeremit.com:8002/api/"
// let uatServer = "http://gmeuat.gmeremit.com:5012/api/"
let uatServer = "http://gmeuat.gmeremit.com:5012/api/" let uatServer = "http://gmeuat.gmeremit.com:5012/api/"
init() { init() {
switch server { switch server {
case .uat: case .uat:
self.oldBaseURL = oldUatServer
self.baseURL = uatServer self.baseURL = uatServer
case .stagging: case .stagging:
self.oldBaseURL = oldStaggingServerUrl
self.baseURL = staggingServerUrl self.baseURL = staggingServerUrl
case .live: case .live:
self.oldBaseURL = oldLiveServerUrl
self.baseURL = liveServerUrl self.baseURL = liveServerUrl
} }
} }

Loading…
Cancel
Save