Package com.adyen.model.management
Class ReceiptOptions
- java.lang.Object
-
- com.adyen.model.management.ReceiptOptions
-
public class ReceiptOptions extends Object
ReceiptOptions
-
-
Field Summary
Fields Modifier and Type Field Description static StringJSON_PROPERTY_HEADER_LINE1static StringJSON_PROPERTY_HEADER_LINE2static StringJSON_PROPERTY_LOGOstatic StringJSON_PROPERTY_PROMPT_BEFORE_PRINTINGstatic StringJSON_PROPERTY_QR_CODE_DATA
-
Constructor Summary
Constructors Constructor Description ReceiptOptions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Return true if this ReceiptOptions object is equal to o.static ReceiptOptionsfromJson(String jsonString)Create an instance of ReceiptOptions given an JSON stringMap<String,Object>getExplicitNulls()Returns a map of properties to be merged into the JSON payload as explicit null values.StringgetHeaderLine1()The text of the first header line to be shown on the receipt.StringgetHeaderLine2()The text of the second header line to be shown on the receipt.StringgetLogo()The receipt logo converted to a Base64-encoded string.BooleangetPromptBeforePrinting()Indicates whether a screen appears asking if you want to print the shopper receipt.StringgetQrCodeData()Data to print on the receipt as a QR code.inthashCode()ReceiptOptionsheaderLine1(String headerLine1)The text of the first header line to be shown on the receipt.ReceiptOptionsheaderLine2(String headerLine2)The text of the second header line to be shown on the receipt.ReceiptOptionsincludeNullValues(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.ReceiptOptionslogo(String logo)The receipt logo converted to a Base64-encoded string.ReceiptOptionspromptBeforePrinting(Boolean promptBeforePrinting)Indicates whether a screen appears asking if you want to print the shopper receipt.ReceiptOptionsqrCodeData(String qrCodeData)Data to print on the receipt as a QR code.voidsetHeaderLine1(String headerLine1)The text of the first header line to be shown on the receipt.voidsetHeaderLine2(String headerLine2)The text of the second header line to be shown on the receipt.voidsetIncludeNullValues(boolean includeNullValues)Sets whether null values should be explicitly serialized in the JSON payload.voidsetLogo(String logo)The receipt logo converted to a Base64-encoded string.voidsetPromptBeforePrinting(Boolean promptBeforePrinting)Indicates whether a screen appears asking if you want to print the shopper receipt.voidsetQrCodeData(String qrCodeData)Data to print on the receipt as a QR code.StringtoJson()Convert an instance of ReceiptOptions to an JSON stringStringtoString()
-
-
-
Field Detail
-
JSON_PROPERTY_HEADER_LINE1
public static final String JSON_PROPERTY_HEADER_LINE1
- See Also:
- Constant Field Values
-
JSON_PROPERTY_HEADER_LINE2
public static final String JSON_PROPERTY_HEADER_LINE2
- See Also:
- Constant Field Values
-
JSON_PROPERTY_LOGO
public static final String JSON_PROPERTY_LOGO
- See Also:
- Constant Field Values
-
JSON_PROPERTY_PROMPT_BEFORE_PRINTING
public static final String JSON_PROPERTY_PROMPT_BEFORE_PRINTING
- See Also:
- Constant Field Values
-
JSON_PROPERTY_QR_CODE_DATA
public static final String JSON_PROPERTY_QR_CODE_DATA
- See Also:
- Constant Field Values
-
-
Method Detail
-
headerLine1
public ReceiptOptions headerLine1(String headerLine1)
The text of the first header line to be shown on the receipt.- Parameters:
headerLine1- The text of the first header line to be shown on the receipt.- Returns:
- the current
ReceiptOptionsinstance, allowing for method chaining
-
getHeaderLine1
public String getHeaderLine1()
The text of the first header line to be shown on the receipt.- Returns:
- headerLine1 The text of the first header line to be shown on the receipt.
-
setHeaderLine1
public void setHeaderLine1(String headerLine1)
The text of the first header line to be shown on the receipt.- Parameters:
headerLine1- The text of the first header line to be shown on the receipt.
-
headerLine2
public ReceiptOptions headerLine2(String headerLine2)
The text of the second header line to be shown on the receipt.- Parameters:
headerLine2- The text of the second header line to be shown on the receipt.- Returns:
- the current
ReceiptOptionsinstance, allowing for method chaining
-
getHeaderLine2
public String getHeaderLine2()
The text of the second header line to be shown on the receipt.- Returns:
- headerLine2 The text of the second header line to be shown on the receipt.
-
setHeaderLine2
public void setHeaderLine2(String headerLine2)
The text of the second header line to be shown on the receipt.- Parameters:
headerLine2- The text of the second header line to be shown on the receipt.
-
logo
public ReceiptOptions logo(String logo)
The receipt logo converted to a Base64-encoded string. The image must be a .bmp file of < 256 KB, dimensions 240 (H) x 384 (W) px.- Parameters:
logo- The receipt logo converted to a Base64-encoded string. The image must be a .bmp file of < 256 KB, dimensions 240 (H) x 384 (W) px.- Returns:
- the current
ReceiptOptionsinstance, allowing for method chaining
-
getLogo
public String getLogo()
The receipt logo converted to a Base64-encoded string. The image must be a .bmp file of < 256 KB, dimensions 240 (H) x 384 (W) px.- Returns:
- logo The receipt logo converted to a Base64-encoded string. The image must be a .bmp file of < 256 KB, dimensions 240 (H) x 384 (W) px.
-
setLogo
public void setLogo(String logo)
The receipt logo converted to a Base64-encoded string. The image must be a .bmp file of < 256 KB, dimensions 240 (H) x 384 (W) px.- Parameters:
logo- The receipt logo converted to a Base64-encoded string. The image must be a .bmp file of < 256 KB, dimensions 240 (H) x 384 (W) px.
-
promptBeforePrinting
public ReceiptOptions promptBeforePrinting(Boolean promptBeforePrinting)
Indicates whether a screen appears asking if you want to print the shopper receipt.- Parameters:
promptBeforePrinting- Indicates whether a screen appears asking if you want to print the shopper receipt.- Returns:
- the current
ReceiptOptionsinstance, allowing for method chaining
-
getPromptBeforePrinting
public Boolean getPromptBeforePrinting()
Indicates whether a screen appears asking if you want to print the shopper receipt.- Returns:
- promptBeforePrinting Indicates whether a screen appears asking if you want to print the shopper receipt.
-
setPromptBeforePrinting
public void setPromptBeforePrinting(Boolean promptBeforePrinting)
Indicates whether a screen appears asking if you want to print the shopper receipt.- Parameters:
promptBeforePrinting- Indicates whether a screen appears asking if you want to print the shopper receipt.
-
qrCodeData
public ReceiptOptions qrCodeData(String qrCodeData)
Data to print on the receipt as a QR code. This can include static text and the following variables: - `${merchantreference}`: the merchant reference of the transaction. - `${pspreference}`: the PSP reference of the transaction. For example, **http://www.example.com/order/${pspreference}/${merchantreference}**.- Parameters:
qrCodeData- Data to print on the receipt as a QR code. This can include static text and the following variables: - `${merchantreference}`: the merchant reference of the transaction. - `${pspreference}`: the PSP reference of the transaction. For example, **http://www.example.com/order/${pspreference}/${merchantreference}**.- Returns:
- the current
ReceiptOptionsinstance, allowing for method chaining
-
getQrCodeData
public String getQrCodeData()
Data to print on the receipt as a QR code. This can include static text and the following variables: - `${merchantreference}`: the merchant reference of the transaction. - `${pspreference}`: the PSP reference of the transaction. For example, **http://www.example.com/order/${pspreference}/${merchantreference}**.- Returns:
- qrCodeData Data to print on the receipt as a QR code. This can include static text and the following variables: - `${merchantreference}`: the merchant reference of the transaction. - `${pspreference}`: the PSP reference of the transaction. For example, **http://www.example.com/order/${pspreference}/${merchantreference}**.
-
setQrCodeData
public void setQrCodeData(String qrCodeData)
Data to print on the receipt as a QR code. This can include static text and the following variables: - `${merchantreference}`: the merchant reference of the transaction. - `${pspreference}`: the PSP reference of the transaction. For example, **http://www.example.com/order/${pspreference}/${merchantreference}**.- Parameters:
qrCodeData- Data to print on the receipt as a QR code. This can include static text and the following variables: - `${merchantreference}`: the merchant reference of the transaction. - `${pspreference}`: the PSP reference of the transaction. For example, **http://www.example.com/order/${pspreference}/${merchantreference}**.
-
includeNullValues
public ReceiptOptions 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 ReceiptOptions 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 ReceiptOptions fromJson(String jsonString) throws com.fasterxml.jackson.core.JsonProcessingException
Create an instance of ReceiptOptions given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of ReceiptOptions
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- if the JSON string is invalid with respect to ReceiptOptions
-
toJson
public String toJson() throws com.fasterxml.jackson.core.JsonProcessingException
Convert an instance of ReceiptOptions to an JSON string- Returns:
- JSON string
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
-