Package com.github.hsnghrld.idpay
Class IDPay
- java.lang.Object
-
- com.github.hsnghrld.idpay.IDPay
-
public class IDPay extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringAPI_VERSIONstatic StringBASE_URL
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CreatePaymentResultcreatePayment(@NotNull String order_id, @NotNull Integer amount, @NotNull String callback)Create a new paymentCreatePaymentResultcreatePayment(@NotNull String order_id, @NotNull Integer amount, @NotNull String callback, String name, String phone, String mail, String desc)Create a new paymentGetListOfTransactionsResultgetListOfTransactions(Integer page, Integer page_size, TransactionFilter filter)Get your list of transactionsTransactioninquiryPayment(@NotNull String id, @NotNull String order_id)Inquire about the latest payment statusTransactionverifyPayment(@NotNull String id, @NotNull String order_id)After receiving the information on the acceptor's site and validating the information by the acceptor, the acceptor must confirm the transaction to complete the payment systematically and prevent the return of money to the payer
-
-
-
Field Detail
-
BASE_URL
public static final String BASE_URL
- See Also:
- Constant Field Values
-
API_VERSION
public static final String API_VERSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
createPayment
public CreatePaymentResult createPayment(@NotNull @NotNull String order_id, @NotNull @NotNull Integer amount, @NotNull @NotNull String callback) throws ValidationException, NetworkException, ApiException
Create a new payment- Parameters:
order_id- Acceptor order number (required, it's Up to 50 characters long)amount- Desired amount in Rials (required, it must be between 1,000 Rials to 500,000,000 Rials)callback- URL of comeback to site (required, it's Up to 2048 characters long)- Returns:
- response as an instance of
CreatePaymentResult - Throws:
ValidationException- when there is problem in input parametersNetworkException- when network error occurredApiException- when api respond with error
-
createPayment
public CreatePaymentResult createPayment(@NotNull @NotNull String order_id, @NotNull @NotNull Integer amount, @NotNull @NotNull String callback, String name, String phone, String mail, String desc) throws ValidationException, NetworkException, ApiException
Create a new payment- Parameters:
order_id- Acceptor order number (required, it's Up to 50 characters long)amount- Desired amount in Rials (required, it must be between 1,000 Rials to 500,000,000 Rials)callback- URL of comeback to site (required, it's Up to 2048 characters long)name- Name of payer (optional, it's Up to 255 characters long)phone- Payer's mobile number (optional, it must be like 9382198592 or 09382198592 or 989382198592)mail- Payer's email (optional, it's Up to 255 characters long)desc- Transaction explanation (optional, it's Up to 255 characters long)- Throws:
ValidationException- when there is problem in input parametersNetworkException- when network error occurredApiException- when api respond with error
-
verifyPayment
public Transaction verifyPayment(@NotNull @NotNull String id, @NotNull @NotNull String order_id) throws ValidationException, NetworkException, ApiException
After receiving the information on the acceptor's site and validating the information by the acceptor, the acceptor must confirm the transaction to complete the payment systematically and prevent the return of money to the payer- Parameters:
id- Unique transaction key received at thecreatePayment(java.lang.String, java.lang.Integer, java.lang.String)order_id- Recipient's order number sent at thecreatePayment(java.lang.String, java.lang.Integer, java.lang.String)- Returns:
- response as an instance of
Transaction - Throws:
ValidationException- when there is problem in input parametersNetworkException- when network error occurredApiException- when api respond with error
-
inquiryPayment
public Transaction inquiryPayment(@NotNull @NotNull String id, @NotNull @NotNull String order_id) throws ValidationException, NetworkException, ApiException
Inquire about the latest payment status- Parameters:
id- Unique transaction key received at thecreatePayment(java.lang.String, java.lang.Integer, java.lang.String)order_id- Recipient's order number sent at thecreatePayment(java.lang.String, java.lang.Integer, java.lang.String)- Returns:
- response as an instance of
Transaction - Throws:
ValidationException- when there is problem in input parametersNetworkException- when network error occurredApiException- when api respond with error
-
getListOfTransactions
public GetListOfTransactionsResult getListOfTransactions(Integer page, Integer page_size, TransactionFilter filter) throws NetworkException, ApiException
Get your list of transactions- Parameters:
page- The Page number that starts with 0 and it is 0 by defaultpage_size- The number of records received per page that by default is the last 25 transactionsfilter- Optional transaction filter- Returns:
- response as an instance of
Transaction - Throws:
NetworkException- when network error occurredApiException- when api respond with error
-
-