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.

34 lines
1.0 KiB

4 years ago
4 years ago
4 years ago
  1. //
  2. // WithdrawFromWalletDetailService.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 WithdrawFromWalletDetailService: WithdrawFromWalletDetailServiceType {
  10. func makeApiRequest(
  11. txnId: String,
  12. amount: String,
  13. password: String,
  14. success: @escaping (String?) -> Void,
  15. failure: @escaping (Error) -> Void
  16. ){
  17. APIRouter
  18. .withdrawFromWallet(txnId: txnId,amount: amount, password: password)
  19. .request(
  20. needsAuthorization: false,
  21. success: {(response: ResponseMessage) in
  22. if (response.errorCode ?? "") != "0" {
  23. let error = NSError(domain: "Network", code: 0, message: response.message ?? "")
  24. failure(error)
  25. } else {
  26. success(response.message ?? "")
  27. }
  28. },
  29. failure: {failure($0)}
  30. )
  31. }
  32. }