// // CommonServiceType.swift // GME Remit // // Created by InKwon James Kim on 30/07/2019. // Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved. // import Foundation protocol CommonServiceType: ApiServiceType { func isValidate( userName: String, idNumber: String, idType: String, success: @escaping (Bool, String?) -> Void, failure: @escaping (Error) -> Void ) } extension CommonServiceType { func isValidate( userName: String = "", idNumber: String = "", idType: String = "", success: @escaping (Bool, String?) -> Void, failure: @escaping (Error) -> Void ) { APIRouter.validation( userName: userName, idNumber: idNumber, idType: idType ) .request( needsAuthorization: false, success: { (response: ResponseMessage) in if (response.errorCode ?? "") == "1" { success(false, response.message) } else { success(true, nil) } }, failure: { failure($0)} ) } }