On This Page
Sale with On-Reader Tipping
Use this information to process a sale with on-reader tipping. At the start of each
transaction, the device prompts the customer to add a tip by showing suggested tip
amounts and a no-tip option. The customer chooses or enters an amount before
presenting their payment card.
- Create the online payment service.
- Create aTippingconfiguration for the on-reader tip options.
- Add the tipping configuration to theChargeParametersobject and callstartChargeTransaction(with:).// Throws MposUIReaderError.notActivated if device is not activated let online = try await reader.mposUIOnline() // Percentage choices let tipConfig = Tipping.percentageChoice([5, 10, 15]) // Custom tip amount input // let tipConfig = Tipping.input(.tipAmount()) // Total amount including tip // let tipConfig = Tipping.input(.totalAmount()) let chargeParameters = ChargeParameters(amount: Decimal(1.00), currency: .USD, customIdentifier: "yourReferenceForTheTransaction", tip: tipConfig) let charge = await online.startChargeTransaction(with: chargeParameters)