Package com.stripe.param
Class ChargeCreateParams.Builder
- java.lang.Object
-
- com.stripe.param.ChargeCreateParams.Builder
-
- Enclosing class:
- ChargeCreateParams
public static class ChargeCreateParams.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChargeCreateParams.Builder
addAllExpand(java.util.List<java.lang.String> elements)
Add all elements to `expand` list.ChargeCreateParams.Builder
addExpand(java.lang.String element)
Add an element to `expand` list.ChargeCreateParams
build()
Finalize and obtain parameter instance from this builder.ChargeCreateParams.Builder
putAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)
Add all map key/value pairs to `extraParams` map.ChargeCreateParams.Builder
putAllMetadata(java.util.Map<java.lang.String,java.lang.String> map)
Add all map key/value pairs to `metadata` map.ChargeCreateParams.Builder
putExtraParam(java.lang.String key, java.lang.Object value)
Add a key/value pair to `extraParams` map.ChargeCreateParams.Builder
putMetadata(java.lang.String key, java.lang.String value)
Add a key/value pair to `metadata` map.ChargeCreateParams.Builder
setAmount(java.lang.Long amount)
Amount intended to be collected by this payment.ChargeCreateParams.Builder
setApplicationFee(java.lang.Long applicationFee)
ChargeCreateParams.Builder
setApplicationFeeAmount(java.lang.Long applicationFeeAmount)
A fee in %s that will be applied to the charge and transferred to the application owner's Stripe account.ChargeCreateParams.Builder
setCapture(java.lang.Boolean capture)
Whether to immediately capture the charge.ChargeCreateParams.Builder
setCurrency(java.lang.String currency)
Three-letter ISO currency code, in lowercase.ChargeCreateParams.Builder
setCustomer(java.lang.String customer)
The ID of an existing customer that will be charged in this request.ChargeCreateParams.Builder
setDescription(java.lang.String description)
An arbitrary string which you can attach to aCharge
object.ChargeCreateParams.Builder
setDestination(ChargeCreateParams.Destination destination)
ChargeCreateParams.Builder
setMetadata(EmptyParam metadata)
Set of key-value pairs that you can attach to an object.ChargeCreateParams.Builder
setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Set of key-value pairs that you can attach to an object.ChargeCreateParams.Builder
setOnBehalfOf(java.lang.String onBehalfOf)
The Stripe account ID for which these funds are intended.ChargeCreateParams.Builder
setReceiptEmail(java.lang.String receiptEmail)
The email address to which this charge's receipt will be sent.ChargeCreateParams.Builder
setShipping(ChargeCreateParams.Shipping shipping)
Shipping information for the charge.ChargeCreateParams.Builder
setSource(java.lang.String source)
A payment source to be charged.ChargeCreateParams.Builder
setStatementDescriptor(java.lang.String statementDescriptor)
For card charges, usestatement_descriptor_suffix
instead.ChargeCreateParams.Builder
setStatementDescriptorSuffix(java.lang.String statementDescriptorSuffix)
Provides information about the charge that customers see on their statements.ChargeCreateParams.Builder
setTransferData(ChargeCreateParams.TransferData transferData)
An optional dictionary including the account to automatically transfer to as part of a destination charge.ChargeCreateParams.Builder
setTransferGroup(java.lang.String transferGroup)
A string that identifies this transaction as part of a group.
-
-
-
Method Detail
-
build
public ChargeCreateParams build()
Finalize and obtain parameter instance from this builder.
-
setAmount
public ChargeCreateParams.Builder setAmount(java.lang.Long amount)
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).
-
setApplicationFee
public ChargeCreateParams.Builder setApplicationFee(java.lang.Long applicationFee)
-
setApplicationFeeAmount
public ChargeCreateParams.Builder setApplicationFeeAmount(java.lang.Long applicationFeeAmount)
A fee in %s 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 theStripe-Account
header in order to take an application fee. For more information, see the application fees documentation.
-
setCapture
public ChargeCreateParams.Builder setCapture(java.lang.Boolean capture)
Whether to immediately capture the charge. Defaults totrue
. Whenfalse
, the charge issues an authorization (or pre-authorization), and will need to be captured later. Uncaptured charges expire in seven days. For more information, see the authorizing charges and settling later documentation.
-
setCurrency
public ChargeCreateParams.Builder setCurrency(java.lang.String currency)
Three-letter ISO currency code, in lowercase. Must be a supported currency.
-
setCustomer
public ChargeCreateParams.Builder setCustomer(java.lang.String customer)
The ID of an existing customer that will be charged in this request.
-
setDescription
public ChargeCreateParams.Builder setDescription(java.lang.String description)
An arbitrary string which you can attach to aCharge
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 thedescription
of the charge(s) that they are describing.
-
setDestination
public ChargeCreateParams.Builder setDestination(ChargeCreateParams.Destination destination)
-
addExpand
public ChargeCreateParams.Builder addExpand(java.lang.String element)
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. SeeChargeCreateParams.expand
for the field documentation.
-
addAllExpand
public ChargeCreateParams.Builder addAllExpand(java.util.List<java.lang.String> elements)
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. SeeChargeCreateParams.expand
for the field documentation.
-
putExtraParam
public ChargeCreateParams.Builder putExtraParam(java.lang.String key, java.lang.Object value)
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. SeeChargeCreateParams.extraParams
for the field documentation.
-
putAllExtraParam
public ChargeCreateParams.Builder putAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)
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. SeeChargeCreateParams.extraParams
for the field documentation.
-
putMetadata
public ChargeCreateParams.Builder putMetadata(java.lang.String key, java.lang.String value)
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. SeeChargeCreateParams.metadata
for the field documentation.
-
putAllMetadata
public ChargeCreateParams.Builder putAllMetadata(java.util.Map<java.lang.String,java.lang.String> map)
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. SeeChargeCreateParams.metadata
for the field documentation.
-
setMetadata
public ChargeCreateParams.Builder setMetadata(EmptyParam metadata)
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 tometadata
.
-
setMetadata
public ChargeCreateParams.Builder setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
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 tometadata
.
-
setOnBehalfOf
public ChargeCreateParams.Builder setOnBehalfOf(java.lang.String onBehalfOf)
The Stripe account ID for which these funds are intended. Automatically set if you use thedestination
parameter. For details, see Creating Separate Charges and Transfers.
-
setReceiptEmail
public ChargeCreateParams.Builder setReceiptEmail(java.lang.String receiptEmail)
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. Ifreceipt_email
is specified for a charge in live mode, a receipt will be sent regardless of your email settings.
-
setShipping
public ChargeCreateParams.Builder setShipping(ChargeCreateParams.Shipping shipping)
Shipping information for the charge. Helps prevent fraud on charges for physical goods.
-
setSource
public ChargeCreateParams.Builder setSource(java.lang.String source)
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.
-
setStatementDescriptor
public ChargeCreateParams.Builder setStatementDescriptor(java.lang.String statementDescriptor)
For card charges, usestatement_descriptor_suffix
instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters.
-
setStatementDescriptorSuffix
public ChargeCreateParams.Builder setStatementDescriptorSuffix(java.lang.String statementDescriptorSuffix)
Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.
-
setTransferData
public ChargeCreateParams.Builder setTransferData(ChargeCreateParams.TransferData transferData)
An optional dictionary including the account to automatically transfer to as part of a destination charge. See the Connect documentation for details.
-
setTransferGroup
public ChargeCreateParams.Builder setTransferGroup(java.lang.String transferGroup)
A string that identifies this transaction as part of a group. For details, see Grouping transactions.
-
-