// // SetupRecipientService.swift // GME Remit // // Created by InKwon James Kim on 09/08/2019. //Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved. // import Foundation class SetupRecipientService: SetupRecipientServiceType { func fetchDynamicReceiverFields( of country: String, success: @escaping ([FieldModel]) -> Void, failure: @escaping (Error) -> Void ) { let username = GMEDB.shared.user.string(.userId) ?? "" APIRouter.dynamicReceiver(username: username, country: country) .request( success: { (response: DynamicReceiverContainerModel) in if response.errorCode != "0" { let error = NSError( domain: "Network", code: 0, message: response.message ?? "" ) failure(error) } success(response.data?.dynamicField ?? []) }, failure: failure ) } }