• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Adyen / adyen-java-api-library / #2661

22 Sep 2023 11:24AM UTC coverage: 12.611%. First build
#2661

push

web-flow
Merge 251f6ff51 into 9e36e9c01

9262 of 9262 new or added lines in 142 files covered. (100.0%)

11033 of 87486 relevant lines covered (12.61%)

0.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

17.39
/src/main/java/com/adyen/service/classicplatforms/ClassicPlatformFundApi.java
1
/*
2
 * Fund API
3
 * This API is used for the classic integration. If you are just starting your implementation, refer to our [new integration guide](https://docs.adyen.com/marketplaces-and-platforms) instead.  The Fund API provides endpoints for managing the funds in the accounts on your platform. These management operations include, for example, the transfer of funds from one account to another, the payout of funds to an account holder, and the retrieval of balances in an account.  For more information, refer to our [documentation](https://docs.adyen.com/marketplaces-and-platforms/classic/). ## Authentication Your Adyen contact will provide your API credential and an API key. To connect to the API, add an `X-API-Key` header with the API key as the value, for example:   ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: YOUR_API_KEY\" \\ ... ```  Alternatively, you can use the username and password to connect to the API using basic authentication. For example:  ``` curl -U \"ws@MarketPlace.YOUR_PLATFORM_ACCOUNT\":\"YOUR_WS_PASSWORD\" \\ -H \"Content-Type: application/json\" \\ ... ``` When going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints).  ## Versioning The Fund API supports [versioning](https://docs.adyen.com/development-resources/versioning) using a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number.  For example: ``` https://cal-test.adyen.com/cal/services/Fund/v6/accountHolderBalance ```
4
 *
5
 * The version of the OpenAPI document: 6
6
 * 
7
 *
8
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
 * https://openapi-generator.tech
10
 * Do not edit the class manually.
11
 */
12

13
package com.adyen.service.classicplatforms;
14

15
import com.adyen.Client;
16
import com.adyen.Service;
17
import com.adyen.constants.ApiConstants;
18
import com.adyen.model.marketpayfund.AccountHolderBalanceRequest;
19
import com.adyen.model.marketpayfund.AccountHolderBalanceResponse;
20
import com.adyen.model.marketpayfund.AccountHolderTransactionListRequest;
21
import com.adyen.model.marketpayfund.AccountHolderTransactionListResponse;
22
import com.adyen.model.marketpayfund.DebitAccountHolderRequest;
23
import com.adyen.model.marketpayfund.DebitAccountHolderResponse;
24
import com.adyen.model.marketpayfund.PayoutAccountHolderRequest;
25
import com.adyen.model.marketpayfund.PayoutAccountHolderResponse;
26
import com.adyen.model.marketpayfund.RefundFundsTransferRequest;
27
import com.adyen.model.marketpayfund.RefundFundsTransferResponse;
28
import com.adyen.model.marketpayfund.RefundNotPaidOutTransfersRequest;
29
import com.adyen.model.marketpayfund.RefundNotPaidOutTransfersResponse;
30
import com.adyen.model.marketpayfund.ServiceError;
31
import com.adyen.model.marketpayfund.SetupBeneficiaryRequest;
32
import com.adyen.model.marketpayfund.SetupBeneficiaryResponse;
33
import com.adyen.model.marketpayfund.TransferFundsRequest;
34
import com.adyen.model.marketpayfund.TransferFundsResponse;
35
import com.adyen.model.RequestOptions;
36
import com.adyen.service.exception.ApiException;
37
import com.adyen.service.resource.Resource;
38

39
import java.io.IOException;
40
import java.util.HashMap;
41
import java.util.Map;
42

43
public class ClassicPlatformFundApi extends Service {
44

45
    public static final String API_VERSION = "6";
46

47
    protected String baseURL;
48

49
    /**
50
    * General constructor in {@link com.adyen.service package}.
51
    * @param client {@link Client }  (required)
52
    */
53
    public ClassicPlatformFundApi(Client client) {
54
        super(client);
1✔
55
        this.baseURL = createBaseURL("https://cal-test.adyen.com/cal/services/Fund/v6");
1✔
56
    }
1✔
57

58
    /**
59
    * General constructor in {@link com.adyen.service package}.
60
    * Please use this constructor only if you would like to pass along your own url for routing or testing purposes. The latest API version is defined in this class as a constant.
61
    * @param client {@link Client }  (required)
62
    * @param baseURL {@link String }  (required)
63
    */
64
    public ClassicPlatformFundApi(Client client, String baseURL) {
65
        super(client);
×
66
        this.baseURL = baseURL;
×
67
    }
×
68

69
    /**
70
    * Get the balances of an account holder
71
    *
72
    * @param accountHolderBalanceRequest {@link AccountHolderBalanceRequest }  (required)
73
    * @return {@link AccountHolderBalanceResponse }
74
    * @throws ApiException if fails to make API call
75
    */
76
    public AccountHolderBalanceResponse accountHolderBalance(AccountHolderBalanceRequest accountHolderBalanceRequest) throws ApiException, IOException {
77
        return accountHolderBalance(accountHolderBalanceRequest, null);
×
78
    }
79

80
    /**
81
    * Get the balances of an account holder
82
    *
83
    * @param accountHolderBalanceRequest {@link AccountHolderBalanceRequest }  (required)
84
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
85
    * @return {@link AccountHolderBalanceResponse }
86
    * @throws ApiException if fails to make API call
87
    */
88
    public AccountHolderBalanceResponse accountHolderBalance(AccountHolderBalanceRequest accountHolderBalanceRequest, RequestOptions requestOptions) throws ApiException, IOException {
89

90
        String requestBody = accountHolderBalanceRequest.toJson();
×
91
        Resource resource = new Resource(this, this.baseURL + "/accountHolderBalance", null);
×
92
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
×
93
        return AccountHolderBalanceResponse.fromJson(jsonResult);
×
94
    }
95

96
    /**
97
    * Get a list of transactions
98
    *
99
    * @param accountHolderTransactionListRequest {@link AccountHolderTransactionListRequest }  (required)
100
    * @return {@link AccountHolderTransactionListResponse }
101
    * @throws ApiException if fails to make API call
102
    */
103
    public AccountHolderTransactionListResponse accountHolderTransactionList(AccountHolderTransactionListRequest accountHolderTransactionListRequest) throws ApiException, IOException {
104
        return accountHolderTransactionList(accountHolderTransactionListRequest, null);
×
105
    }
106

107
    /**
108
    * Get a list of transactions
109
    *
110
    * @param accountHolderTransactionListRequest {@link AccountHolderTransactionListRequest }  (required)
111
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
112
    * @return {@link AccountHolderTransactionListResponse }
113
    * @throws ApiException if fails to make API call
114
    */
115
    public AccountHolderTransactionListResponse accountHolderTransactionList(AccountHolderTransactionListRequest accountHolderTransactionListRequest, RequestOptions requestOptions) throws ApiException, IOException {
116

117
        String requestBody = accountHolderTransactionListRequest.toJson();
×
118
        Resource resource = new Resource(this, this.baseURL + "/accountHolderTransactionList", null);
×
119
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
×
120
        return AccountHolderTransactionListResponse.fromJson(jsonResult);
×
121
    }
122

123
    /**
124
    * Send a direct debit request
125
    *
126
    * @param debitAccountHolderRequest {@link DebitAccountHolderRequest }  (required)
127
    * @return {@link DebitAccountHolderResponse }
128
    * @throws ApiException if fails to make API call
129
    */
130
    public DebitAccountHolderResponse debitAccountHolder(DebitAccountHolderRequest debitAccountHolderRequest) throws ApiException, IOException {
131
        return debitAccountHolder(debitAccountHolderRequest, null);
×
132
    }
133

134
    /**
135
    * Send a direct debit request
136
    *
137
    * @param debitAccountHolderRequest {@link DebitAccountHolderRequest }  (required)
138
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
139
    * @return {@link DebitAccountHolderResponse }
140
    * @throws ApiException if fails to make API call
141
    */
142
    public DebitAccountHolderResponse debitAccountHolder(DebitAccountHolderRequest debitAccountHolderRequest, RequestOptions requestOptions) throws ApiException, IOException {
143

144
        String requestBody = debitAccountHolderRequest.toJson();
×
145
        Resource resource = new Resource(this, this.baseURL + "/debitAccountHolder", null);
×
146
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
×
147
        return DebitAccountHolderResponse.fromJson(jsonResult);
×
148
    }
149

150
    /**
151
    * Pay out from an account to the account holder
152
    *
153
    * @param payoutAccountHolderRequest {@link PayoutAccountHolderRequest }  (required)
154
    * @return {@link PayoutAccountHolderResponse }
155
    * @throws ApiException if fails to make API call
156
    */
157
    public PayoutAccountHolderResponse payoutAccountHolder(PayoutAccountHolderRequest payoutAccountHolderRequest) throws ApiException, IOException {
158
        return payoutAccountHolder(payoutAccountHolderRequest, null);
1✔
159
    }
160

161
    /**
162
    * Pay out from an account to the account holder
163
    *
164
    * @param payoutAccountHolderRequest {@link PayoutAccountHolderRequest }  (required)
165
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
166
    * @return {@link PayoutAccountHolderResponse }
167
    * @throws ApiException if fails to make API call
168
    */
169
    public PayoutAccountHolderResponse payoutAccountHolder(PayoutAccountHolderRequest payoutAccountHolderRequest, RequestOptions requestOptions) throws ApiException, IOException {
170

171
        String requestBody = payoutAccountHolderRequest.toJson();
1✔
172
        Resource resource = new Resource(this, this.baseURL + "/payoutAccountHolder", null);
1✔
173
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
1✔
174
        return PayoutAccountHolderResponse.fromJson(jsonResult);
1✔
175
    }
176

177
    /**
178
    * Refund a funds transfer
179
    *
180
    * @param refundFundsTransferRequest {@link RefundFundsTransferRequest }  (required)
181
    * @return {@link RefundFundsTransferResponse }
182
    * @throws ApiException if fails to make API call
183
    */
184
    public RefundFundsTransferResponse refundFundsTransfer(RefundFundsTransferRequest refundFundsTransferRequest) throws ApiException, IOException {
185
        return refundFundsTransfer(refundFundsTransferRequest, null);
×
186
    }
187

188
    /**
189
    * Refund a funds transfer
190
    *
191
    * @param refundFundsTransferRequest {@link RefundFundsTransferRequest }  (required)
192
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
193
    * @return {@link RefundFundsTransferResponse }
194
    * @throws ApiException if fails to make API call
195
    */
196
    public RefundFundsTransferResponse refundFundsTransfer(RefundFundsTransferRequest refundFundsTransferRequest, RequestOptions requestOptions) throws ApiException, IOException {
197

198
        String requestBody = refundFundsTransferRequest.toJson();
×
199
        Resource resource = new Resource(this, this.baseURL + "/refundFundsTransfer", null);
×
200
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
×
201
        return RefundFundsTransferResponse.fromJson(jsonResult);
×
202
    }
203

204
    /**
205
    * Refund all transactions of an account since the most recent payout
206
    *
207
    * @param refundNotPaidOutTransfersRequest {@link RefundNotPaidOutTransfersRequest }  (required)
208
    * @return {@link RefundNotPaidOutTransfersResponse }
209
    * @throws ApiException if fails to make API call
210
    */
211
    public RefundNotPaidOutTransfersResponse refundNotPaidOutTransfers(RefundNotPaidOutTransfersRequest refundNotPaidOutTransfersRequest) throws ApiException, IOException {
212
        return refundNotPaidOutTransfers(refundNotPaidOutTransfersRequest, null);
×
213
    }
214

215
    /**
216
    * Refund all transactions of an account since the most recent payout
217
    *
218
    * @param refundNotPaidOutTransfersRequest {@link RefundNotPaidOutTransfersRequest }  (required)
219
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
220
    * @return {@link RefundNotPaidOutTransfersResponse }
221
    * @throws ApiException if fails to make API call
222
    */
223
    public RefundNotPaidOutTransfersResponse refundNotPaidOutTransfers(RefundNotPaidOutTransfersRequest refundNotPaidOutTransfersRequest, RequestOptions requestOptions) throws ApiException, IOException {
224

225
        String requestBody = refundNotPaidOutTransfersRequest.toJson();
×
226
        Resource resource = new Resource(this, this.baseURL + "/refundNotPaidOutTransfers", null);
×
227
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
×
228
        return RefundNotPaidOutTransfersResponse.fromJson(jsonResult);
×
229
    }
230

231
    /**
232
    * Designate a beneficiary account and transfer the benefactor's current balance
233
    *
234
    * @param setupBeneficiaryRequest {@link SetupBeneficiaryRequest }  (required)
235
    * @return {@link SetupBeneficiaryResponse }
236
    * @throws ApiException if fails to make API call
237
    */
238
    public SetupBeneficiaryResponse setupBeneficiary(SetupBeneficiaryRequest setupBeneficiaryRequest) throws ApiException, IOException {
239
        return setupBeneficiary(setupBeneficiaryRequest, null);
×
240
    }
241

242
    /**
243
    * Designate a beneficiary account and transfer the benefactor's current balance
244
    *
245
    * @param setupBeneficiaryRequest {@link SetupBeneficiaryRequest }  (required)
246
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
247
    * @return {@link SetupBeneficiaryResponse }
248
    * @throws ApiException if fails to make API call
249
    */
250
    public SetupBeneficiaryResponse setupBeneficiary(SetupBeneficiaryRequest setupBeneficiaryRequest, RequestOptions requestOptions) throws ApiException, IOException {
251

252
        String requestBody = setupBeneficiaryRequest.toJson();
×
253
        Resource resource = new Resource(this, this.baseURL + "/setupBeneficiary", null);
×
254
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
×
255
        return SetupBeneficiaryResponse.fromJson(jsonResult);
×
256
    }
257

258
    /**
259
    * Transfer funds between platform accounts
260
    *
261
    * @param transferFundsRequest {@link TransferFundsRequest }  (required)
262
    * @return {@link TransferFundsResponse }
263
    * @throws ApiException if fails to make API call
264
    */
265
    public TransferFundsResponse transferFunds(TransferFundsRequest transferFundsRequest) throws ApiException, IOException {
266
        return transferFunds(transferFundsRequest, null);
×
267
    }
268

269
    /**
270
    * Transfer funds between platform accounts
271
    *
272
    * @param transferFundsRequest {@link TransferFundsRequest }  (required)
273
    * @param requestOptions {@link RequestOptions } Object to store additional data such as idempotency-keys (optional)
274
    * @return {@link TransferFundsResponse }
275
    * @throws ApiException if fails to make API call
276
    */
277
    public TransferFundsResponse transferFunds(TransferFundsRequest transferFundsRequest, RequestOptions requestOptions) throws ApiException, IOException {
278

279
        String requestBody = transferFundsRequest.toJson();
×
280
        Resource resource = new Resource(this, this.baseURL + "/transferFunds", null);
×
281
        String jsonResult = resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null);
×
282
        return TransferFundsResponse.fromJson(jsonResult);
×
283
    }
284
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc