All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.stripe.param.ChargeCreateParams Maven / Gradle / Ivy

There is a newer version: 28.2.0
Show newest version
// File generated from our OpenAPI spec
package com.stripe.param;

import com.google.gson.annotations.SerializedName;
import com.stripe.net.ApiRequestParams;
import com.stripe.param.common.EmptyParam;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.Getter;

@Getter
public class ChargeCreateParams extends ApiRequestParams {
  /**
   * Amount intended to be collected by this payment. A positive integer representing how much to
   * charge in the smallest currency
   * unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The
   * minimum amount is $0.50 US or equivalent in
   * charge currency. The amount value supports up to eight digits (e.g., a value of 99999999
   * for a USD charge of $999,999.99).
   */
  @SerializedName("amount")
  Long amount;

  @SerializedName("application_fee")
  Long applicationFee;

  /**
   * A fee in cents (or local equivalent) that will be applied to the charge and transferred to the
   * application owner's Stripe account. The request must be made with an OAuth key or the {@code
   * Stripe-Account} header in order to take an application fee. For more information, see the
   * application fees documentation.
   */
  @SerializedName("application_fee_amount")
  Long applicationFeeAmount;

  /**
   * Whether to immediately capture the charge. Defaults to {@code true}. When {@code false}, the
   * charge issues an authorization (or pre-authorization), and will need to be captured later. Uncaptured charges expire
   * after a set number of days (7 by default). For more information, see the authorizing charges and settling
   * later documentation.
   */
  @SerializedName("capture")
  Boolean capture;

  /**
   * Three-letter ISO currency code,
   * in lowercase. Must be a supported currency.
   */
  @SerializedName("currency")
  String currency;

  /** The ID of an existing customer that will be charged in this request. */
  @SerializedName("customer")
  String customer;

  /**
   * An arbitrary string which you can attach to a {@code Charge} object. It is displayed when in
   * the web interface alongside the charge. Note that if you use Stripe to send automatic email
   * receipts to your customers, your receipt emails will include the {@code description} of the
   * charge(s) that they are describing.
   */
  @SerializedName("description")
  String description;

  @SerializedName("destination")
  Destination destination;

  /** Specifies which fields in the response should be expanded. */
  @SerializedName("expand")
  List expand;

  /**
   * Map of extra parameters for custom features not available in this client library. The content
   * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each
   * key/value pair is serialized as if the key is a root-level field (serialized) name in this
   * param object. Effectively, this map is flattened to its parent instance.
   */
  @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY)
  Map extraParams;

  /**
   * Set of key-value pairs that you can attach
   * to an object. This can be useful for storing additional information about the object in a
   * structured format. Individual keys can be unset by posting an empty value to them. All keys can
   * be unset by posting an empty value to {@code metadata}.
   */
  @SerializedName("metadata")
  Object metadata;

  /**
   * The Stripe account ID for which these funds are intended. Automatically set if you use the
   * {@code destination} parameter. For details, see Creating
   * Separate Charges and Transfers.
   */
  @SerializedName("on_behalf_of")
  String onBehalfOf;

  /**
   * Options to configure Radar. See Radar
   * Session for more information.
   */
  @SerializedName("radar_options")
  RadarOptions radarOptions;

  /**
   * The email address to which this charge's receipt will be sent. The receipt will
   * not be sent until the charge is paid, and no receipts will be sent for test mode charges. If
   * this charge is for a Customer, the
   * email address specified here will override the customer's email address. If {@code
   * receipt_email} is specified for a charge in live mode, a receipt will be sent regardless of
   * your email settings.
   */
  @SerializedName("receipt_email")
  String receiptEmail;

  /** Shipping information for the charge. Helps prevent fraud on charges for physical goods. */
  @SerializedName("shipping")
  Shipping shipping;

  /**
   * A payment source to be charged. This can be the ID of a card (i.e., credit or debit card), a bank account, a source, a token, or a connected
   * account. For certain sources---namely, cards, bank accounts, and attached sources---you must also pass the ID of the
   * associated customer.
   */
  @SerializedName("source")
  String source;

  /**
   * For a non-card charge, text that appears on the customer's statement as the statement
   * descriptor. This value overrides the account's default statement descriptor. For information
   * about requirements, including the 22-character limit, see the Statement
   * Descriptor docs.
   *
   * 

For a card charge, this value is ignored unless you don't specify a {@code * statement_descriptor_suffix}, in which case this value is used as the suffix. */ @SerializedName("statement_descriptor") String statementDescriptor; /** * Provides information about a card charge. Concatenated to the account's statement * descriptor prefix to form the complete statement descriptor that appears on the customer's * statement. If the account has no prefix value, the suffix is concatenated to the account's * statement descriptor. */ @SerializedName("statement_descriptor_suffix") String statementDescriptorSuffix; /** * An optional dictionary including the account to automatically transfer to as part of a * destination charge. See the * Connect documentation for details. */ @SerializedName("transfer_data") TransferData transferData; /** * A string that identifies this transaction as part of a group. For details, see Grouping * transactions. */ @SerializedName("transfer_group") String transferGroup; private ChargeCreateParams( Long amount, Long applicationFee, Long applicationFeeAmount, Boolean capture, String currency, String customer, String description, Destination destination, List expand, Map extraParams, Object metadata, String onBehalfOf, RadarOptions radarOptions, String receiptEmail, Shipping shipping, String source, String statementDescriptor, String statementDescriptorSuffix, TransferData transferData, String transferGroup) { this.amount = amount; this.applicationFee = applicationFee; this.applicationFeeAmount = applicationFeeAmount; this.capture = capture; this.currency = currency; this.customer = customer; this.description = description; this.destination = destination; this.expand = expand; this.extraParams = extraParams; this.metadata = metadata; this.onBehalfOf = onBehalfOf; this.radarOptions = radarOptions; this.receiptEmail = receiptEmail; this.shipping = shipping; this.source = source; this.statementDescriptor = statementDescriptor; this.statementDescriptorSuffix = statementDescriptorSuffix; this.transferData = transferData; this.transferGroup = transferGroup; } public static Builder builder() { return new Builder(); } public static class Builder { private Long amount; private Long applicationFee; private Long applicationFeeAmount; private Boolean capture; private String currency; private String customer; private String description; private Destination destination; private List expand; private Map extraParams; private Object metadata; private String onBehalfOf; private RadarOptions radarOptions; private String receiptEmail; private Shipping shipping; private String source; private String statementDescriptor; private String statementDescriptorSuffix; private TransferData transferData; private String transferGroup; /** Finalize and obtain parameter instance from this builder. */ public ChargeCreateParams build() { return new ChargeCreateParams( this.amount, this.applicationFee, this.applicationFeeAmount, this.capture, this.currency, this.customer, this.description, this.destination, this.expand, this.extraParams, this.metadata, this.onBehalfOf, this.radarOptions, this.receiptEmail, this.shipping, this.source, this.statementDescriptor, this.statementDescriptorSuffix, this.transferData, this.transferGroup); } /** * Amount intended to be collected by this payment. A positive integer representing how much to * charge in the smallest currency * unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). * The minimum amount is $0.50 US or equivalent in * charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 * for a USD charge of $999,999.99). */ public Builder setAmount(Long amount) { this.amount = amount; return this; } public Builder setApplicationFee(Long applicationFee) { this.applicationFee = applicationFee; return this; } /** * A fee in cents (or local equivalent) that will be applied to the charge and transferred to * the application owner's Stripe account. The request must be made with an OAuth key or the * {@code Stripe-Account} header in order to take an application fee. For more information, see * the application fees documentation. */ public Builder setApplicationFeeAmount(Long applicationFeeAmount) { this.applicationFeeAmount = applicationFeeAmount; return this; } /** * Whether to immediately capture the charge. Defaults to {@code true}. When {@code false}, the * charge issues an authorization (or pre-authorization), and will need to be captured later. Uncaptured charges * expire after a set number of days (7 by default). For more information, see the authorizing charges and settling * later documentation. */ public Builder setCapture(Boolean capture) { this.capture = capture; return this; } /** * Three-letter ISO currency * code, in lowercase. Must be a supported * currency. */ public Builder setCurrency(String currency) { this.currency = currency; return this; } /** The ID of an existing customer that will be charged in this request. */ public Builder setCustomer(String customer) { this.customer = customer; return this; } /** * An arbitrary string which you can attach to a {@code Charge} object. It is displayed when in * the web interface alongside the charge. Note that if you use Stripe to send automatic email * receipts to your customers, your receipt emails will include the {@code description} of the * charge(s) that they are describing. */ public Builder setDescription(String description) { this.description = description; return this; } public Builder setDestination(ChargeCreateParams.Destination destination) { this.destination = destination; return this; } /** * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link * ChargeCreateParams#expand} for the field documentation. */ public Builder addExpand(String element) { if (this.expand == null) { this.expand = new ArrayList<>(); } this.expand.add(element); return this; } /** * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link * ChargeCreateParams#expand} for the field documentation. */ public Builder addAllExpand(List elements) { if (this.expand == null) { this.expand = new ArrayList<>(); } this.expand.addAll(elements); return this; } /** * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` * call, and subsequent calls add additional key/value pairs to the original map. See {@link * ChargeCreateParams#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.put(key, value); return this; } /** * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. * See {@link ChargeCreateParams#extraParams} for the field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.putAll(map); return this; } /** * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, * and subsequent calls add additional key/value pairs to the original map. See {@link * ChargeCreateParams#metadata} for the field documentation. */ @SuppressWarnings("unchecked") public Builder putMetadata(String key, String value) { if (this.metadata == null || this.metadata instanceof EmptyParam) { this.metadata = new HashMap(); } ((Map) this.metadata).put(key, value); return this; } /** * Add all map key/value pairs to `metadata` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. * See {@link ChargeCreateParams#metadata} for the field documentation. */ @SuppressWarnings("unchecked") public Builder putAllMetadata(Map map) { if (this.metadata == null || this.metadata instanceof EmptyParam) { this.metadata = new HashMap(); } ((Map) this.metadata).putAll(map); return this; } /** * Set of key-value pairs that you can attach * to an object. This can be useful for storing additional information about the object in a * structured format. Individual keys can be unset by posting an empty value to them. All keys * can be unset by posting an empty value to {@code metadata}. */ public Builder setMetadata(EmptyParam metadata) { this.metadata = metadata; return this; } /** * Set of key-value pairs that you can attach * to an object. This can be useful for storing additional information about the object in a * structured format. Individual keys can be unset by posting an empty value to them. All keys * can be unset by posting an empty value to {@code metadata}. */ public Builder setMetadata(Map metadata) { this.metadata = metadata; return this; } /** * The Stripe account ID for which these funds are intended. Automatically set if you use the * {@code destination} parameter. For details, see Creating * Separate Charges and Transfers. */ public Builder setOnBehalfOf(String onBehalfOf) { this.onBehalfOf = onBehalfOf; return this; } /** * Options to configure Radar. See Radar * Session for more information. */ public Builder setRadarOptions(ChargeCreateParams.RadarOptions radarOptions) { this.radarOptions = radarOptions; return this; } /** * The email address to which this charge's receipt will be sent. The receipt will * not be sent until the charge is paid, and no receipts will be sent for test mode charges. If * this charge is for a Customer, the * email address specified here will override the customer's email address. If {@code * receipt_email} is specified for a charge in live mode, a receipt will be sent regardless of * your email settings. */ public Builder setReceiptEmail(String receiptEmail) { this.receiptEmail = receiptEmail; return this; } /** Shipping information for the charge. Helps prevent fraud on charges for physical goods. */ public Builder setShipping(ChargeCreateParams.Shipping shipping) { this.shipping = shipping; return this; } /** * A payment source to be charged. This can be the ID of a card (i.e., credit or debit card), a bank account, a source, a token, or a connected * account. For certain sources---namely, cards, bank accounts, and attached sources---you must also pass the ID of the * associated customer. */ public Builder setSource(String source) { this.source = source; return this; } /** * For a non-card charge, text that appears on the customer's statement as the statement * descriptor. This value overrides the account's default statement descriptor. For information * about requirements, including the 22-character limit, see the Statement * Descriptor docs. * *

For a card charge, this value is ignored unless you don't specify a {@code * statement_descriptor_suffix}, in which case this value is used as the suffix. */ public Builder setStatementDescriptor(String statementDescriptor) { this.statementDescriptor = statementDescriptor; return this; } /** * Provides information about a card charge. Concatenated to the account's statement * descriptor prefix to form the complete statement descriptor that appears on the * customer's statement. If the account has no prefix value, the suffix is concatenated to the * account's statement descriptor. */ public Builder setStatementDescriptorSuffix(String statementDescriptorSuffix) { this.statementDescriptorSuffix = statementDescriptorSuffix; return this; } /** * An optional dictionary including the account to automatically transfer to as part of a * destination charge. See the * Connect documentation for details. */ public Builder setTransferData(ChargeCreateParams.TransferData transferData) { this.transferData = transferData; return this; } /** * A string that identifies this transaction as part of a group. For details, see Grouping * transactions. */ public Builder setTransferGroup(String transferGroup) { this.transferGroup = transferGroup; return this; } } @Getter public static class Destination { /** Required. ID of an existing, connected Stripe account. */ @SerializedName("account") String account; /** * The amount to transfer to the destination account without creating an {@code Application Fee} * object. Cannot be combined with the {@code application_fee} parameter. Must be less than or * equal to the charge amount. */ @SerializedName("amount") Long amount; /** * Map of extra parameters for custom features not available in this client library. The content * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each * key/value pair is serialized as if the key is a root-level field (serialized) name in this * param object. Effectively, this map is flattened to its parent instance. */ @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; private Destination(String account, Long amount, Map extraParams) { this.account = account; this.amount = amount; this.extraParams = extraParams; } public static Builder builder() { return new Builder(); } public static class Builder { private String account; private Long amount; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ public ChargeCreateParams.Destination build() { return new ChargeCreateParams.Destination(this.account, this.amount, this.extraParams); } /** Required. ID of an existing, connected Stripe account. */ public Builder setAccount(String account) { this.account = account; return this; } /** * The amount to transfer to the destination account without creating an {@code Application * Fee} object. Cannot be combined with the {@code application_fee} parameter. Must be less * than or equal to the charge amount. */ public Builder setAmount(Long amount) { this.amount = amount; return this; } /** * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` * call, and subsequent calls add additional key/value pairs to the original map. See {@link * ChargeCreateParams.Destination#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.put(key, value); return this; } /** * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. * See {@link ChargeCreateParams.Destination#extraParams} for the field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.putAll(map); return this; } } } @Getter public static class RadarOptions { /** * Map of extra parameters for custom features not available in this client library. The content * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each * key/value pair is serialized as if the key is a root-level field (serialized) name in this * param object. Effectively, this map is flattened to its parent instance. */ @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; /** * A Radar Session is a snapshot of * the browser metadata and device details that help Radar make more accurate predictions on * your payments. */ @SerializedName("session") String session; private RadarOptions(Map extraParams, String session) { this.extraParams = extraParams; this.session = session; } public static Builder builder() { return new Builder(); } public static class Builder { private Map extraParams; private String session; /** Finalize and obtain parameter instance from this builder. */ public ChargeCreateParams.RadarOptions build() { return new ChargeCreateParams.RadarOptions(this.extraParams, this.session); } /** * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` * call, and subsequent calls add additional key/value pairs to the original map. See {@link * ChargeCreateParams.RadarOptions#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.put(key, value); return this; } /** * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. * See {@link ChargeCreateParams.RadarOptions#extraParams} for the field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.putAll(map); return this; } /** * A Radar Session is a snapshot of * the browser metadata and device details that help Radar make more accurate predictions on * your payments. */ public Builder setSession(String session) { this.session = session; return this; } } } @Getter public static class Shipping { /** Required. Shipping address. */ @SerializedName("address") Address address; /** The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. */ @SerializedName("carrier") String carrier; /** * Map of extra parameters for custom features not available in this client library. The content * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each * key/value pair is serialized as if the key is a root-level field (serialized) name in this * param object. Effectively, this map is flattened to its parent instance. */ @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; /** Required. Recipient name. */ @SerializedName("name") String name; /** Recipient phone (including extension). */ @SerializedName("phone") String phone; /** * The tracking number for a physical product, obtained from the delivery service. If multiple * tracking numbers were generated for this purchase, please separate them with commas. */ @SerializedName("tracking_number") String trackingNumber; private Shipping( Address address, String carrier, Map extraParams, String name, String phone, String trackingNumber) { this.address = address; this.carrier = carrier; this.extraParams = extraParams; this.name = name; this.phone = phone; this.trackingNumber = trackingNumber; } public static Builder builder() { return new Builder(); } public static class Builder { private Address address; private String carrier; private Map extraParams; private String name; private String phone; private String trackingNumber; /** Finalize and obtain parameter instance from this builder. */ public ChargeCreateParams.Shipping build() { return new ChargeCreateParams.Shipping( this.address, this.carrier, this.extraParams, this.name, this.phone, this.trackingNumber); } /** Required. Shipping address. */ public Builder setAddress(ChargeCreateParams.Shipping.Address address) { this.address = address; return this; } /** The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. */ public Builder setCarrier(String carrier) { this.carrier = carrier; return this; } /** * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` * call, and subsequent calls add additional key/value pairs to the original map. See {@link * ChargeCreateParams.Shipping#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.put(key, value); return this; } /** * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. * See {@link ChargeCreateParams.Shipping#extraParams} for the field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.putAll(map); return this; } /** Required. Recipient name. */ public Builder setName(String name) { this.name = name; return this; } /** Recipient phone (including extension). */ public Builder setPhone(String phone) { this.phone = phone; return this; } /** * The tracking number for a physical product, obtained from the delivery service. If multiple * tracking numbers were generated for this purchase, please separate them with commas. */ public Builder setTrackingNumber(String trackingNumber) { this.trackingNumber = trackingNumber; return this; } } @Getter public static class Address { /** City, district, suburb, town, or village. */ @SerializedName("city") String city; /** * Two-letter country code (ISO * 3166-1 alpha-2). */ @SerializedName("country") String country; /** * Map of extra parameters for custom features not available in this client library. The * content in this map is not serialized under this field's {@code @SerializedName} value. * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) * name in this param object. Effectively, this map is flattened to its parent instance. */ @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; /** Address line 1 (e.g., street, PO Box, or company name). */ @SerializedName("line1") String line1; /** Address line 2 (e.g., apartment, suite, unit, or building). */ @SerializedName("line2") String line2; /** ZIP or postal code. */ @SerializedName("postal_code") String postalCode; /** State, county, province, or region. */ @SerializedName("state") String state; private Address( String city, String country, Map extraParams, String line1, String line2, String postalCode, String state) { this.city = city; this.country = country; this.extraParams = extraParams; this.line1 = line1; this.line2 = line2; this.postalCode = postalCode; this.state = state; } public static Builder builder() { return new Builder(); } public static class Builder { private String city; private String country; private Map extraParams; private String line1; private String line2; private String postalCode; private String state; /** Finalize and obtain parameter instance from this builder. */ public ChargeCreateParams.Shipping.Address build() { return new ChargeCreateParams.Shipping.Address( this.city, this.country, this.extraParams, this.line1, this.line2, this.postalCode, this.state); } /** City, district, suburb, town, or village. */ public Builder setCity(String city) { this.city = city; return this; } /** * Two-letter country code (ISO * 3166-1 alpha-2). */ public Builder setCountry(String country) { this.country = country; return this; } /** * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original * map. See {@link ChargeCreateParams.Shipping.Address#extraParams} for the field * documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.put(key, value); return this; } /** * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original * map. See {@link ChargeCreateParams.Shipping.Address#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.putAll(map); return this; } /** Address line 1 (e.g., street, PO Box, or company name). */ public Builder setLine1(String line1) { this.line1 = line1; return this; } /** Address line 2 (e.g., apartment, suite, unit, or building). */ public Builder setLine2(String line2) { this.line2 = line2; return this; } /** ZIP or postal code. */ public Builder setPostalCode(String postalCode) { this.postalCode = postalCode; return this; } /** State, county, province, or region. */ public Builder setState(String state) { this.state = state; return this; } } } } @Getter public static class TransferData { /** * The amount transferred to the destination account, if specified. By default, the entire * charge amount is transferred to the destination account. */ @SerializedName("amount") Long amount; /** Required. ID of an existing, connected Stripe account. */ @SerializedName("destination") String destination; /** * Map of extra parameters for custom features not available in this client library. The content * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each * key/value pair is serialized as if the key is a root-level field (serialized) name in this * param object. Effectively, this map is flattened to its parent instance. */ @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; private TransferData(Long amount, String destination, Map extraParams) { this.amount = amount; this.destination = destination; this.extraParams = extraParams; } public static Builder builder() { return new Builder(); } public static class Builder { private Long amount; private String destination; private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ public ChargeCreateParams.TransferData build() { return new ChargeCreateParams.TransferData(this.amount, this.destination, this.extraParams); } /** * The amount transferred to the destination account, if specified. By default, the entire * charge amount is transferred to the destination account. */ public Builder setAmount(Long amount) { this.amount = amount; return this; } /** Required. ID of an existing, connected Stripe account. */ public Builder setDestination(String destination) { this.destination = destination; return this; } /** * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` * call, and subsequent calls add additional key/value pairs to the original map. See {@link * ChargeCreateParams.TransferData#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.put(key, value); return this; } /** * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. * See {@link ChargeCreateParams.TransferData#extraParams} for the field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { this.extraParams = new HashMap<>(); } this.extraParams.putAll(map); return this; } } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy