# Payment

sealed class 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.

#### Inheritors

OnlinePayment
OfflinePayment

## Types

Capabilities
Link copied to clipboard
data class Capabilities(val allCapabilities: Set<String>)

Actions that can be performed on a payment, e.g. modifying the tip amount up or down.

OfflinePayment
Link copied to clipboard
class OfflinePayment : Payment

The description of a completed payment, that was taken while Offline. All currency amounts are specified in the smallest denomination of the applicable currency. For example, US dollar amounts are specified in cents.

OfflineStatus
Link copied to clipboard
enum OfflineStatus : Enum<Payment.OfflineStatus>

The status of the offline payment.

OnlinePayment
Link copied to clipboard
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.

SourceType
Link copied to clipboard
enum SourceType : Enum<Payment.SourceType>

The source type of the payment.

Status
Link copied to clipboard
enum Status : Enum<Payment.Status>

The status of the payment.

## Properties

amountMoney
Link copied to clipboard
abstract val amountMoney: Money

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

appFeeMoney
Link copied to clipboard
abstract val appFeeMoney: Money?

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

cashDetails
Link copied to clipboard
abstract 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
abstract val createdAt: Date

Timestamp of when the payment was created.

externalDetails
Link copied to clipboard
abstract val externalDetails: ExternalPaymentDetails?

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

locationId
Link copied to clipboard
abstract val locationId: String

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

orderId
Link copied to clipboard
abstract val orderId: String?

The ID of the order associated with this payment.

referenceId
Link copied to clipboard
abstract val referenceId: String?

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

sourceType
Link copied to clipboard
abstract val sourceType: Payment.SourceType

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

tipMoney
Link copied to clipboard
abstract 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
abstract 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
isOfflinePayment
Link copied to clipboard
fun isOfflinePayment(): Boolean
isOnlinePayment
Link copied to clipboard
fun isOnlinePayment(): Boolean