diff --git a/GMERemittance.xcodeproj/project.pbxproj b/GMERemittance.xcodeproj/project.pbxproj index 2b2bec64..cb6f1f1b 100644 --- a/GMERemittance.xcodeproj/project.pbxproj +++ b/GMERemittance.xcodeproj/project.pbxproj @@ -234,6 +234,7 @@ D96848CC212D3F2300EF12B1 /* ExchangeRateApiService.swift in Sources */ = {isa = PBXBuildFile; fileRef = D96848CB212D3F2300EF12B1 /* ExchangeRateApiService.swift */; }; D96848CE212D419400EF12B1 /* ApiServiceType.swift in Sources */ = {isa = PBXBuildFile; fileRef = D96848CD212D419400EF12B1 /* ApiServiceType.swift */; }; D99D72AA212D595B00601F48 /* CountryInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D99D72A9212D595B00601F48 /* CountryInfo.swift */; }; + D9E57945212E938D00D47AC0 /* ExchangeRateDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9E57944212E938D00D47AC0 /* ExchangeRateDetailModel.swift */; }; EBFC1719B80F43F88EB01F69 /* Pods_GMERemittanceTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0380AEB198AADC0BC4394515 /* Pods_GMERemittanceTests.framework */; }; FF29296C212B8DFE00FF5BAC /* ExchangeRateCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF29296B212B8DFE00FF5BAC /* ExchangeRateCollectionViewCell.swift */; }; FFD19C7C2112E8F20073689F /* Pods_GMERemittance.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FFD19C7B2112E8F20073689F /* Pods_GMERemittance.framework */; }; @@ -499,6 +500,7 @@ D96848CB212D3F2300EF12B1 /* ExchangeRateApiService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExchangeRateApiService.swift; sourceTree = ""; }; D96848CD212D419400EF12B1 /* ApiServiceType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiServiceType.swift; sourceTree = ""; }; D99D72A9212D595B00601F48 /* CountryInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountryInfo.swift; sourceTree = ""; }; + D9E57944212E938D00D47AC0 /* ExchangeRateDetailModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExchangeRateDetailModel.swift; sourceTree = ""; }; E4028C5A57499BB54764190C /* Pods_GMERemittanceUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GMERemittanceUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; FF29296B212B8DFE00FF5BAC /* ExchangeRateCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExchangeRateCollectionViewCell.swift; sourceTree = ""; }; FFD19C7B2112E8F20073689F /* Pods_GMERemittance.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Pods_GMERemittance.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -1066,6 +1068,7 @@ isa = PBXGroup; children = ( D962231D212C126500B7A115 /* ExchangeModel.swift */, + D9E57944212E938D00D47AC0 /* ExchangeRateDetailModel.swift */, ); path = Model; sourceTree = ""; @@ -1593,6 +1596,7 @@ D9622316212BE3DC00B7A115 /* TablePickerTableViewCell.swift in Sources */, 043BE859204CF3A200221D12 /* MoneyRequestTableViewCell.swift in Sources */, 0496B8481FE7DFA20044810E /* RestApiManager.swift in Sources */, + D9E57945212E938D00D47AC0 /* ExchangeRateDetailModel.swift in Sources */, D96848C7212D3A7400EF12B1 /* DataRequestExtension.swift in Sources */, 9F1F7A5C1FF2146000A4DD82 /* ReviewViewController.swift in Sources */, 0430986E2029FBA300821C70 /* TextFieldExtension.swift in Sources */, diff --git a/GMERemittance/Api/ExchangeRateApiService.swift b/GMERemittance/Api/ExchangeRateApiService.swift index 3c3becce..cb3ba65a 100644 --- a/GMERemittance/Api/ExchangeRateApiService.swift +++ b/GMERemittance/Api/ExchangeRateApiService.swift @@ -28,5 +28,9 @@ extension FetchCountryCurrencyInformation { } } +protocol getExchangeRateInformation: ApiServiceType { + func getExchangeRateInformation(params: [String: String], success: @escaping () -> (), failure: (Error) -> () ) +} + diff --git a/GMERemittance/Model/ExchangeModel.swift b/GMERemittance/Model/ExchangeModel.swift index 138ddf1f..b10c9640 100644 --- a/GMERemittance/Model/ExchangeModel.swift +++ b/GMERemittance/Model/ExchangeModel.swift @@ -57,7 +57,7 @@ class PaymentServiceType: Mappable { class ExchangeRateContainer: Mappable { var errorCode: String? - var msg: String? + var message: String? var id: String? var data: [ExchangeRateModel]? @@ -68,7 +68,7 @@ class ExchangeRateContainer: Mappable { func mapping(map: Map) { errorCode <- map["ErrorCode"] id <- map["Id"] - msg <- map["Msg"] + message <- map["Msg"] data <- map["Data"] } } diff --git a/GMERemittance/Model/ExchangeRateDetailModel.swift b/GMERemittance/Model/ExchangeRateDetailModel.swift new file mode 100644 index 00000000..2d1d71a7 --- /dev/null +++ b/GMERemittance/Model/ExchangeRateDetailModel.swift @@ -0,0 +1,60 @@ +// +// ExchangeRateDetailModel.swift +// GMERemittance +// +// Created by gme_2 on 23/08/2018. +// Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. +// + +import Foundation +import ObjectMapper + +//{ +// "ErrorCode": "0", +// "Msg": "Success", +// "Id": null, +// "Data": { + + + +class ExchangeRateDetailModel: Mappable { + var id: String? + var transferFee: String? + var exchangeRate: String? + var recipientAmount: String? + var senderAmount: String? + var senderCurrency: String? + + required init?(map: Map) { + + } + + func mapping(map: Map) { + id <- map["id"] + transferFee <- map["scCharge"] + exchangeRate <- map["exRateDisplay"] + recipientAmount <- map["pAmt"] + senderAmount <- map["collAmt"] + senderCurrency <- map["collCurr"] + } +} + + +class ExchangeRateDetailContainer: Mappable { + var errorCode: String? + var message: String? + var id: String? + var data: ExchangeRateDetailModel? + + required init?(map: Map) { + + } + + func mapping(map: Map) { + errorCode <- map["errorCode"] + message <- map["msg"] + id <- map["id"] + data <- map["data"] + } + +}