@@ -47,6 +47,10 @@ public class CardCreateParams extends ApiRequestParams {
47
47
@ SerializedName ("metadata" )
48
48
Map <String , String > metadata ;
49
49
50
+ /** The desired PIN for this card. */
51
+ @ SerializedName ("pin" )
52
+ Pin pin ;
53
+
50
54
/** The card this is meant to be a replacement for (if any). */
51
55
@ SerializedName ("replacement_for" )
52
56
String replacementFor ;
@@ -90,6 +94,7 @@ private CardCreateParams(
90
94
Map <String , Object > extraParams ,
91
95
String financialAccount ,
92
96
Map <String , String > metadata ,
97
+ Pin pin ,
93
98
String replacementFor ,
94
99
ReplacementReason replacementReason ,
95
100
Shipping shipping ,
@@ -102,6 +107,7 @@ private CardCreateParams(
102
107
this .extraParams = extraParams ;
103
108
this .financialAccount = financialAccount ;
104
109
this .metadata = metadata ;
110
+ this .pin = pin ;
105
111
this .replacementFor = replacementFor ;
106
112
this .replacementReason = replacementReason ;
107
113
this .shipping = shipping ;
@@ -127,6 +133,8 @@ public static class Builder {
127
133
128
134
private Map <String , String > metadata ;
129
135
136
+ private Pin pin ;
137
+
130
138
private String replacementFor ;
131
139
132
140
private ReplacementReason replacementReason ;
@@ -148,6 +156,7 @@ public CardCreateParams build() {
148
156
this .extraParams ,
149
157
this .financialAccount ,
150
158
this .metadata ,
159
+ this .pin ,
151
160
this .replacementFor ,
152
161
this .replacementReason ,
153
162
this .shipping ,
@@ -254,6 +263,12 @@ public Builder putAllMetadata(Map<String, String> map) {
254
263
return this ;
255
264
}
256
265
266
+ /** The desired PIN for this card. */
267
+ public Builder setPin (CardCreateParams .Pin pin ) {
268
+ this .pin = pin ;
269
+ return this ;
270
+ }
271
+
257
272
/** The card this is meant to be a replacement for (if any). */
258
273
public Builder setReplacementFor (String replacementFor ) {
259
274
this .replacementFor = replacementFor ;
@@ -304,6 +319,74 @@ public Builder setType(CardCreateParams.Type type) {
304
319
}
305
320
}
306
321
322
+ @ Getter
323
+ public static class Pin {
324
+ /** The card's desired new PIN, encrypted under Stripe's public key. */
325
+ @ SerializedName ("encrypted_number" )
326
+ String encryptedNumber ;
327
+
328
+ /**
329
+ * Map of extra parameters for custom features not available in this client library. The content
330
+ * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
331
+ * key/value pair is serialized as if the key is a root-level field (serialized) name in this
332
+ * param object. Effectively, this map is flattened to its parent instance.
333
+ */
334
+ @ SerializedName (ApiRequestParams .EXTRA_PARAMS_KEY )
335
+ Map <String , Object > extraParams ;
336
+
337
+ private Pin (String encryptedNumber , Map <String , Object > extraParams ) {
338
+ this .encryptedNumber = encryptedNumber ;
339
+ this .extraParams = extraParams ;
340
+ }
341
+
342
+ public static Builder builder () {
343
+ return new Builder ();
344
+ }
345
+
346
+ public static class Builder {
347
+ private String encryptedNumber ;
348
+
349
+ private Map <String , Object > extraParams ;
350
+
351
+ /** Finalize and obtain parameter instance from this builder. */
352
+ public CardCreateParams .Pin build () {
353
+ return new CardCreateParams .Pin (this .encryptedNumber , this .extraParams );
354
+ }
355
+
356
+ /** The card's desired new PIN, encrypted under Stripe's public key. */
357
+ public Builder setEncryptedNumber (String encryptedNumber ) {
358
+ this .encryptedNumber = encryptedNumber ;
359
+ return this ;
360
+ }
361
+
362
+ /**
363
+ * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
364
+ * call, and subsequent calls add additional key/value pairs to the original map. See {@link
365
+ * CardCreateParams.Pin#extraParams} for the field documentation.
366
+ */
367
+ public Builder putExtraParam (String key , Object value ) {
368
+ if (this .extraParams == null ) {
369
+ this .extraParams = new HashMap <>();
370
+ }
371
+ this .extraParams .put (key , value );
372
+ return this ;
373
+ }
374
+
375
+ /**
376
+ * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
377
+ * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
378
+ * See {@link CardCreateParams.Pin#extraParams} for the field documentation.
379
+ */
380
+ public Builder putAllExtraParam (Map <String , Object > map ) {
381
+ if (this .extraParams == null ) {
382
+ this .extraParams = new HashMap <>();
383
+ }
384
+ this .extraParams .putAll (map );
385
+ return this ;
386
+ }
387
+ }
388
+ }
389
+
307
390
@ Getter
308
391
public static class Shipping {
309
392
/** <strong>Required.</strong> The address that the card is shipped to. */
0 commit comments