@@ -34,6 +34,13 @@ public class PaymentMethodUpdateParams extends ApiRequestParams {
3434 @ SerializedName ("card" )
3535 Card card ;
3636
37+ /**
38+ * If this is a {@code custom} PaymentMethod, this hash contains details about the Custom payment
39+ * method.
40+ */
41+ @ SerializedName ("custom" )
42+ Custom custom ;
43+
3744 /** Specifies which fields in the response should be expanded. */
3845 @ SerializedName ("expand" )
3946 List <String > expand ;
@@ -74,6 +81,7 @@ private PaymentMethodUpdateParams(
7481 AllowRedisplay allowRedisplay ,
7582 BillingDetails billingDetails ,
7683 Card card ,
84+ Custom custom ,
7785 List <String > expand ,
7886 Map <String , Object > extraParams ,
7987 Object metadata ,
@@ -82,6 +90,7 @@ private PaymentMethodUpdateParams(
8290 this .allowRedisplay = allowRedisplay ;
8391 this .billingDetails = billingDetails ;
8492 this .card = card ;
93+ this .custom = custom ;
8594 this .expand = expand ;
8695 this .extraParams = extraParams ;
8796 this .metadata = metadata ;
@@ -100,6 +109,8 @@ public static class Builder {
100109
101110 private Card card ;
102111
112+ private Custom custom ;
113+
103114 private List <String > expand ;
104115
105116 private Map <String , Object > extraParams ;
@@ -116,6 +127,7 @@ public PaymentMethodUpdateParams build() {
116127 this .allowRedisplay ,
117128 this .billingDetails ,
118129 this .card ,
130+ this .custom ,
119131 this .expand ,
120132 this .extraParams ,
121133 this .metadata ,
@@ -149,6 +161,15 @@ public Builder setCard(PaymentMethodUpdateParams.Card card) {
149161 return this ;
150162 }
151163
164+ /**
165+ * If this is a {@code custom} PaymentMethod, this hash contains details about the Custom
166+ * payment method.
167+ */
168+ public Builder setCustom (PaymentMethodUpdateParams .Custom custom ) {
169+ this .custom = custom ;
170+ return this ;
171+ }
172+
152173 /**
153174 * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and
154175 * subsequent calls adds additional elements to the original list. See {@link
@@ -845,6 +866,81 @@ public enum Preferred implements ApiRequestParams.EnumParam {
845866 }
846867 }
847868
869+ @ Getter
870+ @ EqualsAndHashCode (callSuper = false )
871+ public static class Custom {
872+ /**
873+ * Map of extra parameters for custom features not available in this client library. The content
874+ * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
875+ * key/value pair is serialized as if the key is a root-level field (serialized) name in this
876+ * param object. Effectively, this map is flattened to its parent instance.
877+ */
878+ @ SerializedName (ApiRequestParams .EXTRA_PARAMS_KEY )
879+ Map <String , Object > extraParams ;
880+
881+ /** A reference to an external payment method, such as a PayPal Billing Agreement ID. */
882+ @ SerializedName ("payment_method_reference" )
883+ Object paymentMethodReference ;
884+
885+ private Custom (Map <String , Object > extraParams , Object paymentMethodReference ) {
886+ this .extraParams = extraParams ;
887+ this .paymentMethodReference = paymentMethodReference ;
888+ }
889+
890+ public static Builder builder () {
891+ return new Builder ();
892+ }
893+
894+ public static class Builder {
895+ private Map <String , Object > extraParams ;
896+
897+ private Object paymentMethodReference ;
898+
899+ /** Finalize and obtain parameter instance from this builder. */
900+ public PaymentMethodUpdateParams .Custom build () {
901+ return new PaymentMethodUpdateParams .Custom (this .extraParams , this .paymentMethodReference );
902+ }
903+
904+ /**
905+ * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll`
906+ * call, and subsequent calls add additional key/value pairs to the original map. See {@link
907+ * PaymentMethodUpdateParams.Custom#extraParams} for the field documentation.
908+ */
909+ public Builder putExtraParam (String key , Object value ) {
910+ if (this .extraParams == null ) {
911+ this .extraParams = new HashMap <>();
912+ }
913+ this .extraParams .put (key , value );
914+ return this ;
915+ }
916+
917+ /**
918+ * Add all map key/value pairs to `extraParams` map. A map is initialized for the first
919+ * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map.
920+ * See {@link PaymentMethodUpdateParams.Custom#extraParams} for the field documentation.
921+ */
922+ public Builder putAllExtraParam (Map <String , Object > map ) {
923+ if (this .extraParams == null ) {
924+ this .extraParams = new HashMap <>();
925+ }
926+ this .extraParams .putAll (map );
927+ return this ;
928+ }
929+
930+ /** A reference to an external payment method, such as a PayPal Billing Agreement ID. */
931+ public Builder setPaymentMethodReference (String paymentMethodReference ) {
932+ this .paymentMethodReference = paymentMethodReference ;
933+ return this ;
934+ }
935+
936+ /** A reference to an external payment method, such as a PayPal Billing Agreement ID. */
937+ public Builder setPaymentMethodReference (EmptyParam paymentMethodReference ) {
938+ this .paymentMethodReference = paymentMethodReference ;
939+ return this ;
940+ }
941+ }
942+ }
943+
848944 @ Getter
849945 @ EqualsAndHashCode (callSuper = false )
850946 public static class Payto {
0 commit comments