Builder

class Builder

The PaymentIntentParameters.Builder class provides a convenient way to create a new PaymentIntentParameters instance without having to deal with parameters that aren't relevant to your integration.

Constructors

Link copied to clipboard
fun Builder(amount: Long, currency: String, captureMethod: CaptureMethod, allowedPaymentMethodTypes: List<PaymentMethodType> = listOf(PaymentMethodType.CARD_PRESENT))

Create a builder for creating a PaymentIntent.

Link copied to clipboard
fun Builder(allowedPaymentMethodTypes: List<PaymentMethodType> = listOf(PaymentMethodType.CARD_PRESENT))

Create a simple builder for creating a PaymentIntent.

Functions

Link copied to clipboard
fun build(): PaymentIntentParameters

Create a final instance of PaymentIntentParameters with the parameters that you've set.

Link copied to clipboard
fun setAmount(amount: Long): PaymentIntentParameters.Builder

Set the amount of the payment, provided in the currency's smallest unit.

Link copied to clipboard
fun setApplicationFeeAmount(amount: Long): PaymentIntentParameters.Builder

Set the amount of the application fee (if any) that will be applied to the payment and transferred to the application owner’s Stripe account. To use an application fee, the request must be made on behalf of another account, using the stripeAccount property or an OAuth key.

Link copied to clipboard
fun setCaptureMethod(captureMethod: CaptureMethod): PaymentIntentParameters.Builder

Set the capture method, which controls when the funds will be captured from the customer's account. Defaults to "manual" if not set.

Link copied to clipboard
fun setCurrency(currency: String): PaymentIntentParameters.Builder

Set the three-letter ISO currency code, in lowercase. Must be a supported currency.

Link copied to clipboard
fun setCustomer(customer: String): PaymentIntentParameters.Builder

Set the ID of the Customer this PaymentIntent is for, if one exists.

Link copied to clipboard
fun setDescription(description: String): PaymentIntentParameters.Builder

Set the description - an arbitrary string attached to the object. If you send a receipt email for this payment, the email will include the description.

Link copied to clipboard
fun setMetadata(metadata: Map<String, String>): PaymentIntentParameters.Builder

Set the map 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.

Link copied to clipboard
fun setOnBehalfOf(onBehalfOf: String): PaymentIntentParameters.Builder

Set the Stripe account ID for which these funds are intended.

Link copied to clipboard
fun setPaymentMethodOptionsParameters(paymentMethodOptionsParameters: PaymentMethodOptionsParameters): PaymentIntentParameters.Builder

Set a payment-method-specific configuration for this PaymentIntent.

Link copied to clipboard
fun setReceiptEmail(receiptEmail: String): PaymentIntentParameters.Builder

Set the email address that the receipt for the resulting payment will be sent to.

Link copied to clipboard
fun setSetupFutureUsage(setupFutureUsage: String): PaymentIntentParameters.Builder

Set a string (if any) that indicates the type of future usage (possible values: off_session, on_session)

Link copied to clipboard
fun setStatementDescriptor(statementDescriptor: String): PaymentIntentParameters.Builder

Set a string to be displayed on your customer's credit card statement. This may be up to 22 characters. The statement descriptor must contain at least one letter, may not include <>"' characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. While most banks and card issuers display this information consistently, some may display it incorrectly or not at all.

Link copied to clipboard
fun setStatementDescriptorSuffix(statementDescriptorSuffix: String): PaymentIntentParameters.Builder

A string to specify details about the transaction so your customer can understand it clearly on their statement. The suffix is concatenated with the statementDescriptor, the * symbol, and a space to form the complete statement descriptor that your customer sees. Maximum 22 characters for the final concatenated descriptor.

Link copied to clipboard
fun setTransferDataDestination(transferDataDestination: String): PaymentIntentParameters.Builder

Set the account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to upon payment success.

Link copied to clipboard
fun setTransferGroup(transferGroup: String): PaymentIntentParameters.Builder

Set a string that identifies the resulting payment as part of a group.