|
|
@ -17,20 +17,20 @@ protocol PennyTestServiceType: class { |
|
|
|
|
|
|
|
|
|
|
|
protocol InitiatePennyTestService: ApiServiceType { |
|
|
|
func initiate(params: [String: String], success: @escaping () -> (), failure: @escaping (Error) -> ()) |
|
|
|
func initiate(params: [String: String], success: @escaping (SuccessMessage) -> (), failure: @escaping (Error) -> ()) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
extension InitiatePennyTestService { |
|
|
|
func initiate(params: [String: String], success: @escaping () -> (), failure: @escaping (Error) -> ()) { |
|
|
|
let url = baseUrl + "blabla" |
|
|
|
func initiate(params: [String: String], success: @escaping (SuccessMessage) -> (), failure: @escaping (Error) -> ()) { |
|
|
|
let url = baseUrl + "mobile/pennytest/start" |
|
|
|
auth.request(method: .post, url: url, params: nil, encoding: URLEncoding.default, success: { (response: SuccessMessageContainer) in |
|
|
|
success() |
|
|
|
// if let model = response.data { |
|
|
|
// |
|
|
|
// }else { |
|
|
|
// let error = NSError.init(domain: "FetchAutoRefundInfo", code: 0, userInfo: [NSLocalizedDescriptionKey : "Could not parse json"]) |
|
|
|
// } |
|
|
|
if let model = response.data { |
|
|
|
success(model) |
|
|
|
}else { |
|
|
|
let error = NSError.init(domain: "FetchAutoRefundInfo", code: 0, userInfo: [NSLocalizedDescriptionKey : "Could not parse json"]) |
|
|
|
failure(error) |
|
|
|
} |
|
|
|
}) { (error) in |
|
|
|
failure(error) |
|
|
|
} |
|
|
|