|
@ -37,6 +37,15 @@ class SendMoneyVerificationViewController: UITableViewController { |
|
|
var requestModel: SendMoneyRequestModel? |
|
|
var requestModel: SendMoneyRequestModel? |
|
|
var hudDelegate: HUDStatusDelegate? |
|
|
var hudDelegate: HUDStatusDelegate? |
|
|
|
|
|
|
|
|
|
|
|
var password: String? { |
|
|
|
|
|
didSet { |
|
|
|
|
|
if let model = self.requestModel, let reciepient = self.reciepient { |
|
|
|
|
|
model.transactionPassword = password ?? "" |
|
|
|
|
|
self.presenter?.submit(model: model, reciepient: reciepient) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// MARK: VC's Life cycle |
|
|
// MARK: VC's Life cycle |
|
|
|
|
|
|
|
|
override func viewDidLoad() { |
|
|
override func viewDidLoad() { |
|
@ -59,10 +68,9 @@ class SendMoneyVerificationViewController: UITableViewController { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
self.askPassword() |
|
|
|
|
|
|
|
|
// submit the request model |
|
|
// submit the request model |
|
|
if let model = self.requestModel, let reciepient = self.reciepient { |
|
|
|
|
|
self.presenter?.submit(model: model, reciepient: reciepient) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
// MARK: Other Functions |
|
|
// MARK: Other Functions |
|
|
|
|
|
|
|
@ -94,10 +102,48 @@ class SendMoneyVerificationViewController: UITableViewController { |
|
|
self.serviceChargeLabel.text = self.requestModel?.exchangeRateDetail?.transferFee |
|
|
self.serviceChargeLabel.text = self.requestModel?.exchangeRateDetail?.transferFee |
|
|
self.payoutAgentBankLabel.text = self.requestModel?.bank?.name |
|
|
self.payoutAgentBankLabel.text = self.requestModel?.bank?.name |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func askPassword() { |
|
|
|
|
|
let alertController = UIAlertController(title: "Enter your login password", message: "", preferredStyle: .alert) |
|
|
|
|
|
|
|
|
|
|
|
alertController.addTextField { (textField : UITextField!) -> Void in |
|
|
|
|
|
textField.placeholder = "Enter password" |
|
|
|
|
|
textField.isSecureTextEntry = true |
|
|
|
|
|
textField.tag = 51 |
|
|
|
|
|
// textField.delegate = self |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let confirmAction = UIAlertAction(title: "Confirm", style: .default, handler: { |
|
|
|
|
|
alert -> Void in |
|
|
|
|
|
let passwordTextField = alertController.textFields![0] as UITextField |
|
|
|
|
|
if passwordTextField.text! != "" { |
|
|
|
|
|
self.password = passwordTextField.text! |
|
|
|
|
|
} else { |
|
|
|
|
|
self.alert(message: "Password was missing") |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
let cancelAction = UIAlertAction(title: "Cancel", style: .destructive, handler: { |
|
|
|
|
|
(action : UIAlertAction!) -> Void in |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
cancelAction.setValue(UIColor.black, forKey: "titleTextColor") |
|
|
|
|
|
confirmAction.setValue(UIColor(hex:0xEC1C24), forKey: "titleTextColor") |
|
|
|
|
|
|
|
|
|
|
|
alertController.addAction(cancelAction) |
|
|
|
|
|
alertController.addAction(confirmAction) |
|
|
|
|
|
|
|
|
|
|
|
self.present(alertController, animated: true, completion: nil) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// MARK: SendMoneyVerificationViewInterface |
|
|
// MARK: SendMoneyVerificationViewInterface |
|
|
extension SendMoneyVerificationViewController: SendMoneyVerificationViewInterface { |
|
|
extension SendMoneyVerificationViewController: SendMoneyVerificationViewInterface { |
|
|
|
|
|
func show(model: SendMoneySubmitModel?) { |
|
|
|
|
|
print(model?.charge) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
func show(error: String) { |
|
|
func show(error: String) { |
|
|
self.alert(message: error) |
|
|
self.alert(message: error) |
|
|
} |
|
|
} |
|
@ -116,3 +162,6 @@ extension SendMoneyVerificationViewController { |
|
|
self.viewWillAppear(true) |
|
|
self.viewWillAppear(true) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|