Class OrderConfirmationReply

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

public class OrderConfirmationReply extends AbstractReply
Response from the order confirmation endpoint.

Contains the result of confirming/completing a payment.

This is typically called when the customer returns from the payment page.

Example usage:


 api.confirmPayment(orderId)
     .thenAccept(reply -> {
         if (reply.isSuccessful()) {
             System.out.println("Payment confirmed: " + reply.getApprovalCode());
         } else {
             System.out.println("Payment failed: " + reply.getErrorMessage());
         }
     });
 
See Also:
  • Method Details

    • getOrderStatus

      @NotNull public @NotNull OrderStatus getOrderStatus()
      Returns the 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 (e.g., "012" for DZD)
    • getApprovalCode

      @Nullable public @Nullable String getApprovalCode()
      Returns the approval code from the payment processor.
      Returns:
      the approval code, or null if not approved
    • getCardholderName

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

      @Nullable public @Nullable String getPan()
      Returns the masked card number (PAN).
      Returns:
      the masked PAN (e.g., "411111******1111")
    • getIp

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

      @NotNull public @NotNull String getSuccessMessage()
      Returns a success message for confirmed payments.
      Returns:
      a human-readable success message
    • toString

      public String toString()
      Overrides:
      toString in class AbstractReply
    • fromJson

      @NotNull public static @NotNull OrderConfirmationReply fromJson(@NotNull @NotNull com.google.gson.JsonObject json)
      Creates an OrderConfirmationReply from a JSON response.
      Parameters:
      json - the JSON response from the API
      Returns:
      a new OrderConfirmationReply instance