Class OrderStatusReply

java.lang.Object
com.akraml.satim.reply.AbstractReply
com.akraml.satim.reply.OrderStatusReply

public class OrderStatusReply extends AbstractReply
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 Details

    • getOrderStatus

      @NotNull public @NotNull OrderStatus getOrderStatus()
      Returns the current order status.
      Returns:
      the order status enum
    • getOrderNumber

      @Nullable public @Nullable String 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

      @Nullable public @Nullable String getCurrency()
      Returns the currency code.
      Returns:
      the ISO 4217 numeric currency code
    • getApprovalCode

      @Nullable public @Nullable String getApprovalCode()
      Returns the approval code from the payment processor.
      Returns:
      the approval code
    • getPan

      @Nullable public @Nullable String getPan()
      Returns the masked card number (PAN).
      Returns:
      the masked PAN
    • getExpiration

      @Nullable public @Nullable String getExpiration()
      Returns the card expiration date.
      Returns:
      the expiration date in YYYYMM format
    • getCardholderName

      @Nullable public @Nullable String getCardholderName()
      Returns the cardholder name.
      Returns:
      the cardholder name
    • getIp

      @Nullable public @Nullable String getIp()
      Returns the customer's IP address.
      Returns:
      the IP address
    • getActionCode

      @Nullable public @Nullable String getActionCode()
      Returns the action code from the payment processor.
      Returns:
      the action code
    • getActionCodeDescription

      @Nullable public @Nullable String 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:
      true if the payment is deposited
    • isPending

      public boolean isPending()
      Checks if the payment is pending.
      Returns:
      true if the payment is pending
    • isDeclined

      public boolean isDeclined()
      Checks if the payment was declined or failed.
      Returns:
      true if the payment failed
    • isRefunded

      public boolean isRefunded()
      Checks if the payment was refunded.
      Returns:
      true if the payment was refunded
    • isReversed

      public boolean isReversed()
      Checks if the payment was reversed.
      Returns:
      true if the payment was reversed
    • toString

      public String toString()
      Overrides:
      toString in class AbstractReply
    • 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