# PaymentParameters

class PaymentParameters

Parameters to describe a single payment made using Mobile Payments SDK. Use Builder to create and configure payment parameters, for example:

    val paymentParameters = PaymentParameters.Builder(
       amount = Money(350, USD),
       processingMode = AUTO_DETECT,
       allowCardSurcharge = true,
       paymentAttemptId = "SK95TM0",
    )
       .autocomplete(true)
       .orderId("YZ2319D")
       .tipMoney(Money(100, USD))
       .referenceId("1314387")
       .build()

Content copied to clipboard

## Types

Builder
Link copied to clipboard
class Builder(amount: Money, processingMode: ProcessingMode, allowCardSurcharge: Boolean, paymentAttemptId: String)

The builder used to create PaymentParameters. An amount of money, processingMode, allowCardSurcharge, and paymentAttemptId are all required to build PaymentParameters.

## Properties

acceptPartialAuthorization
Link copied to clipboard
val acceptPartialAuthorization: Boolean

Allows successful authorization of a part of the requested amountMoney. Defaults to false. It is necessary to check the returned Payment object to determine the actual amount authorized.

allowCardSurcharge
Link copied to clipboard
val allowCardSurcharge: Boolean

Enable or disable card surcharges for this payment. If `false`, no surcharge is applied to this payment, even if the merchant has configured a card surcharge in the Square Dashboard. If `true`, the card surcharge settings in the Dashboard (if configured) are applied to this payment.

amountMoney
Link copied to clipboard
val amountMoney: Money

The amount of money to accept for this payment, not including tipMoney, but including any appFeeMoney.

appFeeMoney
Link copied to clipboard
val appFeeMoney: Money?

appFeeMoney is an amount of money paid to a marketplace or application developer instead of the selling merchant, as a fee for processing the payment. Square takes the specified portion of the amount from the payment and deposits it in the developer account balance. For payments (including tip) greater than or equal to

$5.00, the maximum application fee percentage is 90%. For amounts below $

5 the maximum application fee percentage is 60%.
autocomplete
Link copied to clipboard
val autocomplete: Boolean

If set to `true`, this payment will be completed when possible. If set to `false`, this payment is held in an approved state until either explicitly completed or canceled.

customerId
Link copied to clipboard
val customerId: String?

Optionally set to the customer Id of the purchaser.

delayAction
Link copied to clipboard
val delayAction: DelayAction?

The DelayAction to be applied to the payment when the delayDuration has elapsed. Like delayDuration, card payments with autocomplete=true and non-card payments ignore this parameter.

delayDuration
Link copied to clipboard
val delayDuration: Long?

The duration of time after the payment's creation when Square either completes or cancels the payment automatically depending on the delayAction field value, expressed in milliseconds here and truncated to minutes in the payment request.

locationId
Link copied to clipboard
val locationId: String?

Optionally override the location provided when authenticating to Mobile Payments SDK.

note
Link copied to clipboard
val note: String?

An optional note to annotate a payment.

orderId
Link copied to clipboard
val orderId: String?

The order associated with this purchase, or `null` if there is no order. Orders can be manipulated with the Orders API, and associate a transaction with the specific line items purchased in that transaction.

paymentAttemptId
Link copied to clipboard
val paymentAttemptId: String

A unique identifier for the payment attempted with PaymentManager.startPaymentActivity. When provided, Mobile Payments SDK generates a unique idempotency key for the payment request and stores it with the payment attempt ID. If multiple payment requests are made for the same payment attempt (e.g. due to Strong Customer Authentication (SCA) requirements in Europe), the SDK generates a new idempotency key for each request and replaces the stored idempotency key for the payment attempt ID.

processingMode
Link copied to clipboard
val processingMode: ProcessingMode

The processingMode parameter determines whether the current payment needs to be processed online or offline. By default, this will be AUTO_DETECT unless explicitly set.

referenceId
Link copied to clipboard
val referenceId: String?

Optional value that can be used to associate a reference to some external system with this payment. The value is not used by Square. The same value is returned in a successful Payment response.

statementDescription
Link copied to clipboard
val statementDescription: String?

An override of the description line on the buyer's statement. Will be prefixed with Square's "SQ*" prefix, and may be truncated by the bank during generation.

teamMemberId
Link copied to clipboard
val teamMemberId: String?

Optional team member to associate with the payment.

tipMoney
Link copied to clipboard
val tipMoney: Money?

The amount charged as a tip, in addition to amountMoney.

## Functions

buildUpon
Link copied to clipboard
fun buildUpon(): PaymentParameters.Builder