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.

45 lines
1.2 KiB

  1. //
  2. // SendMoneyCodeInteractor.swift
  3. // GME Remit
  4. //
  5. // Created by gme_2 on 27/02/2019.
  6. //Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. class SendMoneyCodeInteractor {
  10. // MARK: Properties
  11. weak var output: SendMoneyCodeInteractorOutput?
  12. private let service: SendMoneyCodeServiceType
  13. private var request: SendMoneyRequestModel?
  14. // MARK: Initialization
  15. init(service: SendMoneyCodeServiceType, request: SendMoneyRequestModel?) {
  16. self.service = service
  17. self.request = request
  18. }
  19. // MARK: Converting entities
  20. }
  21. // MARK: SendMoneyCode interactor input interface
  22. extension SendMoneyCodeInteractor: SendMoneyCodeInteractorInput {
  23. func viewIsReady() {
  24. let customerId = Utility.getMyUserName()
  25. let params = [
  26. "amount": request?.exchangeRateDetail?.autodebitSendingAmount ?? "",
  27. "kftcId": request?.autoDebitAccount?.kftcLogId ?? "",
  28. "userId": Utility.getMyUserName()
  29. ]
  30. self.service.requestOtp(params: params, customerId: customerId, success: { (message) in
  31. self.output?.show(message: message)
  32. }) { (error) in
  33. self.output?.show(error: error)
  34. }
  35. }
  36. }