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

//
// WithdrawFromWalletDetailService.swift
// GME Remit
//
// Created by Amrit Giri on 7/6/20.
//Copyright © 2020 Gobal Money Express Co. Ltd. All rights reserved.
//
import Foundation
class WithdrawFromWalletDetailService: WithdrawFromWalletDetailServiceType {
func makeApiRequest(
txnId: String,
amount: String,
password: String,
success: @escaping (String?) -> Void,
failure: @escaping (Error) -> Void
){
APIRouter
.withdrawFromWallet(txnId: txnId,amount: amount, password: password)
.request(
needsAuthorization: false,
success: {(response: ResponseMessage) in
if (response.errorCode ?? "") != "0" {
let error = NSError(domain: "Network", code: 0, message: response.message ?? "")
failure(error)
} else {
success(response.message ?? "")
}
},
failure: {failure($0)}
)
}
}