12
12
13
13
@ Getter
14
14
public class RefundCreateParams extends ApiRequestParams {
15
+ /** A positive integer representing how much to refund. */
15
16
@ SerializedName ("amount" )
16
17
Long amount ;
17
18
18
19
@ SerializedName ("charge" )
19
20
String charge ;
20
21
22
+ /**
23
+ * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency code</a>,
24
+ * in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported currency</a>.
25
+ */
26
+ @ SerializedName ("currency" )
27
+ String currency ;
28
+
29
+ /** Customer whose customer balance to refund from. */
30
+ @ SerializedName ("customer" )
31
+ String customer ;
32
+
21
33
/** Specifies which fields in the response should be expanded. */
22
34
@ SerializedName ("expand" )
23
35
List <String > expand ;
@@ -31,6 +43,7 @@ public class RefundCreateParams extends ApiRequestParams {
31
43
@ SerializedName (ApiRequestParams .EXTRA_PARAMS_KEY )
32
44
Map <String , Object > extraParams ;
33
45
46
+ /** Address to send refund email, use customer email if not specified. */
34
47
@ SerializedName ("instructions_email" )
35
48
String instructionsEmail ;
36
49
@@ -43,6 +56,10 @@ public class RefundCreateParams extends ApiRequestParams {
43
56
@ SerializedName ("metadata" )
44
57
Object metadata ;
45
58
59
+ /** Origin of the refund. */
60
+ @ SerializedName ("origin" )
61
+ Origin origin ;
62
+
46
63
@ SerializedName ("payment_intent" )
47
64
String paymentIntent ;
48
65
@@ -58,20 +75,26 @@ public class RefundCreateParams extends ApiRequestParams {
58
75
private RefundCreateParams (
59
76
Long amount ,
60
77
String charge ,
78
+ String currency ,
79
+ String customer ,
61
80
List <String > expand ,
62
81
Map <String , Object > extraParams ,
63
82
String instructionsEmail ,
64
83
Object metadata ,
84
+ Origin origin ,
65
85
String paymentIntent ,
66
86
Reason reason ,
67
87
Boolean refundApplicationFee ,
68
88
Boolean reverseTransfer ) {
69
89
this .amount = amount ;
70
90
this .charge = charge ;
91
+ this .currency = currency ;
92
+ this .customer = customer ;
71
93
this .expand = expand ;
72
94
this .extraParams = extraParams ;
73
95
this .instructionsEmail = instructionsEmail ;
74
96
this .metadata = metadata ;
97
+ this .origin = origin ;
75
98
this .paymentIntent = paymentIntent ;
76
99
this .reason = reason ;
77
100
this .refundApplicationFee = refundApplicationFee ;
@@ -87,6 +110,10 @@ public static class Builder {
87
110
88
111
private String charge ;
89
112
113
+ private String currency ;
114
+
115
+ private String customer ;
116
+
90
117
private List <String > expand ;
91
118
92
119
private Map <String , Object > extraParams ;
@@ -95,6 +122,8 @@ public static class Builder {
95
122
96
123
private Object metadata ;
97
124
125
+ private Origin origin ;
126
+
98
127
private String paymentIntent ;
99
128
100
129
private Reason reason ;
@@ -108,16 +137,20 @@ public RefundCreateParams build() {
108
137
return new RefundCreateParams (
109
138
this .amount ,
110
139
this .charge ,
140
+ this .currency ,
141
+ this .customer ,
111
142
this .expand ,
112
143
this .extraParams ,
113
144
this .instructionsEmail ,
114
145
this .metadata ,
146
+ this .origin ,
115
147
this .paymentIntent ,
116
148
this .reason ,
117
149
this .refundApplicationFee ,
118
150
this .reverseTransfer );
119
151
}
120
152
153
+ /** A positive integer representing how much to refund. */
121
154
public Builder setAmount (Long amount ) {
122
155
this .amount = amount ;
123
156
return this ;
@@ -128,6 +161,22 @@ public Builder setCharge(String charge) {
128
161
return this ;
129
162
}
130
163
164
+ /**
165
+ * Three-letter <a href="https://www.iso.org/iso-4217-currency-codes.html">ISO currency
166
+ * code</a>, in lowercase. Must be a <a href="https://stripe.com/docs/currencies">supported
167
+ * currency</a>.
168
+ */
169
+ public Builder setCurrency (String currency ) {
170
+ this .currency = currency ;
171
+ return this ;
172
+ }
173
+
174
+ /** Customer whose customer balance to refund from. */
175
+ public Builder setCustomer (String customer ) {
176
+ this .customer = customer ;
177
+ return this ;
178
+ }
179
+
131
180
/**
132
181
* Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
133
182
* subsequent calls adds additional elements to the original list. See {@link
@@ -180,6 +229,7 @@ public Builder putAllExtraParam(Map<String, Object> map) {
180
229
return this ;
181
230
}
182
231
232
+ /** Address to send refund email, use customer email if not specified. */
183
233
public Builder setInstructionsEmail (String instructionsEmail ) {
184
234
this .instructionsEmail = instructionsEmail ;
185
235
return this ;
@@ -235,6 +285,12 @@ public Builder setMetadata(Map<String, String> metadata) {
235
285
return this ;
236
286
}
237
287
288
+ /** Origin of the refund. */
289
+ public Builder setOrigin (Origin origin ) {
290
+ this .origin = origin ;
291
+ return this ;
292
+ }
293
+
238
294
public Builder setPaymentIntent (String paymentIntent ) {
239
295
this .paymentIntent = paymentIntent ;
240
296
return this ;
@@ -256,6 +312,18 @@ public Builder setReverseTransfer(Boolean reverseTransfer) {
256
312
}
257
313
}
258
314
315
+ public enum Origin implements ApiRequestParams .EnumParam {
316
+ @ SerializedName ("customer_balance" )
317
+ CUSTOMER_BALANCE ("customer_balance" );
318
+
319
+ @ Getter (onMethod_ = {@ Override })
320
+ private final String value ;
321
+
322
+ Origin (String value ) {
323
+ this .value = value ;
324
+ }
325
+ }
326
+
259
327
public enum Reason implements ApiRequestParams .EnumParam {
260
328
@ SerializedName ("duplicate" )
261
329
DUPLICATE ("duplicate" ),
0 commit comments