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.

35 lines
956 B

4 years ago
  1. //
  2. // RedeemCashPickUpService.swift
  3. // GME Remit
  4. //
  5. // Created by Amrit Giri on 7/6/20.
  6. //Copyright © 2020 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. class RedeemCashPickUpService: RedeemCashPickUpServiceType {
  10. func searchControlNumber(
  11. controlNo: String,
  12. success: @escaping (TransactionModel) -> Void,
  13. failure: @escaping (Error) -> Void
  14. ){
  15. APIRouter
  16. .searchTxnByControlNumber(controlNumber: controlNo)
  17. .request(
  18. needsAuthorization: false,
  19. success: {(response: ResponseContainerObject<TransactionModel>) in
  20. if (response.errorCode ?? "") != "0" {
  21. let error = NSError(domain: "Network", code: 0, message: response.message ?? "")
  22. failure(error)
  23. } else {
  24. if let model = response.data{
  25. success(model)
  26. }
  27. }
  28. },
  29. failure: {failure($0)}
  30. )
  31. }
  32. }