|
|
@ -13,6 +13,27 @@ protocol SendMoneyReceiptServiceType: class { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protocol FetchRecieptList { |
|
|
|
// func fetch(transactionId: String, ) |
|
|
|
protocol FetchRecieptList: ApiServiceType { |
|
|
|
func fetch(transactionId: String, success: @escaping (SendMoneyReciept?) -> (), failure: @escaping (Error) -> ()) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
extension FetchRecieptList { |
|
|
|
func fetch(transactionId: String, success: @escaping (SendMoneyReciept?) -> (), failure: @escaping (Error) -> ()) { |
|
|
|
let url = baseUrl + "mobile/receipt/" + transactionId |
|
|
|
self.auth.request(method: .get, url: url, params: nil, success: { (response: SendMoneyRecieptContainer) in |
|
|
|
if (response.errorCode ?? "") == "1" { |
|
|
|
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) |
|
|
|
failure(error) |
|
|
|
}else { |
|
|
|
let model = response.data |
|
|
|
success(model) |
|
|
|
} |
|
|
|
}) { (error) in |
|
|
|
failure(error) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//http://localhost:9500/api/v1/mobile/receipt/123455 |