forked from Adyen/adyen-dotnet-api-library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fund.cs
123 lines (114 loc) · 5.61 KB
/
Fund.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
using Adyen.Model.MarketPay;
using Adyen.Service.Resource.Fund;
using Newtonsoft.Json;
namespace Adyen.Service
{
public class Fund : AbstractService
{
private readonly AccountHolderBalance _accountHolderBalance;
private readonly AccountHolderTransactionList _accountHolderTransactionList;
private readonly PayoutAccountHolder _payoutAccountHolder;
private readonly TransferFunds _transferFunds;
private readonly RefundFundsTransfer _refundFundsTransfer;
private readonly SetupBeneficiary _setupBeneficiary;
private readonly RefundNotPaidOutTransfers _refundNotPaidOutTransfers;
public Fund(Client client)
: base(client)
{
_accountHolderBalance = new AccountHolderBalance(this);
_accountHolderTransactionList = new AccountHolderTransactionList(this);
_transferFunds = new TransferFunds(this);
_refundFundsTransfer = new RefundFundsTransfer(this);
_setupBeneficiary = new SetupBeneficiary(this);
_refundNotPaidOutTransfers = new RefundNotPaidOutTransfers(this);
_payoutAccountHolder = new PayoutAccountHolder(this);
}
/// <summary>
/// Post /accountHolderBalance API call
/// </summary>
/// <param name="accountHolderBalanceRequest"></param>
/// <returns>AccountHolderBalanceResponse</returns>
///
public AccountHolderBalanceResponse AccountHolderBalance(
AccountHolderBalanceRequest accountHolderBalanceRequest)
{
var jsonRequest = Util.JsonOperation.SerializeRequest(accountHolderBalanceRequest);
var jsonResponse = _accountHolderBalance.Request(jsonRequest);
return JsonConvert.DeserializeObject<AccountHolderBalanceResponse>(jsonResponse);
}
/// <summary>
/// Post /accountHolderTransactionList API call
/// </summary>
/// <param name="accountHolderTransactionListRequest"></param>
/// <returns>AccountHolderTransactionListResponse</returns>
///
public AccountHolderTransactionListResponse AccountHolderTransactionList(
AccountHolderTransactionListRequest accountHolderTransactionListRequest)
{
string jsonRequest = Util.JsonOperation.SerializeRequest(accountHolderTransactionListRequest);
string jsonResponse = _accountHolderTransactionList.Request(jsonRequest);
return JsonConvert.DeserializeObject<AccountHolderTransactionListResponse>(jsonResponse);
}
/// <summary>
/// Post /transferFunds API call
/// </summary>
/// <param name="transferFundsRequest"></param>
/// <returns>TransferFundsResponse</returns>
///
public TransferFundsResponse TransferFunds(TransferFundsRequest transferFundsRequest)
{
string jsonRequest = Util.JsonOperation.SerializeRequest(transferFundsRequest);
string jsonResponse = _transferFunds.Request(jsonRequest);
return JsonConvert.DeserializeObject<TransferFundsResponse>(jsonResponse);
}
/// <summary>
/// Post /refundFundsTransfer API call
/// </summary>
/// <param name="refundFundsTransferRequest"></param>
/// <returns>RefundFundsTransferResponse</returns>
///
public RefundFundsTransferResponse RefundFundsTransfer(RefundFundsTransferRequest refundFundsTransferRequest)
{
string jsonRequest = Util.JsonOperation.SerializeRequest(refundFundsTransferRequest);
string jsonResponse = _refundFundsTransfer.Request(jsonRequest);
return JsonConvert.DeserializeObject<RefundFundsTransferResponse>(jsonResponse);
}
/// <summary>
/// Post /setupBeneficiary API call
/// </summary>
/// <param name="setupBeneficiaryRequest"></param>
/// <returns>SetupBeneficiaryResponse</returns>
///
public SetupBeneficiaryResponse SetupBeneficiary(SetupBeneficiaryRequest setupBeneficiaryRequest)
{
string jsonRequest = Util.JsonOperation.SerializeRequest(setupBeneficiaryRequest);
string jsonResponse = _setupBeneficiary.Request(jsonRequest);
return JsonConvert.DeserializeObject<SetupBeneficiaryResponse>(jsonResponse);
}
/// <summary>
/// Post /refundNotPaidOutTransfers API call
/// </summary>
/// <param name="refundNotPaidOutTransfersRequest"></param>
/// <returns>RefundNotPaidOutTransfersResponse</returns>
///
public RefundNotPaidOutTransfersResponse RefundNotPaidOutTransfers(
RefundNotPaidOutTransfersRequest refundNotPaidOutTransfersRequest)
{
string jsonRequest = Util.JsonOperation.SerializeRequest(refundNotPaidOutTransfersRequest);
string jsonResponse = _refundNotPaidOutTransfers.Request(jsonRequest);
return JsonConvert.DeserializeObject<RefundNotPaidOutTransfersResponse>(jsonResponse);
}
/// <summary>
/// Post /payoutAccountHolder API call
/// </summary>
/// <param name="payoutAccountHolderRequest"></param>
/// <returns>PayoutAccountHolderResponse</returns>
///
public PayoutAccountHolderResponse PayoutAccountHolder(PayoutAccountHolderRequest payoutAccountHolderRequest)
{
string jsonRequest = Util.JsonOperation.SerializeRequest(payoutAccountHolderRequest);
string jsonResponse = _payoutAccountHolder.Request(jsonRequest);
return JsonConvert.DeserializeObject<PayoutAccountHolderResponse>(jsonResponse);
}
}
}