Package com.adyen.model.tapi
Class CurrencyConversion
- java.lang.Object
-
- com.adyen.model.tapi.CurrencyConversion
-
public class CurrencyConversion extends Object
Information related to a currency conversion. A currency conversion occurred in the payment, and the merchant needs to know information related to this conversion (e.g. to print on the sale receipt).
-
-
Field Summary
Fields Modifier and Type Field Description static StringJSON_PROPERTY_COMMISSIONstatic StringJSON_PROPERTY_CONVERTED_AMOUNTstatic StringJSON_PROPERTY_CUSTOMER_APPROVED_FLAGstatic StringJSON_PROPERTY_DECLARATIONstatic StringJSON_PROPERTY_MARKUPstatic StringJSON_PROPERTY_RATE
-
Constructor Summary
Constructors Constructor Description CurrencyConversion()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CurrencyConversioncommission(BigDecimal commission)Commission for a currency conversion.CurrencyConversionconvertedAmount(ConvertedAmount convertedAmount)convertedAmountCurrencyConversioncustomerApprovedFlag(Boolean customerApprovedFlag)Notify if the customer has approved something.CurrencyConversiondeclaration(String declaration)Declaration to present to the customer or the cashier for validation.booleanequals(Object o)Return true if this CurrencyConversion object is equal to o.static CurrencyConversionfromJson(String jsonString)Create an instance of CurrencyConversion given an JSON stringBigDecimalgetCommission()Commission for a currency conversion. minimum: 0.0 maximum: 99999999.999999ConvertedAmountgetConvertedAmount()Get convertedAmountBooleangetCustomerApprovedFlag()Notify if the customer has approved something.StringgetDeclaration()Declaration to present to the customer or the cashier for validation.Map<String,Object>getExplicitNulls()Returns a map of properties to be merged into the JSON payload as explicit null values.BigDecimalgetMarkup()Markup of a currency conversion amount as a percentage.BigDecimalgetRate()Rate of currency conversion.inthashCode()CurrencyConversionincludeNullValues(boolean includeNullValues)Configures whether null values are explicitly serialized in the JSON payload.booleanisIncludeNullValues()Returns whether null values are explicitly serialized in the JSON payload.CurrencyConversionmarkup(BigDecimal markup)Markup of a currency conversion amount as a percentage.CurrencyConversionrate(BigDecimal rate)Rate of currency conversion.voidsetCommission(BigDecimal commission)Commission for a currency conversion.voidsetConvertedAmount(ConvertedAmount convertedAmount)convertedAmountvoidsetCustomerApprovedFlag(Boolean customerApprovedFlag)Notify if the customer has approved something.voidsetDeclaration(String declaration)Declaration to present to the customer or the cashier for validation.voidsetIncludeNullValues(boolean includeNullValues)Sets whether null values should be explicitly serialized in the JSON payload.voidsetMarkup(BigDecimal markup)Markup of a currency conversion amount as a percentage.voidsetRate(BigDecimal rate)Rate of currency conversion.StringtoJson()Convert an instance of CurrencyConversion to an JSON stringStringtoString()
-
-
-
Field Detail
-
JSON_PROPERTY_CUSTOMER_APPROVED_FLAG
public static final String JSON_PROPERTY_CUSTOMER_APPROVED_FLAG
- See Also:
- Constant Field Values
-
JSON_PROPERTY_CONVERTED_AMOUNT
public static final String JSON_PROPERTY_CONVERTED_AMOUNT
- See Also:
- Constant Field Values
-
JSON_PROPERTY_RATE
public static final String JSON_PROPERTY_RATE
- See Also:
- Constant Field Values
-
JSON_PROPERTY_MARKUP
public static final String JSON_PROPERTY_MARKUP
- See Also:
- Constant Field Values
-
JSON_PROPERTY_COMMISSION
public static final String JSON_PROPERTY_COMMISSION
- See Also:
- Constant Field Values
-
JSON_PROPERTY_DECLARATION
public static final String JSON_PROPERTY_DECLARATION
- See Also:
- Constant Field Values
-
-
Method Detail
-
customerApprovedFlag
public CurrencyConversion customerApprovedFlag(Boolean customerApprovedFlag)
Notify if the customer has approved something. Indicates if the customer has accepted a currency conversion.- Parameters:
customerApprovedFlag- Notify if the customer has approved something. Indicates if the customer has accepted a currency conversion.- Returns:
- the current
CurrencyConversioninstance, allowing for method chaining
-
getCustomerApprovedFlag
public Boolean getCustomerApprovedFlag()
Notify if the customer has approved something. Indicates if the customer has accepted a currency conversion.- Returns:
- customerApprovedFlag Notify if the customer has approved something. Indicates if the customer has accepted a currency conversion.
-
setCustomerApprovedFlag
public void setCustomerApprovedFlag(Boolean customerApprovedFlag)
Notify if the customer has approved something. Indicates if the customer has accepted a currency conversion.- Parameters:
customerApprovedFlag- Notify if the customer has approved something. Indicates if the customer has accepted a currency conversion.
-
convertedAmount
public CurrencyConversion convertedAmount(ConvertedAmount convertedAmount)
convertedAmount- Parameters:
convertedAmount-- Returns:
- the current
CurrencyConversioninstance, allowing for method chaining
-
getConvertedAmount
public ConvertedAmount getConvertedAmount()
Get convertedAmount- Returns:
- convertedAmount
-
setConvertedAmount
public void setConvertedAmount(ConvertedAmount convertedAmount)
convertedAmount- Parameters:
convertedAmount-
-
rate
public CurrencyConversion rate(BigDecimal rate)
Rate of currency conversion.- Parameters:
rate- Rate of currency conversion.- Returns:
- the current
CurrencyConversioninstance, allowing for method chaining
-
getRate
public BigDecimal getRate()
Rate of currency conversion.- Returns:
- rate Rate of currency conversion.
-
setRate
public void setRate(BigDecimal rate)
Rate of currency conversion.- Parameters:
rate- Rate of currency conversion.
-
markup
public CurrencyConversion markup(BigDecimal markup)
Markup of a currency conversion amount as a percentage.- Parameters:
markup- Markup of a currency conversion amount as a percentage.- Returns:
- the current
CurrencyConversioninstance, allowing for method chaining
-
getMarkup
public BigDecimal getMarkup()
Markup of a currency conversion amount as a percentage.- Returns:
- markup Markup of a currency conversion amount as a percentage.
-
setMarkup
public void setMarkup(BigDecimal markup)
Markup of a currency conversion amount as a percentage.- Parameters:
markup- Markup of a currency conversion amount as a percentage.
-
commission
public CurrencyConversion commission(BigDecimal commission)
Commission for a currency conversion.- Parameters:
commission- Commission for a currency conversion.- Returns:
- the current
CurrencyConversioninstance, allowing for method chaining
-
getCommission
public BigDecimal getCommission()
Commission for a currency conversion. minimum: 0.0 maximum: 99999999.999999- Returns:
- commission Commission for a currency conversion.
-
setCommission
public void setCommission(BigDecimal commission)
Commission for a currency conversion.- Parameters:
commission- Commission for a currency conversion.
-
declaration
public CurrencyConversion declaration(String declaration)
Declaration to present to the customer or the cashier for validation. If a declaration has to be presented to the customer.- Parameters:
declaration- Declaration to present to the customer or the cashier for validation. If a declaration has to be presented to the customer.- Returns:
- the current
CurrencyConversioninstance, allowing for method chaining
-
getDeclaration
public String getDeclaration()
Declaration to present to the customer or the cashier for validation. If a declaration has to be presented to the customer.- Returns:
- declaration Declaration to present to the customer or the cashier for validation. If a declaration has to be presented to the customer.
-
setDeclaration
public void setDeclaration(String declaration)
Declaration to present to the customer or the cashier for validation. If a declaration has to be presented to the customer.- Parameters:
declaration- Declaration to present to the customer or the cashier for validation. If a declaration has to be presented to the customer.
-
includeNullValues
public CurrencyConversion includeNullValues(boolean includeNullValues)
Configures whether null values are explicitly serialized in the JSON payload. Default is false.
-
isIncludeNullValues
public boolean isIncludeNullValues()
Returns whether null values are explicitly serialized in the JSON payload.
-
setIncludeNullValues
public void setIncludeNullValues(boolean includeNullValues)
Sets whether null values should be explicitly serialized in the JSON payload. Default is false.
-
equals
public boolean equals(Object o)
Return true if this CurrencyConversion object is equal to o.
-
getExplicitNulls
public Map<String,Object> getExplicitNulls()
Returns a map of properties to be merged into the JSON payload as explicit null values.
-
fromJson
public static CurrencyConversion fromJson(String jsonString) throws com.fasterxml.jackson.core.JsonProcessingException
Create an instance of CurrencyConversion given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of CurrencyConversion
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- if the JSON string is invalid with respect to CurrencyConversion
-
toJson
public String toJson() throws com.fasterxml.jackson.core.JsonProcessingException
Convert an instance of CurrencyConversion to an JSON string- Returns:
- JSON string
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
-