Package com.adyen.model.checkout
Class Donation
- java.lang.Object
-
- com.adyen.model.checkout.Donation
-
public class Donation extends Object
Donation
-
-
Field Summary
Fields Modifier and Type Field Description static StringJSON_PROPERTY_CURRENCYstatic StringJSON_PROPERTY_DONATION_TYPEstatic StringJSON_PROPERTY_MAX_ROUNDUP_AMOUNTstatic StringJSON_PROPERTY_TYPEstatic StringJSON_PROPERTY_VALUES
-
Constructor Summary
Constructors Constructor Description Donation()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DonationaddValuesItem(Long valuesItem)Donationcurrency(String currency)The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/).DonationdonationType(String donationType)The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types).booleanequals(Object o)Return true if this Donation object is equal to o.static DonationfromJson(String jsonString)Create an instance of Donation given an JSON stringStringgetCurrency()The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/).StringgetDonationType()The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types).LonggetMaxRoundupAmount()The maximum amount a transaction can be rounded up to make a donation.StringgetType()The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types).List<Long>getValues()The fixed donation amounts in [minor units](https://docs.adyen.com/development-resources/currency-codes//#minor-units).inthashCode()DonationmaxRoundupAmount(Long maxRoundupAmount)The maximum amount a transaction can be rounded up to make a donation.voidsetCurrency(String currency)The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/).voidsetDonationType(String donationType)The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types).voidsetMaxRoundupAmount(Long maxRoundupAmount)The maximum amount a transaction can be rounded up to make a donation.voidsetType(String type)The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types).voidsetValues(List<Long> values)The fixed donation amounts in [minor units](https://docs.adyen.com/development-resources/currency-codes//#minor-units).StringtoJson()Convert an instance of Donation to an JSON stringStringtoString()Donationtype(String type)The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types).Donationvalues(List<Long> values)The fixed donation amounts in [minor units](https://docs.adyen.com/development-resources/currency-codes//#minor-units).
-
-
-
Field Detail
-
JSON_PROPERTY_CURRENCY
public static final String JSON_PROPERTY_CURRENCY
- See Also:
- Constant Field Values
-
JSON_PROPERTY_DONATION_TYPE
public static final String JSON_PROPERTY_DONATION_TYPE
- See Also:
- Constant Field Values
-
JSON_PROPERTY_MAX_ROUNDUP_AMOUNT
public static final String JSON_PROPERTY_MAX_ROUNDUP_AMOUNT
- See Also:
- Constant Field Values
-
JSON_PROPERTY_TYPE
public static final String JSON_PROPERTY_TYPE
- See Also:
- Constant Field Values
-
JSON_PROPERTY_VALUES
public static final String JSON_PROPERTY_VALUES
- See Also:
- Constant Field Values
-
-
Method Detail
-
currency
public Donation currency(String currency)
The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/).- Parameters:
currency- The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/).- Returns:
- the current
Donationinstance, allowing for method chaining
-
getCurrency
public String getCurrency()
The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/).- Returns:
- currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/).
-
setCurrency
public void setCurrency(String currency)
The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/).- Parameters:
currency- The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes/).
-
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- 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:
- the current
Donationinstance, 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 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.
-
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- 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.
-
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- The maximum amount a transaction can be rounded up to make a donation. This field is only present when `donationType` is **roundup**.- Returns:
- the current
Donationinstance, 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 The maximum amount a transaction can be rounded up to make a donation. This field is only present when `donationType` is **roundup**.
-
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- The maximum amount a transaction can be rounded up to make a donation. This field is only present when `donationType` is **roundup**.
-
type
public Donation type(String type)
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 donation amounts that the shopper can select from.- Parameters:
type- 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 donation amounts that the shopper can select from.- Returns:
- the current
Donationinstance, allowing for method chaining
-
getType
public String getType()
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 donation amounts that the shopper can select from.- Returns:
- type 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 donation amounts that the shopper can select from.
-
setType
public void setType(String type)
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 donation amounts that the shopper can select from.- Parameters:
type- 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 donation amounts that the shopper can select from.
-
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- 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:
- the current
Donationinstance, allowing for method chaining
-
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 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**.
-
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- 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**.
-
equals
public boolean equals(Object o)
Return true if this Donation object is equal to o.
-
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
-
-