// // AddAccountService.swift // GME Remit // // Created by InKwon Devik Kim on 12/04/2019. //Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved. // import Foundation import Alamofire class AddAccountService: AddAccountServiceType { // MARK: Properties // MARK: Initialization // MARK: Data management func fetchBankList( success: @escaping ([BankInformation]?) -> Void, failure: @escaping (Error) -> Void ) { APIRouter.fetchBankList .request( success: { (response: KFTCBankList) in if (response.errorCode ?? "") == "1" { let error = NSError.init( domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.msg ?? ""] ) failure(error) } else { success(response.data) } }, failure: failure ) } func verifyAccountService( using model: VerifyAccountRequestModel, success: @escaping () -> Void, failure: @escaping (Error) -> Void) { APIRouter.checkRealName(model: model) .request( success: { (response: KFTCVerifyAccount) in if (response.errorCode ?? "") == "1" { let error = NSError.init( domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""] ) failure(error) } else { success() } }, failure: failure ) } func fetchKftcUrlService( url: String, header: [String: String], success: @escaping (String?) -> Void, failure: @escaping (Error) -> Void) { APIRouter.fetchKFTCURL(url: url) .kftcRequest( header: header, success: { (response: KFTCURL) in success(response.value) }, failure: failure ) } }