Created
December 30, 2019 22:30
-
-
Save francisrohner/f0f6530fe60671258d6efa3827492d98 to your computer and use it in GitHub Desktop.
CurrencyCloud /v2/funding_accounts/find
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.... | |
#region Accounts | |
.... | |
public async Task<PaginatedFundingAccounts> FindFundingAccountsAsync(FundingAccountFindParameters parameters = null) | |
{ | |
ParamsObject optional = parameters == null ? null : ParamsObject.CreateFromStaticObject(parameters); | |
return await RequestAsync<PaginatedFundingAccounts>("/v2/funding_accounts/find", HttpMethod.Get, optional); | |
} | |
#endregion Accounts | |
.... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace CurrencyCloud.Entity | |
{ | |
public class FundingAccount : Entity | |
{ | |
public string Id { get; set; } | |
public string AccountId { get; set; } | |
public string AccountNumber { get; set; } | |
public string AccountNumberType { get; set; } | |
public string AccountHolderName { get; set; } | |
public string BankAddress { get; set; } | |
public string BankName { get; set; } | |
public string BankCountry { get; set; } | |
public string Currency { get; set; } | |
public string PaymentType { get; set; } | |
public string RegularRoutingCode { get; set; } | |
public string RegularRoutingCodeType { get; set; } | |
public string PriorityRoutingCode { get; set; } | |
public string PriorityRoutingCodeType { get; set; } | |
public DateTime? CreatedAt { get; set; } | |
public DateTime? UpdatedAt { get; set; } | |
public string DisplayRegularRoutingCodeType => DispRoutingType(RegularRoutingCodeType); | |
public string DisplayPriorityRoutingCodeType => DispRoutingType(PriorityRoutingCodeType); | |
private string DispRoutingType(string value) | |
{ | |
Dictionary<string, string> lookup = new Dictionary<string, string>() { | |
{ "sort_code", "Sort Code" }, | |
{ "aba", "ABA Number" }, | |
{ "bsb_code", "BSB Code" }, | |
{ "institution_no", "Institution Number" }, | |
{ "bank_code", "Bank Code" }, | |
{ "branch_code", "Branch Code" }, | |
{ "clabe", "CLABE" }, | |
{ "cnaps", "CNAPS" }, | |
{ "ifsc", "IFSC" } | |
}; | |
string ret = string.Empty; | |
lookup.TryGetValue(value, out ret); | |
return ret; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace CurrencyCloud.Entity.Pagination | |
{ | |
public class PaginatedFundingAccounts | |
{ | |
internal PaginatedFundingAccounts() { } | |
public Pagination Pagination { get; set; } | |
public List<FundingAccount> FundingAccounts { get; set; } | |
public string ToJSON() | |
{ | |
var obj = new[] | |
{ | |
new | |
{ | |
FundingAccounts, | |
Pagination | |
} | |
}; | |
return JsonConvert.SerializeObject(obj); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment