You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.5 KiB

6 years ago
6 years ago
  1. //
  2. // SendMoneyPaymentModeInteractor.swift
  3. // GMERemittance
  4. //
  5. // Created by gme_2 on 28/08/2018.
  6. //Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. class SendMoneyPaymentModeInteractor {
  10. // MARK: Properties
  11. weak var output: SendMoneyPaymentModeInteractorOutput?
  12. private let service: SendMoneyPaymentModeServiceType
  13. // MARK: Initialization
  14. init(service: SendMoneyPaymentModeServiceType) {
  15. self.service = service
  16. }
  17. // MARK: Converting entities
  18. // MARK: Private Functions
  19. }
  20. // MARK: SendMoneyPaymentMode interactor input interface
  21. extension SendMoneyPaymentModeInteractor: SendMoneyPaymentModeInteractorInput {
  22. func viewIsReady(for reciepient: Recipient) {
  23. let countryCode = reciepient.countryCode ?? ""
  24. let id = reciepient.recipientId ?? ""
  25. self.service.fetchInformations(countryCode: countryCode, id: id, success: { (model) in
  26. self.output?.show(model: model?.payoutMode ?? [])
  27. }) { (error) in
  28. self.output?.show(error: error)
  29. }
  30. }
  31. func validateAccountNumber(params: [String : String]) {
  32. self.service.validate(params: params, success: {
  33. self.output?.success()
  34. }) { (error) in
  35. self.output?.show(error: error)
  36. }
  37. }
  38. // func validate(accountNumber: String) {
  39. // accountNumber.isEmpty ? (self.showEmptyAccountNumberError()) : (self._validate(accountNumber: accountNumber))
  40. // }
  41. }