Class PaymentReply

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

public class PaymentReply extends AbstractReply
Response from the payment registration endpoint.

Contains the order ID and payment URL that the customer should be redirected to.

Example usage:


 api.registerPayment()
     .amount(100000)
     .returnUrl("https://example.com/callback")
     .execute()
     .thenAccept(reply -> {
         if (reply.isSuccessful()) {
             String orderId = reply.getOrderId();
             String paymentUrl = reply.getPaymentUrl();
             // Redirect user to paymentUrl
         }
     });
 
See Also:
  • Method Details

    • getOrderId

      @Nullable public @Nullable String getOrderId()
      Returns the order ID assigned by SATIM.

      This ID should be stored and used for subsequent operations like confirming, checking status, or refunding.

      Returns:
      the order ID, or null if registration failed
    • getPaymentUrl

      @Nullable public @Nullable String getPaymentUrl()
      Returns the payment URL where the customer should be redirected.

      This URL displays the Satim payment form.

      Returns:
      the payment URL, or null if registration failed
    • getUrl

      @Nullable public @Nullable String getUrl()
      Alias for getPaymentUrl() to match PHP library naming.
      Returns:
      the payment URL
    • getFormUrl

      @Nullable public @Nullable String getFormUrl()
      Alias for getPaymentUrl() to match Satim API naming.
      Returns:
      the payment URL
    • toString

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

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