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.1 KiB

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