makePayment

abstract fun makePayment(transactionId: String, amount: Int, currency: String, tip: Int?, purchaseData: PurchaseData? = null): PaymentStateSubscription

Initiates a communication with the Payment app to make a payment. See PaymentStateSubscription for ways to show a default Teya UI (on the relevant integration types), listen for state changes and cancel the payment.

TIP NOTE: If you provide a tip, it will be included in the total amount you pass. The tip is not added on top of amount, it is part of it.

For example:

amount = 100
tip = 20

In this case:

  • The total payment is £1.00 (100 in minor units).

  • £0.20 (20 in minor units) is considered the tip.

PosLink specifics:

  • transactionId should be unique to the store the user is linked to. Meaning, for a given store id, there should not be two transaction ids with the same value.

Return

A subscription PaymentStateSubscription to the payment state.

Parameters

transactionId

ePOS unique identifier for this new payment

amount

The total amount to be paid, including tip, in the smallest unit of the currency (e.g., cents).

currency

The ISO 4217 currency code (e.g., "GBP", "EUR").

tip

An optional tip amount, in the smallest unit of the currency. Denotes of the total amount how much the tip was, it will not change the charged amount.

purchaseData

Optional model that represents the details of a purchase PurchaseData, including line items and discounts.

See also