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 -
        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
      • 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 Gratuity instance, 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 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
      • 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 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
      • 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.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • 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