Package com.adyen.model.management
Class Gratuity
- java.lang.Object
-
- com.adyen.model.management.Gratuity
-
public class Gratuity extends Object
Gratuity
-
-
Field Summary
Fields Modifier and Type Field Description static StringJSON_PROPERTY_ALLOW_CUSTOM_AMOUNTstatic StringJSON_PROPERTY_CURRENCYstatic StringJSON_PROPERTY_PREDEFINED_TIP_ENTRIESstatic StringJSON_PROPERTY_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)Indicates whether one of the predefined tipping options is to let the shopper enter a custom tip.Gratuitycurrency(String currency)The currency that the tipping settings apply to.booleanequals(Object o)Return true if this Gratuity object is equal to 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)Tipping options the shopper can choose from if `usePredefinedTipEntries` is **true**.voidsetAllowCustomAmount(Boolean allowCustomAmount)Indicates whether one of the predefined tipping options is to let the shopper enter a custom tip.voidsetCurrency(String currency)The currency that the tipping settings apply to.voidsetPredefinedTipEntries(List<String> predefinedTipEntries)Tipping options the shopper can choose from if `usePredefinedTipEntries` is **true**.voidsetUsePredefinedTipEntries(Boolean usePredefinedTipEntries)Indicates whether the terminal shows a prompt to enter a tip (**false**), or predefined tipping options to choose from (**true**).StringtoJson()Convert an instance of Gratuity to an JSON stringStringtoString()GratuityusePredefinedTipEntries(Boolean usePredefinedTipEntries)Indicates whether the terminal shows a prompt to enter a tip (**false**), or predefined tipping options to choose from (**true**).
-
-
-
Field Detail
-
JSON_PROPERTY_ALLOW_CUSTOM_AMOUNT
public static final String JSON_PROPERTY_ALLOW_CUSTOM_AMOUNT
- See Also:
- Constant Field Values
-
JSON_PROPERTY_CURRENCY
public static final String JSON_PROPERTY_CURRENCY
- See Also:
- Constant Field Values
-
JSON_PROPERTY_PREDEFINED_TIP_ENTRIES
public static final String JSON_PROPERTY_PREDEFINED_TIP_ENTRIES
- See Also:
- Constant Field Values
-
JSON_PROPERTY_USE_PREDEFINED_TIP_ENTRIES
public static final String JSON_PROPERTY_USE_PREDEFINED_TIP_ENTRIES
- See Also:
- Constant Field Values
-
-
Method Detail
-
allowCustomAmount
public Gratuity allowCustomAmount(Boolean allowCustomAmount)
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.- Parameters:
allowCustomAmount-- Returns:
- the current
Gratuityinstance, allowing for method chaining
-
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)
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.- Parameters:
allowCustomAmount-
-
currency
public Gratuity currency(String currency)
The currency that the tipping settings apply to.- Parameters:
currency-- Returns:
- the current
Gratuityinstance, allowing for method chaining
-
getCurrency
public String getCurrency()
The currency that the tipping settings apply to.- Returns:
- currency
-
setCurrency
public void setCurrency(String currency)
The currency that the tipping settings apply to.- Parameters:
currency-
-
predefinedTipEntries
public Gratuity predefinedTipEntries(List<String> predefinedTipEntries)
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.- Parameters:
predefinedTipEntries-- Returns:
- the current
Gratuityinstance, allowing for method chaining
-
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
-
setPredefinedTipEntries
public void setPredefinedTipEntries(List<String> predefinedTipEntries)
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.- Parameters:
predefinedTipEntries-
-
usePredefinedTipEntries
public Gratuity usePredefinedTipEntries(Boolean usePredefinedTipEntries)
Indicates whether the terminal shows a prompt to enter a tip (**false**), or predefined tipping options to choose from (**true**).- Parameters:
usePredefinedTipEntries-- Returns:
- the current
Gratuityinstance, allowing for method chaining
-
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)
Indicates whether the terminal shows a prompt to enter a tip (**false**), or predefined tipping options to choose from (**true**).- Parameters:
usePredefinedTipEntries-
-
equals
public boolean equals(Object o)
Return true if this Gratuity object is equal to o.
-
fromJson
public static Gratuity fromJson(String jsonString) throws com.fasterxml.jackson.core.JsonProcessingException
Create an instance of Gratuity given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of Gratuity
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- if the JSON string is invalid with respect to Gratuity
-
toJson
public String toJson() throws com.fasterxml.jackson.core.JsonProcessingException
Convert an instance of Gratuity to an JSON string- Returns:
- JSON string
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
-