Class Gratuity


  • public class Gratuity
    extends Object
    Gratuity
    • Constructor Detail

      • Gratuity

        public Gratuity()
    • 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 - 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:
        the current Gratuity instance, 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 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.
      • 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 - 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.
      • currency

        public Gratuity currency​(String currency)
        The currency that the tipping settings apply to.
        Parameters:
        currency - The currency that the tipping settings apply to.
        Returns:
        the current Gratuity instance, allowing for method chaining
      • getCurrency

        public String getCurrency()
        The currency that the tipping settings apply to.
        Returns:
        currency The currency that the tipping settings apply to.
      • setCurrency

        public void setCurrency​(String currency)
        The currency that the tipping settings apply to.
        Parameters:
        currency - The currency that the tipping settings apply to.
      • 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 - 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:
        the current Gratuity instance, 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 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.
      • 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 - 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.
      • 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 - Indicates whether the terminal shows a prompt to enter a tip (**false**), or predefined tipping options to choose from (**true**).
        Returns:
        the current Gratuity instance, 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 Indicates whether the terminal shows a prompt to enter a tip (**false**), or predefined tipping options to choose from (**true**).
      • 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 - Indicates whether the terminal shows a prompt to enter a tip (**false**), or predefined tipping options to choose from (**true**).
      • includeNullValues

        public Gratuity includeNullValues​(boolean includeNullValues)
        Configures whether null values are explicitly serialized in the JSON payload. Default is false.
      • isIncludeNullValues

        public boolean isIncludeNullValues()
        Returns whether null values are explicitly serialized in the JSON payload.
      • setIncludeNullValues

        public void setIncludeNullValues​(boolean includeNullValues)
        Sets whether null values should be explicitly serialized in the JSON payload. Default is false.
      • equals

        public boolean equals​(Object o)
        Return true if this Gratuity object is equal to o.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getExplicitNulls

        public Map<String,​Object> getExplicitNulls()
        Returns a map of properties to be merged into the JSON payload as explicit null values.
      • 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