Class Donation


  • public class Donation
    extends Object
    Donation
    • Constructor Detail

      • Donation

        public Donation()
    • Method Detail

      • currency

        public Donation currency​(String currency)
        The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/).
        Parameters:
        currency -
        Returns:
        the current Donation instance, allowing for method chaining
      • getCurrency

        public String getCurrency()
        The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/).
        Returns:
        currency
      • setCurrency

        public void setCurrency​(String currency)
        The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/).
        Parameters:
        currency -
      • donationType

        public Donation donationType​(String donationType)
        The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donations amounts that the shopper can select from.
        Parameters:
        donationType -
        Returns:
        the current Donation instance, allowing for method chaining
      • getDonationType

        public String getDonationType()
        The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donations amounts that the shopper can select from.
        Returns:
        donationType
      • setDonationType

        public void setDonationType​(String donationType)
        The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types). Possible values: * **roundup**: a donation where the original transaction amount is rounded up as a donation. * **fixedAmounts**: a donation where you show fixed donations amounts that the shopper can select from.
        Parameters:
        donationType -
      • maxRoundupAmount

        public Donation maxRoundupAmount​(Long maxRoundupAmount)
        The maximum amount a transaction can be rounded up to make a donation. This field is only present when `donationType` is **roundup**.
        Parameters:
        maxRoundupAmount -
        Returns:
        the current Donation instance, allowing for method chaining
      • getMaxRoundupAmount

        public Long getMaxRoundupAmount()
        The maximum amount a transaction can be rounded up to make a donation. This field is only present when `donationType` is **roundup**.
        Returns:
        maxRoundupAmount
      • setMaxRoundupAmount

        public void setMaxRoundupAmount​(Long maxRoundupAmount)
        The maximum amount a transaction can be rounded up to make a donation. This field is only present when `donationType` is **roundup**.
        Parameters:
        maxRoundupAmount -
      • values

        public Donation values​(List<Long> values)
        The fixed donation amounts in [minor units](https://docs.adyen.com/development-resources/currency-codes//#minor-units). This field is only present when `donationType` is **fixedAmounts**.
        Parameters:
        values -
        Returns:
        the current Donation instance, allowing for method chaining
      • addValuesItem

        public Donation addValuesItem​(Long valuesItem)
      • getValues

        public List<Long> getValues()
        The fixed donation amounts in [minor units](https://docs.adyen.com/development-resources/currency-codes//#minor-units). This field is only present when `donationType` is **fixedAmounts**.
        Returns:
        values
      • setValues

        public void setValues​(List<Long> values)
        The fixed donation amounts in [minor units](https://docs.adyen.com/development-resources/currency-codes//#minor-units). This field is only present when `donationType` is **fixedAmounts**.
        Parameters:
        values -
      • equals

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

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

        public static Donation fromJson​(String jsonString)
                                 throws com.fasterxml.jackson.core.JsonProcessingException
        Create an instance of Donation given an JSON string
        Parameters:
        jsonString - JSON string
        Returns:
        An instance of Donation
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - if the JSON string is invalid with respect to Donation
      • toJson

        public String toJson()
                      throws com.fasterxml.jackson.core.JsonProcessingException
        Convert an instance of Donation to an JSON string
        Returns:
        JSON string
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException