Package com.akraml.satim.util
Enum Class OrderStatus
- All Implemented Interfaces:
Serializable,Comparable<OrderStatus>,Constable
Enumeration of possible order statuses returned by the SATIM API.
These statuses indicate the current state of a payment order.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAuthorization initiated via ACS (3D Secure).Hold amount approved but not yet deposited.Authorization was declined.Payment has been successfully deposited.Transaction has been refunded.Order has been registered but payment has not been made.Authorization has been reversed.Unknown or unrecognized status. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull OrderStatusfromCode(int code) Converts a numeric status code to an OrderStatus enum value.intgetCode()Returns the numeric code for this status.@NotNull StringReturns a human-readable description of this status.booleanisFailed()Checks if this status represents a failed or reversed payment.booleanChecks if this status represents a pending payment.booleanChecks if this status represents a successful payment.static OrderStatusReturns the enum constant of this class with the specified name.static OrderStatus[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
REGISTERED
Order has been registered but payment has not been made. -
APPROVED
Hold amount approved but not yet deposited. Used for pre-authorization flows. -
DEPOSITED
Payment has been successfully deposited. This is the successful completion state. -
REVERSED
Authorization has been reversed. -
REFUNDED
Transaction has been refunded. -
ACS_AUTH
Authorization initiated via ACS (3D Secure). -
DECLINED
Authorization was declined. -
UNKNOWN
Unknown or unrecognized status.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getCode
public int getCode()Returns the numeric code for this status.- Returns:
- the status code
-
getDescription
Returns a human-readable description of this status.- Returns:
- the status description
-
fromCode
Converts a numeric status code to an OrderStatus enum value.- Parameters:
code- the numeric status code- Returns:
- the corresponding OrderStatus, or
UNKNOWNif not recognized
-
isSuccess
public boolean isSuccess()Checks if this status represents a successful payment.- Returns:
trueif the payment was successful
-
isPending
public boolean isPending()Checks if this status represents a pending payment.- Returns:
trueif the payment is pending
-
isFailed
public boolean isFailed()Checks if this status represents a failed or reversed payment.- Returns:
trueif the payment failed or was reversed
-