Package com.akraml.satim.reply
Class OrderStatusReply
java.lang.Object
com.akraml.satim.reply.AbstractReply
com.akraml.satim.reply.OrderStatusReply
Response from the order status endpoint.
Contains detailed information about the current state of an order.
Example usage:
api.getPaymentStatus(orderId)
.thenAccept(reply -> {
System.out.println("Status: " + reply.getOrderStatus());
System.out.println("Amount: " + reply.getAmount());
if (reply.isDeposited()) {
System.out.println("Payment completed!");
}
});
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull OrderStatusReplyfromJson(@NotNull com.google.gson.JsonObject json) Creates an OrderStatusReply from a JSON response.@Nullable StringReturns the action code from the payment processor.@Nullable StringReturns the description of the action code.longReturns the payment amount in the smallest currency unit.@Nullable StringReturns the approval code from the payment processor.@Nullable StringReturns the cardholder name.@Nullable StringReturns the currency code.@Nullable StringReturns the card expiration date.@Nullable StringgetIp()Returns the customer's IP address.@Nullable StringReturns the merchant's order number.@NotNull OrderStatusReturns the current order status.@Nullable StringgetPan()Returns the masked card number (PAN).booleanChecks if the payment was declined or failed.booleanChecks if the payment was deposited (successfully completed).booleanChecks if the payment is pending.booleanChecks if the payment was refunded.booleanChecks if the payment was reversed.toString()Methods inherited from class com.akraml.satim.reply.AbstractReply
getErrorCode, getErrorMessage, getRawResponse, getResponse, isSuccessful
-
Method Details
-
getOrderStatus
Returns the current order status.- Returns:
- the order status enum
-
getOrderNumber
Returns the merchant's order number.- Returns:
- the order number
-
getAmount
public long getAmount()Returns the payment amount in the smallest currency unit.- Returns:
- the amount in centimes
-
getCurrency
Returns the currency code.- Returns:
- the ISO 4217 numeric currency code
-
getApprovalCode
Returns the approval code from the payment processor.- Returns:
- the approval code
-
getPan
Returns the masked card number (PAN).- Returns:
- the masked PAN
-
getExpiration
Returns the card expiration date.- Returns:
- the expiration date in YYYYMM format
-
getCardholderName
Returns the cardholder name.- Returns:
- the cardholder name
-
getIp
Returns the customer's IP address.- Returns:
- the IP address
-
getActionCode
Returns the action code from the payment processor.- Returns:
- the action code
-
getActionCodeDescription
Returns the description of the action code.- Returns:
- the action code description
-
isDeposited
public boolean isDeposited()Checks if the payment was deposited (successfully completed).- Returns:
trueif the payment is deposited
-
isPending
public boolean isPending()Checks if the payment is pending.- Returns:
trueif the payment is pending
-
isDeclined
public boolean isDeclined()Checks if the payment was declined or failed.- Returns:
trueif the payment failed
-
isRefunded
public boolean isRefunded()Checks if the payment was refunded.- Returns:
trueif the payment was refunded
-
isReversed
public boolean isReversed()Checks if the payment was reversed.- Returns:
trueif the payment was reversed
-
toString
- Overrides:
toStringin classAbstractReply
-
fromJson
@NotNull public static @NotNull OrderStatusReply fromJson(@NotNull @NotNull com.google.gson.JsonObject json) Creates an OrderStatusReply from a JSON response.- Parameters:
json- the JSON response from the API- Returns:
- a new OrderStatusReply instance
-