Browse Source

url and params key added

pull/1/head
ccr 6 years ago
parent
commit
c79ec9bff3
  1. 18
      GMERemittance/Module/PennyTest/Application Logic/Service/PennyTestServiceType.swift
  2. 4
      GMERemittance/Module/PennyTest/User Interface/View/PennyTestViewController.swift

18
GMERemittance/Module/PennyTest/Application Logic/Service/PennyTestServiceType.swift

@ -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)
}

4
GMERemittance/Module/PennyTest/User Interface/View/PennyTestViewController.swift

@ -65,8 +65,8 @@ class PennyTestViewController: UIViewController {
return
let params =
[
"clientId" : Utility.getMyId(),
"primaryAccountNumber" : Utility.getMyPrimaryAccountNumber(),
"UserId" : Utility.getMyUserName(),
"IdNumber" : Utility.getMyPrimaryAccountNumber(),
]
self.showLoading()

Loading…
Cancel
Save