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(Money(350, USD), "idempotency-key")
.autocomplete(true)
.orderId("YZ2319D")
.tipMoney(Money(100, USD))
.referenceId("1314387")
.build()

Types

Link copied to clipboard
class Builder(amount: Money, idempotencyKey: String)

The builder used to create PaymentParameters. Create a Builder for a payment of a specific amount of money with provided idempotencyKey.

Properties

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

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%.

Link copied to clipboard

Most transactions immediately "capture," but this setting can delay that. It is true by default, but if set false, then the card will be processed up to authentication, and will complete or cancel based on the delayDuration and delayAction settings.

Link copied to clipboard

Optionally set to the customer Id of the purchaser.

Link copied to clipboard

Action to take after delayDuration has expired without payment the authorized payment being either completion or cancellation. By default, this will be CANCEL unless explicitly set.

Link copied to clipboard

Delay between creating a payment with autocomplete=false and when Square will automatically cancel the payment. Expressed in milliseconds here, because that is the JVM standard, but sent truncated to minutes (60,000ms), because a 5 millisecond delay is silly. Unused when autocomplete=true, because the payment will be completed or failed immediately.

Link copied to clipboard

idempotencyKey a unique string to identify "this" payment.

Link copied to clipboard

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

Link copied to clipboard
val note: String?

An optional note to annotate a payment.

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

Optional team member to associate with the payment.

Link copied to clipboard

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

Functions

Link copied to clipboard
fun buildUpon(newIdempotencyKey: String = idempotencyKey): PaymentParameters.Builder