Package com.adyen.model.management
Class Gratuity
- java.lang.Object
-
- com.adyen.model.management.Gratuity
-
public class Gratuity extends Object
Gratuity
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGratuity.CustomTypeAdapterFactory
-
Field Summary
Fields Modifier and Type Field Description static HashSet<String>openapiFieldsstatic HashSet<String>openapiRequiredFieldsstatic StringSERIALIZED_NAME_ALLOW_CUSTOM_AMOUNTstatic StringSERIALIZED_NAME_CURRENCYstatic StringSERIALIZED_NAME_PREDEFINED_TIP_ENTRIESstatic StringSERIALIZED_NAME_USE_PREDEFINED_TIP_ENTRIES
-
Constructor Summary
Constructors Constructor Description Gratuity()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GratuityaddPredefinedTipEntriesItem(String predefinedTipEntriesItem)GratuityallowCustomAmount(Boolean allowCustomAmount)Gratuitycurrency(String currency)booleanequals(Object o)static GratuityfromJson(String jsonString)Create an instance of Gratuity given an JSON stringBooleangetAllowCustomAmount()Indicates whether one of the predefined tipping options is to let the shopper enter a custom tip.StringgetCurrency()The currency that the tipping settings apply to.List<String>getPredefinedTipEntries()Tipping options the shopper can choose from if `usePredefinedTipEntries` is **true**.BooleangetUsePredefinedTipEntries()Indicates whether the terminal shows a prompt to enter a tip (**false**), or predefined tipping options to choose from (**true**).inthashCode()GratuitypredefinedTipEntries(List<String> predefinedTipEntries)voidsetAllowCustomAmount(Boolean allowCustomAmount)voidsetCurrency(String currency)voidsetPredefinedTipEntries(List<String> predefinedTipEntries)voidsetUsePredefinedTipEntries(Boolean usePredefinedTipEntries)StringtoJson()Convert an instance of Gratuity to an JSON stringStringtoString()GratuityusePredefinedTipEntries(Boolean usePredefinedTipEntries)static voidvalidateJsonObject(com.google.gson.JsonObject jsonObj)Validates the JSON Object and throws an exception if issues found
-
-
-
Field Detail
-
SERIALIZED_NAME_ALLOW_CUSTOM_AMOUNT
public static final String SERIALIZED_NAME_ALLOW_CUSTOM_AMOUNT
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_CURRENCY
public static final String SERIALIZED_NAME_CURRENCY
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_PREDEFINED_TIP_ENTRIES
public static final String SERIALIZED_NAME_PREDEFINED_TIP_ENTRIES
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_USE_PREDEFINED_TIP_ENTRIES
public static final String SERIALIZED_NAME_USE_PREDEFINED_TIP_ENTRIES
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAllowCustomAmount
public Boolean getAllowCustomAmount()
Indicates whether one of the predefined tipping options is to let the shopper enter a custom tip. If **true**, only three of the other options defined in `predefinedTipEntries` are shown.- Returns:
- allowCustomAmount
-
setAllowCustomAmount
public void setAllowCustomAmount(Boolean allowCustomAmount)
-
getCurrency
public String getCurrency()
The currency that the tipping settings apply to.- Returns:
- currency
-
setCurrency
public void setCurrency(String currency)
-
addPredefinedTipEntriesItem
public Gratuity addPredefinedTipEntriesItem(String predefinedTipEntriesItem)
-
getPredefinedTipEntries
public List<String> getPredefinedTipEntries()
Tipping options the shopper can choose from if `usePredefinedTipEntries` is **true**. The maximum number of predefined options is four, or three plus the option to enter a custom tip. The options can be a mix of: - A percentage of the transaction amount. Example: **5%** - A tip amount in [minor units](https://docs.adyen.com/development-resources/currency-codes). Example: **500** for a EUR 5 tip.- Returns:
- predefinedTipEntries
-
getUsePredefinedTipEntries
public Boolean getUsePredefinedTipEntries()
Indicates whether the terminal shows a prompt to enter a tip (**false**), or predefined tipping options to choose from (**true**).- Returns:
- usePredefinedTipEntries
-
setUsePredefinedTipEntries
public void setUsePredefinedTipEntries(Boolean usePredefinedTipEntries)
-
validateJsonObject
public static void validateJsonObject(com.google.gson.JsonObject jsonObj) throws IOExceptionValidates the JSON Object and throws an exception if issues found- Parameters:
jsonObj- JSON Object- Throws:
IOException- if the JSON Object is invalid with respect to Gratuity
-
fromJson
public static Gratuity fromJson(String jsonString) throws IOException
Create an instance of Gratuity given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of Gratuity
- Throws:
IOException- if the JSON string is invalid with respect to Gratuity
-
toJson
public String toJson()
Convert an instance of Gratuity to an JSON string- Returns:
- JSON string
-
-