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
939 B
34 lines
939 B
//
|
|
// SetupRecipientService.swift
|
|
// GME Remit
|
|
//
|
|
// Created by InKwon James Kim on 09/08/2019.
|
|
//Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
class SetupRecipientService: SetupRecipientServiceType {
|
|
func fetchDynamicReceiverFields(
|
|
of country: String,
|
|
success: @escaping ([FieldModel]) -> Void,
|
|
failure: @escaping (Error) -> Void
|
|
) {
|
|
let username = GMEDB.shared.user.string(.userId) ?? ""
|
|
APIRouter.dynamicReceiver(username: username, country: country)
|
|
.request(
|
|
success: { (response: DynamicReceiverContainerModel) in
|
|
if response.errorCode != "0" {
|
|
let error = NSError(
|
|
domain: "Network",
|
|
code: 0,
|
|
message: response.message ?? ""
|
|
)
|
|
failure(error)
|
|
}
|
|
success(response.data?.dynamicField ?? [])
|
|
},
|
|
failure: failure
|
|
)
|
|
}
|
|
}
|