Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,13 @@ public class ResponseAdditionalDataCommon {
/** Mark when the attribute has been explicitly set. */
private boolean isSetFraudManualReview = false;

/** The fraud result properties of the payment. */
/** The fraud result properties of the payment. Possible values: * AMBER * GREEN * RED */
public enum FraudResultTypeEnum {
AMBER(String.valueOf("AMBER")),

GREEN(String.valueOf("GREEN")),

FRAUD(String.valueOf("FRAUD"));
RED(String.valueOf("RED"));
Comment on lines 227 to +232
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Replacing FRAUD with RED is a breaking change. This will cause compilation errors for clients using FraudResultTypeEnum.FRAUD and can lead to runtime errors if the API still sends "FRAUD" as a value (which would result in null from fromValue).

To maintain backward compatibility, consider re-adding FRAUD as a deprecated constant. This allows existing client code to compile and run, while encouraging migration to RED. You may also want to update the Javadoc for the enum to mention the deprecation.

Suggested change
public enum FraudResultTypeEnum {
AMBER(String.valueOf("AMBER")),
GREEN(String.valueOf("GREEN")),
FRAUD(String.valueOf("FRAUD"));
RED(String.valueOf("RED"));
public enum FraudResultTypeEnum {
AMBER(String.valueOf("AMBER")),
GREEN(String.valueOf("GREEN")),
RED(String.valueOf("RED")),
/** @deprecated Replaced by {@link #RED}. */
@Deprecated
FRAUD(String.valueOf("FRAUD"));


private static final Logger LOG = Logger.getLogger(FraudResultTypeEnum.class.getName());

Expand Down Expand Up @@ -274,7 +276,7 @@ public static FraudResultTypeEnum fromValue(String value) {
* The risk level of the transaction as classified by the [machine
* learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/)
* fraud risk rule. The risk level indicates the likelihood that a transaction will result in a
* fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh
* fraudulent dispute. Possible values: * veryLow * low * medium * high * veryHigh
*/
public enum FraudRiskLevelEnum {
VERYLOW(String.valueOf("veryLow")),
Expand Down Expand Up @@ -1536,9 +1538,10 @@ public void setFraudManualReview(String fraudManualReview) {
}

/**
* The fraud result properties of the payment.
* The fraud result properties of the payment. Possible values: * AMBER * GREEN * RED
*
* @param fraudResultType The fraud result properties of the payment.
* @param fraudResultType The fraud result properties of the payment. Possible values: * AMBER *
* GREEN * RED
* @return the current {@code ResponseAdditionalDataCommon} instance, allowing for method chaining
*/
public ResponseAdditionalDataCommon fraudResultType(FraudResultTypeEnum fraudResultType) {
Expand All @@ -1548,9 +1551,10 @@ public ResponseAdditionalDataCommon fraudResultType(FraudResultTypeEnum fraudRes
}

/**
* The fraud result properties of the payment.
* The fraud result properties of the payment. Possible values: * AMBER * GREEN * RED
*
* @return fraudResultType The fraud result properties of the payment.
* @return fraudResultType The fraud result properties of the payment. Possible values: * AMBER *
* GREEN * RED
*/
@JsonProperty(JSON_PROPERTY_FRAUD_RESULT_TYPE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
Expand All @@ -1559,9 +1563,10 @@ public FraudResultTypeEnum getFraudResultType() {
}

/**
* The fraud result properties of the payment.
* The fraud result properties of the payment. Possible values: * AMBER * GREEN * RED
*
* @param fraudResultType The fraud result properties of the payment.
* @param fraudResultType The fraud result properties of the payment. Possible values: * AMBER *
* GREEN * RED
*/
@JsonProperty(JSON_PROPERTY_FRAUD_RESULT_TYPE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
Expand All @@ -1574,13 +1579,12 @@ public void setFraudResultType(FraudResultTypeEnum fraudResultType) {
* The risk level of the transaction as classified by the [machine
* learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/)
* fraud risk rule. The risk level indicates the likelihood that a transaction will result in a
* fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh
* fraudulent dispute. Possible values: * veryLow * low * medium * high * veryHigh
*
* @param fraudRiskLevel The risk level of the transaction as classified by the [machine
* learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/)
* fraud risk rule. The risk level indicates the likelihood that a transaction will result in
* a fraudulent dispute. The possible return values are: * veryLow * low * medium * high *
* veryHigh
* a fraudulent dispute. Possible values: * veryLow * low * medium * high * veryHigh
* @return the current {@code ResponseAdditionalDataCommon} instance, allowing for method chaining
*/
public ResponseAdditionalDataCommon fraudRiskLevel(FraudRiskLevelEnum fraudRiskLevel) {
Expand All @@ -1593,13 +1597,12 @@ public ResponseAdditionalDataCommon fraudRiskLevel(FraudRiskLevelEnum fraudRiskL
* The risk level of the transaction as classified by the [machine
* learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/)
* fraud risk rule. The risk level indicates the likelihood that a transaction will result in a
* fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh
* fraudulent dispute. Possible values: * veryLow * low * medium * high * veryHigh
*
* @return fraudRiskLevel The risk level of the transaction as classified by the [machine
* learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/)
* fraud risk rule. The risk level indicates the likelihood that a transaction will result in
* a fraudulent dispute. The possible return values are: * veryLow * low * medium * high *
* veryHigh
* a fraudulent dispute. Possible values: * veryLow * low * medium * high * veryHigh
*/
@JsonProperty(JSON_PROPERTY_FRAUD_RISK_LEVEL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
Expand All @@ -1611,13 +1614,12 @@ public FraudRiskLevelEnum getFraudRiskLevel() {
* The risk level of the transaction as classified by the [machine
* learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/)
* fraud risk rule. The risk level indicates the likelihood that a transaction will result in a
* fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh
* fraudulent dispute. Possible values: * veryLow * low * medium * high * veryHigh
*
* @param fraudRiskLevel The risk level of the transaction as classified by the [machine
* learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/)
* fraud risk rule. The risk level indicates the likelihood that a transaction will result in
* a fraudulent dispute. The possible return values are: * veryLow * low * medium * high *
* veryHigh
* a fraudulent dispute. Possible values: * veryLow * low * medium * high * veryHigh
*/
@JsonProperty(JSON_PROPERTY_FRAUD_RISK_LEVEL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
Expand Down