# OnlinePayment

class OnlinePayment : Payment

The description of a completed payment, returned in the success value of Payment Result. All currency amounts are specified in the smallest denomination of the applicable currency. For example, US dollar amounts are specified in cents.

## Types

Builder
Link copied to clipboard
class Builder(id: String, amountMoney: Money, status: Payment.Status, locationId: String, sourceType: Payment.SourceType)

Builder class for constructing OnlinePayment objects.

## Properties

amountMoney
Link copied to clipboard
open override val amountMoney: Money

The base amount of money processed for this payment, not including tipMoney.

appFeeMoney
Link copied to clipboard
open override val appFeeMoney: Money?

The amount taken by the developer as a fee, not more than 90% of totalMoney.

capabilities
Link copied to clipboard
val capabilities: Payment.Capabilities

Actions that can be performed on this payment.

cardDetails
Link copied to clipboard
val cardDetails: CardPaymentDetails.OnlineCardPaymentDetails?

Non-confidential details for the source card, and auth code for this payment.

cashDetails
Link copied to clipboard
open override val cashDetails: CashPaymentDetails?

An optional field for a cash payment that holds information such as the buyer supplied amount and the change the user should get back.

createdAt
Link copied to clipboard
open override val createdAt: Date

Timestamp of when the payment was created.

customerId
Link copied to clipboard
val customerId: String?

An optional customer_id to be entered by the developer when creating a payment.

digitalWalletDetails
Link copied to clipboard
val digitalWalletDetails: DigitalWalletDetails?
externalDetails
Link copied to clipboard
open override val externalDetails: ExternalPaymentDetails?

Details about an external payment. The details are only populated if the sourceType is SourceType.EXTERNAL.

id
Link copied to clipboard
val id: String

Unique ID for this payment, assigned by Square.

locationId
Link copied to clipboard
open override val locationId: String

The ID of the location associated with the payment, if available.

note
Link copied to clipboard
val note: String?

An optional note to include when creating a payment.

orderId
Link copied to clipboard
open override val orderId: String?

The ID of the order associated with this payment.

processingFee
Link copied to clipboard
val processingFee: List<PaymentProcessingFee>

Processing fees and fee adjustments assessed by Square on this payment.

receiptNumber
Link copied to clipboard
val receiptNumber: String?

An optional receipt number associated with this payment, assigned by Square. The field is missing if the payment is Payment.Status.CANCELED.

referenceId
Link copied to clipboard
open override val referenceId: String?

An optional ID that associates this payment with an entity in another system.

remainingBalance
Link copied to clipboard
val remainingBalance: Money?

Remaining balance on an account.

sourceType
Link copied to clipboard
open override val sourceType: Payment.SourceType

The source type of the payment (card, cash, etc).

squareAccountDetails
Link copied to clipboard
val squareAccountDetails: SquareAccountDetails?

Details about a Square Account payment. The details are only populated if the sourceType is SourceType.SQUARE_ACCOUNT.

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.

status
Link copied to clipboard
val status: Payment.Status

Indicates whether the payment is Status.APPROVED, Status.COMPLETED, Status.CANCELED, or Status.FAILED.

teamMemberId
Link copied to clipboard
val teamMemberId: String?

An optional ID of the team member associated with taking the payment.

tipMoney
Link copied to clipboard
open override val tipMoney: Money?

The portion of totalMoney that is designated as a tip.

totalMoney
Link copied to clipboard
val totalMoney: Money

Total money is defined as base amount plus any tip; it doesn't need its own storage allocated, and definitely doesn't need an independent setter.

updatedAt
Link copied to clipboard
open override val updatedAt: Date

Timestamp when the payment was last updated.

## Functions

asOfflinePayment
Link copied to clipboard
fun asOfflinePayment(): Payment.OfflinePayment
asOnlinePayment
Link copied to clipboard
fun asOnlinePayment(): Payment.OnlinePayment
buildUpon
Link copied to clipboard
fun buildUpon(): Payment.OnlinePayment.Builder
isOfflinePayment
Link copied to clipboard
fun isOfflinePayment(): Boolean
isOnlinePayment
Link copied to clipboard
fun isOnlinePayment(): Boolean