Skip to main content
If you have defined tipping options in your Customer Area, the default behavior is that the tipping options apply to the total purchase amount. However, there are situations when you may want to let the customer add a tip to a different amount:
  • When a customer buys a mix of products and services. For example, if the total amount consists of the costs of a haircut and a hair product, you can let the customer add a tip only for the cost of having the haircut.
  • To exclude product-related charges, taxes, or other fees. For example, a regulation in Quebec, Canada requires tips to be calculated on pre-tax amounts. To comply with this regulation, in your payment request you can add the purchase amount before taxes as the amount to tip on.
The terminal will present the customer with the adjusted amount before adding the tip. Note that you need to implement logic in your system when to override the total purchase amount as the amount to tip on.

Requirements

Before you begin, take into account the following requirements and preparations.

Specify amount to tip on in the payment request

When you override the amount to tip on, you are automatically overriding the tipping options defined in your Customer Area as well. This means that your payment request needs to include the AskGratuity tender option and a base-64 encoded Operation object with both the AmountToTipOn parameter and the TipSuggestions object.
  1. Create an Operation JSON object with the following parameters: Operation object
  2. Encode the Operation JSON object to Base64. You will pass the resulting string in SaleData.SaleToPOIData. The example below shows a Base64-encoded string of the Operation object format. Converted to a Base64-encoded string
  3. Make a payment request, specifying:
    • The standard SaleToPOIRequest.MessageHeader object, with MessageClass set to Service and MessageCategory set to Payment.
    The example below shows how to initiate a transaction with an adjusted amount to tip on. Payment request
  4. In the PaymentResponse note the following:
    • PaymentReceipt: receipt data with the original purchase amount, the gratuity amount, and the total amount. If the customer didn’t add a tip, the gratuity amount is not included.
    • PaymentResult.AmountsResp:
      • TipAmount: the amount of the tip. If the customer didn’t add a tip, this field is not included.
      • AuthorizedAmount: the total authorized amount of the transaction, consisting of the original purchase amount plus the tip amount.
      • Currency: the currency of the payment.
    • Response.AdditionalResponse: additional transaction data. Depending on your settings, you receive either a string of form-encoded key-value pairs or a Base64 string that you need to decode to get a JSON object. This includes:
      • posadditionalamounts.originalAmountValue: the original purchase amount in minor units.
      • posAmountGratuityValue: the tip amount in minor units.
      • authorisedAmountValue: the total authorized amount in minor units.
    The example below shows the response for a transaction where the original purchase amount was EUR 20.00, the adjusted amount to tip on was EUR 15.00, and a 20 percent tip was added. Payment response

See also