FILTER BY TAG

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.
Follow these steps to process a sale with on-reader tipping.
  1. Create a
    ChargeParameters
    object and provide the required information for the payment.
  2. Use the
    startChargeTransaction
    method to initiate the transaction flow.
    // Use to display three tipping percentage choices let tipConfig = Tipping.percentageChoice([5, 10, 15]) // Use to ask for tip amount // let tipConfig = Tipping.input(.tipAmount()) // Use to ask for total transaction amount including tip // let tipConfig = Tipping.input(.totalAmount()) let chargeParameters = ChargeParameters(amount: Decimal(1.00), currency: .USD, customIdentifier: "yourReferenceForTheTransaction", tip: tipConfig) let charge = await mposUi.startChargeTransaction(with: chargeParameters)
  3. After the transaction is completed, get the results of the transaction.
    switch charge { case .success(let transaction): print("Transaction with id: %@ completed with state: %@", transaction.identifier, transaction.status) case .failure(let error): print("Transaction failed with error: %@", error.localizedDescription) }
  4. To get complete transaction details, access the
    transaction
    object.