-
Notifications
You must be signed in to change notification settings - Fork 401
Expand file tree
/
Copy pathApplicationFee.java
More file actions
341 lines (293 loc) · 11.9 KB
/
Copy pathApplicationFee.java
File metadata and controls
341 lines (293 loc) · 11.9 KB
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
// File generated from our OpenAPI spec
package com.stripe.model;
import com.google.gson.annotations.SerializedName;
import com.stripe.exception.StripeException;
import com.stripe.net.ApiRequest;
import com.stripe.net.ApiRequestParams;
import com.stripe.net.ApiResource;
import com.stripe.net.BaseAddress;
import com.stripe.net.RequestOptions;
import com.stripe.net.StripeResponseGetter;
import com.stripe.param.ApplicationFeeListParams;
import com.stripe.param.ApplicationFeeRetrieveParams;
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public class ApplicationFee extends ApiResource implements BalanceTransactionSource {
/** ID of the Stripe account this fee was taken from. */
@SerializedName("account")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Account> account;
/** Amount earned, in cents (or local equivalent). */
@SerializedName("amount")
Long amount;
/**
* Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the
* fee if a partial refund was issued).
*/
@SerializedName("amount_refunded")
Long amountRefunded;
/** ID of the Connect application that earned the fee. */
@SerializedName("application")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Application> application;
/**
* Balance transaction that describes the impact of this collected application fee on your account
* balance (not including refunds).
*/
@SerializedName("balance_transaction")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<BalanceTransaction> balanceTransaction;
/** ID of the charge that the application fee was taken from. */
@SerializedName("charge")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Charge> charge;
/** Time at which the object was created. Measured in seconds since the Unix epoch. */
@SerializedName("created")
Long created;
/**
* Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
* in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
*/
@SerializedName("currency")
String currency;
/**
* Polymorphic source of the application fee. Includes the ID of the object the application fee
* was created from.
*/
@SerializedName("fee_source")
FeeSource feeSource;
/** Unique identifier for the object. */
@Getter(onMethod_ = {@Override})
@SerializedName("id")
String id;
/**
* If the object exists in live mode, the value is {@code true}. If the object exists in test
* mode, the value is {@code false}.
*/
@SerializedName("livemode")
Boolean livemode;
/**
* String representing the object's type. Objects of the same type share the same value.
*
* <p>Equal to {@code application_fee}.
*/
@SerializedName("object")
String object;
/**
* ID of the corresponding charge on the platform account, if this fee was the result of a charge
* using the {@code destination} parameter.
*/
@SerializedName("originating_transaction")
@Getter(lombok.AccessLevel.NONE)
@Setter(lombok.AccessLevel.NONE)
ExpandableField<Charge> originatingTransaction;
/**
* Whether the fee has been fully refunded. If the fee is only partially refunded, this attribute
* will still be false.
*/
@SerializedName("refunded")
Boolean refunded;
/** A list of refunds that have been applied to the fee. */
@SerializedName("refunds")
FeeRefundCollection refunds;
/** Get ID of expandable {@code account} object. */
public String getAccount() {
return (this.account != null) ? this.account.getId() : null;
}
public void setAccount(String id) {
this.account = ApiResource.setExpandableFieldId(id, this.account);
}
/** Get expanded {@code account}. */
public Account getAccountObject() {
return (this.account != null) ? this.account.getExpanded() : null;
}
public void setAccountObject(Account expandableObject) {
this.account = new ExpandableField<Account>(expandableObject.getId(), expandableObject);
}
/** Get ID of expandable {@code application} object. */
public String getApplication() {
return (this.application != null) ? this.application.getId() : null;
}
public void setApplication(String id) {
this.application = ApiResource.setExpandableFieldId(id, this.application);
}
/** Get expanded {@code application}. */
public Application getApplicationObject() {
return (this.application != null) ? this.application.getExpanded() : null;
}
public void setApplicationObject(Application expandableObject) {
this.application = new ExpandableField<Application>(expandableObject.getId(), expandableObject);
}
/** Get ID of expandable {@code balanceTransaction} object. */
public String getBalanceTransaction() {
return (this.balanceTransaction != null) ? this.balanceTransaction.getId() : null;
}
public void setBalanceTransaction(String id) {
this.balanceTransaction = ApiResource.setExpandableFieldId(id, this.balanceTransaction);
}
/** Get expanded {@code balanceTransaction}. */
public BalanceTransaction getBalanceTransactionObject() {
return (this.balanceTransaction != null) ? this.balanceTransaction.getExpanded() : null;
}
public void setBalanceTransactionObject(BalanceTransaction expandableObject) {
this.balanceTransaction =
new ExpandableField<BalanceTransaction>(expandableObject.getId(), expandableObject);
}
/** Get ID of expandable {@code charge} object. */
public String getCharge() {
return (this.charge != null) ? this.charge.getId() : null;
}
public void setCharge(String id) {
this.charge = ApiResource.setExpandableFieldId(id, this.charge);
}
/** Get expanded {@code charge}. */
public Charge getChargeObject() {
return (this.charge != null) ? this.charge.getExpanded() : null;
}
public void setChargeObject(Charge expandableObject) {
this.charge = new ExpandableField<Charge>(expandableObject.getId(), expandableObject);
}
/** Get ID of expandable {@code originatingTransaction} object. */
public String getOriginatingTransaction() {
return (this.originatingTransaction != null) ? this.originatingTransaction.getId() : null;
}
public void setOriginatingTransaction(String id) {
this.originatingTransaction = ApiResource.setExpandableFieldId(id, this.originatingTransaction);
}
/** Get expanded {@code originatingTransaction}. */
public Charge getOriginatingTransactionObject() {
return (this.originatingTransaction != null) ? this.originatingTransaction.getExpanded() : null;
}
public void setOriginatingTransactionObject(Charge expandableObject) {
this.originatingTransaction =
new ExpandableField<Charge>(expandableObject.getId(), expandableObject);
}
/**
* Returns a list of application fees you’ve previously collected. The application fees are
* returned in sorted order, with the most recent fees appearing first.
*/
public static ApplicationFeeCollection list(Map<String, Object> params) throws StripeException {
return list(params, (RequestOptions) null);
}
/**
* Returns a list of application fees you’ve previously collected. The application fees are
* returned in sorted order, with the most recent fees appearing first.
*/
public static ApplicationFeeCollection list(Map<String, Object> params, RequestOptions options)
throws StripeException {
String path = "/v1/application_fees";
ApiRequest request =
new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
return getGlobalResponseGetter().request(request, ApplicationFeeCollection.class);
}
/**
* Returns a list of application fees you’ve previously collected. The application fees are
* returned in sorted order, with the most recent fees appearing first.
*/
public static ApplicationFeeCollection list(ApplicationFeeListParams params)
throws StripeException {
return list(params, (RequestOptions) null);
}
/**
* Returns a list of application fees you’ve previously collected. The application fees are
* returned in sorted order, with the most recent fees appearing first.
*/
public static ApplicationFeeCollection list(
ApplicationFeeListParams params, RequestOptions options) throws StripeException {
String path = "/v1/application_fees";
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.GET,
path,
ApiRequestParams.paramsToMap(params),
options);
return getGlobalResponseGetter().request(request, ApplicationFeeCollection.class);
}
/**
* Retrieves the details of an application fee that your account has collected. The same
* information is returned when refunding the application fee.
*/
public static ApplicationFee retrieve(String id) throws StripeException {
return retrieve(id, (Map<String, Object>) null, (RequestOptions) null);
}
/**
* Retrieves the details of an application fee that your account has collected. The same
* information is returned when refunding the application fee.
*/
public static ApplicationFee retrieve(String id, RequestOptions options) throws StripeException {
return retrieve(id, (Map<String, Object>) null, options);
}
/**
* Retrieves the details of an application fee that your account has collected. The same
* information is returned when refunding the application fee.
*/
public static ApplicationFee retrieve(
String id, Map<String, Object> params, RequestOptions options) throws StripeException {
String path = String.format("/v1/application_fees/%s", ApiResource.urlEncodeId(id));
ApiRequest request =
new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options);
return getGlobalResponseGetter().request(request, ApplicationFee.class);
}
/**
* Retrieves the details of an application fee that your account has collected. The same
* information is returned when refunding the application fee.
*/
public static ApplicationFee retrieve(
String id, ApplicationFeeRetrieveParams params, RequestOptions options)
throws StripeException {
String path = String.format("/v1/application_fees/%s", ApiResource.urlEncodeId(id));
ApiResource.checkNullTypedParams(path, params);
ApiRequest request =
new ApiRequest(
BaseAddress.API,
ApiResource.RequestMethod.GET,
path,
ApiRequestParams.paramsToMap(params),
options);
return getGlobalResponseGetter().request(request, ApplicationFee.class);
}
/**
* For more details about FeeSource, please refer to the <a href="https://docs.stripe.com/api">API
* Reference.</a>
*/
@Getter
@Setter
@EqualsAndHashCode(callSuper = false)
public static class FeeSource extends StripeObject {
/** Charge ID that created this application fee. */
@SerializedName("charge")
String charge;
/** Payout ID that created this application fee. */
@SerializedName("payout")
String payout;
/**
* Type of object that created the application fee.
*
* <p>One of {@code charge}, or {@code payout}.
*/
@SerializedName("type")
String type;
}
@Override
public void setResponseGetter(StripeResponseGetter responseGetter) {
super.setResponseGetter(responseGetter);
trySetResponseGetter(account, responseGetter);
trySetResponseGetter(application, responseGetter);
trySetResponseGetter(balanceTransaction, responseGetter);
trySetResponseGetter(charge, responseGetter);
trySetResponseGetter(feeSource, responseGetter);
trySetResponseGetter(originatingTransaction, responseGetter);
trySetResponseGetter(refunds, responseGetter);
}
}