// // WithdrawFromWalletService.swift // GME Remit // // Created by Amrit Giri on 7/6/20. //Copyright © 2020 Gobal Money Express Co. Ltd. All rights reserved. // import Foundation class WithdrawFromWalletService: WithdrawFromWalletServiceType { func makeApiRequest( amount: String, success: @escaping (WithdrawInformation) -> Void, failure: @escaping (Error) -> Void ){ APIRouter .withdrawWalletRequest(amount: amount) .request( needsAuthorization: false, success: {(response: ResponseContainerObject) in if (response.errorCode ?? "") == "1" { let error = NSError(domain: "Network", code: 0, message: response.message ?? "") failure(error) } else { if let model = response.data{ success(model) } } }, failure: {failure($0)} ) } }