GratuityConfig

data class GratuityConfig @JvmOverloads constructor(val mode: GratuityMode = GratuityMode.NONE, val amounts: List<Int> = emptyList(), val percentages: List<Int> = emptyList(), val addGratuityPrompt: String = "Add Gratuity?", val header: String = "Select Tip")

Constructors

Link copied to clipboard
constructor(mode: GratuityMode = GratuityMode.NONE, amounts: List<Int> = emptyList(), percentages: List<Int> = emptyList(), addGratuityPrompt: String = "Add Gratuity?", header: String = "Select Tip")

Properties

Link copied to clipboard

Text shown on the yes/no prompt asking the cardholder if they want to add a gratuity. Used in GratuityMode.STANDARD and GratuityMode.CONFIGURED modes. Maximum 30 characters; an IllegalArgumentException will be thrown if exceeded.

Link copied to clipboard

Fixed tip amounts in pence, displayed as selectable options in GratuityMode.CONFIGURED mode. E.g. listOf(100, 200, 300) renders as £1.00, £2.00, £3.00. Not applicable in GratuityMode.STANDARD mode — an IllegalArgumentException will be thrown. Maximum 3 amounts; an IllegalArgumentException will be thrown if exceeded. All values must not be negative; an IllegalArgumentException will be thrown otherwise.

Link copied to clipboard

Header text shown at the top of the tipping selection menu. Used in GratuityMode.STANDARD and GratuityMode.CONFIGURED modes. Maximum 30 characters; an IllegalArgumentException will be thrown if exceeded.

Link copied to clipboard

The tipping mode to use.

Link copied to clipboard

Tip percentages to display as selectable options. Only used in GratuityMode.CONFIGURED mode. In GratuityMode.STANDARD mode, percentages are fixed at 10%, 15%, and 20% — specifying custom percentages will throw an IllegalArgumentException. Maximum 3 percentages; an IllegalArgumentException will be thrown if exceeded. All values must be between 1 and 100; an IllegalArgumentException will be thrown otherwise.