public static final class CheckoutParameters.Builder
extends java.lang.Object
CheckoutParameters
objects.Modifier and Type | Method and Description |
---|---|
CheckoutParameters.Builder |
additionalPaymentTypes(AdditionalPaymentType... paymentTypes) |
CheckoutParameters.Builder |
additionalPaymentTypes(java.util.Set<AdditionalPaymentType> paymentTypes)
A set of payment types the application may accept during checkout in addition to payments
via Square Readers, e.g.
|
CheckoutParameters.Builder |
allowSplitTender(boolean allowSplitTender)
Indicates that the transaction may be split into multiple tenders during checkout.
|
CheckoutParameters.Builder |
alwaysRequireSignature(boolean ignored)
Deprecated.
This is deprecated, and has no effect. See
collectSignature(boolean) instead. |
CheckoutParameters.Builder |
amountMoney(Money amountMoney) |
CheckoutParameters |
build()
Constructs a
CheckoutParameters from the current state of this builder. |
CheckoutParameters.Builder |
collectSignature(boolean collectSignature)
Indicates that signature collection is required during checkout.
|
CheckoutParameters.Builder |
delayCapture(boolean delayCapture)
When
true , if checkout completes successfully, the SDK will only authorize,
but not capture any card payments. |
CheckoutParameters.Builder |
noAdditionalPaymentTypes()
Clears the additionalPaymentTypes parameter.
|
CheckoutParameters.Builder |
noNote()
Clears the note parameter.
|
CheckoutParameters.Builder |
note(java.lang.String note)
An optional note to associate with the transaction.
|
CheckoutParameters.Builder |
noTip()
Disables tipping.
|
CheckoutParameters.Builder |
skipReceipt(boolean enabled)
Indicates that the digital receipt options screen should not be displayed during checkout.
|
CheckoutParameters.Builder |
tipSettings(TipSettings tipSettings)
Configures tipping behavior for the checkout flow.
|
@NonNull public CheckoutParameters.Builder amountMoney(@NonNull Money amountMoney)
amountMoney
- The amount to charge. Money.getAmount()
must not be negative.@NonNull public CheckoutParameters.Builder note(@NonNull java.lang.String note)
An optional note to associate with the transaction. The note will be included in the
itemizations
field of Payment
objects returned by the List Payments and
Retrieve Payment endpoints of the
Square Connect V1 API. It is also included on digital receipts.
The note can be cleared by calling noNote()
.
Defaults to null.
note
- The note to associate with the transaction.@NonNull public CheckoutParameters.Builder noNote()
note(String)
@NonNull public CheckoutParameters.Builder additionalPaymentTypes(@NonNull java.util.Set<AdditionalPaymentType> paymentTypes)
A set of payment types the application may accept during checkout in addition to payments via Square Readers, e.g. manually entered cards and cash.
Defaults to an empty set.
paymentTypes
- The additional payment types.@NonNull public CheckoutParameters.Builder additionalPaymentTypes(@NonNull AdditionalPaymentType... paymentTypes)
additionalPaymentTypes(Set)
@NonNull public CheckoutParameters.Builder noAdditionalPaymentTypes()
additionalPaymentTypes(Set)
@NonNull public CheckoutParameters.Builder allowSplitTender(boolean allowSplitTender)
Indicates that the transaction may be split into multiple tenders during checkout.
Defaults to false.
allowSplitTender
- true to allow split tenders, false otherwise.@NonNull public CheckoutParameters.Builder tipSettings(@NonNull TipSettings tipSettings)
Configures tipping behavior for the checkout flow.
Tipping can be disabled by calling noTip()
.
Defaults to disabled.
tipSettings
- The tip settings.@NonNull public CheckoutParameters.Builder noTip()
tipSettings(TipSettings)
@Deprecated @NonNull public CheckoutParameters.Builder alwaysRequireSignature(boolean ignored)
collectSignature(boolean)
instead.@NonNull public CheckoutParameters.Builder collectSignature(boolean collectSignature)
Defaults to false.
collectSignature
- true
to always require a signature, false
to never
require one.@NonNull public CheckoutParameters.Builder skipReceipt(boolean enabled)
Indicates that the digital receipt options screen should not be displayed during checkout. Square will always send digital receipts to customers who have opted in to automatic receipts.
Defaults to false.
enabled
- true to skip the receipt screen, false otherwise.@NonNull public CheckoutParameters.Builder delayCapture(boolean delayCapture)
When true
, if checkout completes successfully, the SDK will only authorize,
but not capture any card payments. You can then use the Square Connect
CaptureTransaction
endpoint to capture the card payments at a later time
Setting delayCapture to true
will skip the receipt, tipping, and signature
screens, and the following parameters will be overwritten:
tipSettings = null
skipReceipt = true
collectSignature = false
false
. By default, the SDK will immediately capture all card payments.delayCapture
- true
to only authorize but not capture any card payments, false
otherwise.@NonNull public CheckoutParameters build()
CheckoutParameters
from the current state of this builder.CheckoutParameters
object, copying the attributes from this
builder.