Package com.akraml.satim.reply
Class PaymentReply
java.lang.Object
com.akraml.satim.reply.AbstractReply
com.akraml.satim.reply.PaymentReply
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 Summary
Modifier and TypeMethodDescriptionstatic @NotNull PaymentReplyfromJson(@NotNull com.google.gson.JsonObject json) Creates a PaymentReply from a JSON response.@Nullable StringAlias forgetPaymentUrl()to match Satim API naming.@Nullable StringReturns the order ID assigned by SATIM.@Nullable StringReturns the payment URL where the customer should be redirected.@Nullable StringgetUrl()Alias forgetPaymentUrl()to match PHP library naming.toString()Methods inherited from class com.akraml.satim.reply.AbstractReply
getErrorCode, getErrorMessage, getRawResponse, getResponse, isSuccessful
-
Method Details
-
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
nullif registration failed
-
getPaymentUrl
Returns the payment URL where the customer should be redirected.This URL displays the Satim payment form.
- Returns:
- the payment URL, or
nullif registration failed
-
getUrl
Alias forgetPaymentUrl()to match PHP library naming.- Returns:
- the payment URL
-
getFormUrl
Alias forgetPaymentUrl()to match Satim API naming.- Returns:
- the payment URL
-
toString
- Overrides:
toStringin classAbstractReply
-
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
-