Class RefundReply

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

public class RefundReply extends AbstractReply
Response from the refund or reverse endpoint.

Contains the result of a refund or reversal request.

Example usage:


 // Full refund
 api.refundPayment(orderId)
     .thenAccept(reply -> {
         if (reply.isSuccessful()) {
             System.out.println("Refund processed successfully");
         } else {
             System.out.println("Refund failed: " + reply.getErrorMessage());
         }
     });

 // Partial refund
 api.refundPayment(orderId, 50000) // Refund 500 DZD
     .thenAccept(reply -> {
         // Handle response
     });
 
See Also:
  • Method Details

    • toString

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

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