|
@ -14,19 +14,19 @@ protocol SendMoneyVerificationServiceType: class, SendMoneyVerificationSubmitApi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protocol SendMoneyVerificationSubmitApi: ApiServiceType { |
|
|
protocol SendMoneyVerificationSubmitApi: ApiServiceType { |
|
|
func submit(params: [String: String], success: @escaping (SendMoneySubmitModel?) -> (), failure: @escaping (Error) -> ()) |
|
|
|
|
|
|
|
|
func submit(params: [String: String], success: @escaping (SendMoneySubmitModelContainer?) -> (), failure: @escaping (Error) -> ()) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extension SendMoneyVerificationSubmitApi { |
|
|
extension SendMoneyVerificationSubmitApi { |
|
|
func submit(params: [String: String], success: @escaping (SendMoneySubmitModel?) -> (), failure: @escaping (Error) -> ()) { |
|
|
|
|
|
|
|
|
func submit(params: [String: String], success: @escaping (SendMoneySubmitModelContainer?) -> (), failure: @escaping (Error) -> ()) { |
|
|
let url = baseUrl + "mobile/sendmoney/dotransaction" |
|
|
let url = baseUrl + "mobile/sendmoney/dotransaction" |
|
|
self.auth.request(method: .post, url: url, params: params, success: { (response: SendMoneySubmitModelContainer) in |
|
|
self.auth.request(method: .post, url: url, params: params, success: { (response: SendMoneySubmitModelContainer) in |
|
|
if (response.errorCode ?? "") == "1" { |
|
|
if (response.errorCode ?? "") == "1" { |
|
|
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) |
|
|
let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) |
|
|
failure(error) |
|
|
failure(error) |
|
|
}else { |
|
|
}else { |
|
|
let model = response.data |
|
|
|
|
|
|
|
|
let model = response |
|
|
success(model) |
|
|
success(model) |
|
|
} |
|
|
} |
|
|
}) { (error) in |
|
|
}) { (error) in |
|
|