# Builder

class Builder(amount: Money, processingMode: ProcessingMode, allowCardSurcharge: Boolean)

The builder used to create PaymentParameters. An amount of money, processingMode, and allowCardSurcharge are all required to build PaymentParameters. In addition, Builder.paymentAttemptId or (deprecated) Builder.idempotencyKey must be set.

## Constructors

Builder
Link copied to clipboard
constructor(amount: Money, processingMode: ProcessingMode, allowCardSurcharge: Boolean)

## Functions

acceptPartialAuthorization
Link copied to clipboard
fun acceptPartialAuthorization(acceptPartialAuthorization: Boolean): PaymentParameters.Builder

Allows successful authorization of a part of the requested amountMoney. Defaults to false.

appFeeMoney
Link copied to clipboard
fun appFeeMoney(amount: Money?): PaymentParameters.Builder

Records a fee to the app developer, taken from amountMoney.

autocomplete
Link copied to clipboard
fun autocomplete(autoComplete: Boolean): PaymentParameters.Builder

Controls whether this payment will, when made, be completed (`true`) or only authorized (`false`). Payments that are only authorized need to be either completed or canceled later, using the Connect v2 CompletePayment API and passing the `payment_id` returned from authorization.

build
Link copied to clipboard
fun build(): PaymentParameters
customerId
Link copied to clipboard
fun customerId(customerId: String?): PaymentParameters.Builder

Associates a customer to the payment being constructed by this builder.

delayAction
Link copied to clipboard
fun delayAction(delayAction: DelayAction?): PaymentParameters.Builder

Sets the action taken, for payments with autocomplete equal to false, after the payment's delayDuration has expired. Default is DelayAction.CANCEL if not explicitly set.

delayDuration
Link copied to clipboard
fun delayDuration(delayDuration: Long?): PaymentParameters.Builder

Sets the duration between payment creation and automatic cancellation, for payments with autocomplete equal to false.

locationId
Link copied to clipboard
fun locationId(locationId: String?): PaymentParameters.Builder

Sets the location ID of the location taking this payment. Defaults to the location id from authorization.

note
Link copied to clipboard
fun note(note: String?): PaymentParameters.Builder

Sets an arbitrary note onto the payment.

orderId
Link copied to clipboard
fun orderId(orderId: String?): PaymentParameters.Builder

Associates an order to the payment being constructed by this builder.

paymentAttemptId
Link copied to clipboard
fun paymentAttemptId(paymentAttemptId: String?): PaymentParameters.Builder
referenceId
Link copied to clipboard
fun referenceId(referenceId: String?): PaymentParameters.Builder

Associates an arbitrary reference to the payment being constructed by this builder.

statementDescription
Link copied to clipboard
fun statementDescription(description: String?): PaymentParameters.Builder

Assigns a statement description string.

teamMemberId
Link copied to clipboard
fun teamMemberId(teamMemberId: String?): PaymentParameters.Builder

Sets the TeamMember ID to associate with this payment.

tipMoney
Link copied to clipboard
fun tipMoney(amount: Money?): PaymentParameters.Builder

Adds a tip amount to the builder, an amount in addition to amountMoney treated as a tip.