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)DonationdonationType(String donationType)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).\"Possible values:\\n\\n**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.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)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).\"Possible values:\\n\\n**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.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)
-
-
-
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
-
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-
-
getDonationType
public String getDonationType()
The [type of donation](https://docs.adyen.com/online-payments/donations/#donation-types).\"Possible values:\\n\\n**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:\\n\\n**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-
-
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-
-
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
-
-