@@ -17,6 +17,13 @@ public class PaymentMethodCreateParams extends ApiRequestParams {
17
17
@ SerializedName ("au_becs_debit" )
18
18
AuBecsDebit auBecsDebit ;
19
19
20
+ /**
21
+ * If this is a {@code bacs_debit} PaymentMethod, this hash contains details about the Bacs Direct
22
+ * Debit bank account.
23
+ */
24
+ @ SerializedName ("bacs_debit" )
25
+ BacsDebit bacsDebit ;
26
+
20
27
/**
21
28
* Billing information associated with the PaymentMethod that may be used or required by
22
29
* particular types of payment methods.
@@ -105,6 +112,7 @@ public class PaymentMethodCreateParams extends ApiRequestParams {
105
112
106
113
private PaymentMethodCreateParams (
107
114
AuBecsDebit auBecsDebit ,
115
+ BacsDebit bacsDebit ,
108
116
BillingDetails billingDetails ,
109
117
Object card ,
110
118
String customer ,
@@ -118,6 +126,7 @@ private PaymentMethodCreateParams(
118
126
SepaDebit sepaDebit ,
119
127
Type type ) {
120
128
this .auBecsDebit = auBecsDebit ;
129
+ this .bacsDebit = bacsDebit ;
121
130
this .billingDetails = billingDetails ;
122
131
this .card = card ;
123
132
this .customer = customer ;
@@ -139,6 +148,8 @@ public static Builder builder() {
139
148
public static class Builder {
140
149
private AuBecsDebit auBecsDebit ;
141
150
151
+ private BacsDebit bacsDebit ;
152
+
142
153
private BillingDetails billingDetails ;
143
154
144
155
private Object card ;
@@ -167,6 +178,7 @@ public static class Builder {
167
178
public PaymentMethodCreateParams build () {
168
179
return new PaymentMethodCreateParams (
169
180
this .auBecsDebit ,
181
+ this .bacsDebit ,
170
182
this .billingDetails ,
171
183
this .card ,
172
184
this .customer ,
@@ -190,6 +202,15 @@ public Builder setAuBecsDebit(AuBecsDebit auBecsDebit) {
190
202
return this ;
191
203
}
192
204
205
+ /**
206
+ * If this is a {@code bacs_debit} PaymentMethod, this hash contains details about the Bacs
207
+ * Direct Debit bank account.
208
+ */
209
+ public Builder setBacsDebit (BacsDebit bacsDebit ) {
210
+ this .bacsDebit = bacsDebit ;
211
+ return this ;
212
+ }
213
+
193
214
/**
194
215
* Billing information associated with the PaymentMethod that may be used or required by
195
216
* particular types of payment methods.
@@ -445,6 +466,87 @@ public Builder putAllExtraParam(Map<String, Object> map) {
445
466
}
446
467
}
447
468
469
+ @ Getter
470
+ public static class BacsDebit {
471
+ /** Account number of the bank account that the funds will be debited from. */
472
+ @ SerializedName ("account_number" )
473
+ String accountNumber ;
474
+
475
+ /**
476
+ * Map of extra parameters for custom features not available in this client library. The content
477
+ * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
478
+ * key/value pair is serialized as if the key is a root-level field (serialized) name in this
479
+ * param object. Effectively, this map is flattened to its parent instance.
480
+ */
481
+ @ SerializedName (ApiRequestParams .EXTRA_PARAMS_KEY )
482
+ Map <String , Object > extraParams ;
483
+
484
+ /** Sort code of the bank account. (e.g., {@code 10-20-30}) */
485
+ @ SerializedName ("sort_code" )
486
+ String sortCode ;
487
+
488
+ private BacsDebit (String accountNumber , Map <String , Object > extraParams , String sortCode ) {
489
+ this .accountNumber = accountNumber ;
490
+ this .extraParams = extraParams ;
491
+ this .sortCode = sortCode ;
492
+ }
493
+
494
+ public static Builder builder () {
495
+ return new Builder ();
496
+ }
497
+
498
+ public static class Builder {
499
+ private String accountNumber ;
500
+
501
+ private Map <String , Object > extraParams ;
502
+
503
+ private String sortCode ;
504
+
505
+ /** Finalize and obtain parameter instance from this builder. */
506
+ public BacsDebit build () {
507
+ return new BacsDebit (this .accountNumber , this .extraParams , this .sortCode );
508
+ }
509
+
510
+ /** Account number of the bank account that the funds will be debited from. */
511
+ public Builder setAccountNumber (String accountNumber ) {
512
+ this .accountNumber = accountNumber ;
513
+ return this ;
514
+ }
515
+
516
+ /**
517
+ * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
518
+ * call, and subsequent calls add additional key/value pairs to the original map. See {@link
519
+ * PaymentMethodCreateParams.BacsDebit#extraParams} for the field documentation.
520
+ */
521
+ public Builder putExtraParam (String key , Object value ) {
522
+ if (this .extraParams == null ) {
523
+ this .extraParams = new HashMap <>();
524
+ }
525
+ this .extraParams .put (key , value );
526
+ return this ;
527
+ }
528
+
529
+ /**
530
+ * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
531
+ * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
532
+ * See {@link PaymentMethodCreateParams.BacsDebit#extraParams} for the field documentation.
533
+ */
534
+ public Builder putAllExtraParam (Map <String , Object > map ) {
535
+ if (this .extraParams == null ) {
536
+ this .extraParams = new HashMap <>();
537
+ }
538
+ this .extraParams .putAll (map );
539
+ return this ;
540
+ }
541
+
542
+ /** Sort code of the bank account. (e.g., {@code 10-20-30}) */
543
+ public Builder setSortCode (String sortCode ) {
544
+ this .sortCode = sortCode ;
545
+ return this ;
546
+ }
547
+ }
548
+ }
549
+
448
550
@ Getter
449
551
public static class BillingDetails {
450
552
/** Billing address. */
@@ -1291,6 +1393,9 @@ public enum Type implements ApiRequestParams.EnumParam {
1291
1393
@ SerializedName ("au_becs_debit" )
1292
1394
AU_BECS_DEBIT ("au_becs_debit" ),
1293
1395
1396
+ @ SerializedName ("bacs_debit" )
1397
+ BACS_DEBIT ("bacs_debit" ),
1398
+
1294
1399
@ SerializedName ("card" )
1295
1400
CARD ("card" ),
1296
1401
0 commit comments