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_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.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.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()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_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-- 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
-
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
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
-
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
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
-
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
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
-
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.
-
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
-
-