CreateTxnToken
Returns a token which will be used in further frontend payment calls.
createTxnToken(paymentDetails)
Returns a token which will be used in further frontend payment calls.
createTxnToken(paymentDetails)
EChannelId channelId = EChannelId.WEB;
String orderId = "UNIQUE_ORDER_ID";
Money txnAmount = new Money(EnumCurrency.INR, "1.00");
UserInfo userInfo = new UserInfo();
userInfo.setCustId("CUSTOMER_ID");
PaymentDetail paymentDetails = new PaymentDetail.PaymentDetailBuilder
(channelId, orderId, txnAmount, userInfo).build();
SDKResponse<InitiateTransactionResponse> response = Payment.createTxnToken(paymentDetails);
ATTRIBUTE | Description |
---|---|
PaymentDetail | Consists of all payment attributes like channelId, orderId, txnAmount, etc. |
ATTRIBUTE | DESCRIPTION |
---|---|
SDKResponse | Consists of InitiateTransactionResponse object and raw JSON response string. |
Returns the payment status
getPaymentStatus(paymentStatusDetail)
String orderId = "YOUR_ORDER_ID";
Time readTimeout = new Time(5, TimeUnit.MINUTES);
PaymentStatusDetail paymentStatusDetail = new PaymentStatusDetail.PaymentStatusDetailBuilder(orderId).setReadTimeout(readTimeout).build();
SDKResponse<NativePaymentStatusResponse> response = Payment.getPaymentStatus(paymentStatusDetail);
Note: Read timeout should be in milliseconds.
ATTRIBUTE | Description |
---|---|
Consists of payment status attribute like orderId. |
ATTRIBUTE | Description |
---|---|
Consists of NativePaymentStatusResponse object and raw json response string. |
Initiates the Refund
initiateRefund(refundDetail)
String orderId = "UNIQUE_ORDER_ID";
String refId = "REFERENCE_ID";
String txnId = "TRANSACTION_ID";
String txnType = "REFUND";
String refundAmount = "1";
Time readTimeout = new Time(5, TimeUnit.MINUTES);
RefundDetail refundDetail = new RefundDetail.RefundDetailBuilder(orderId, refId, txnId, txnType,refundAmount).setReadTimeout(readTimeout).build();
SDKResponse<AsyncRefundResponse>response = Refund.initiateRefund(refundDetail);
ATTRIBUTE | DESCRIPTION |
---|---|
RefundDetail | Consists of all refund attributes like orderId, refId, txnType, refundAmount, etc. |
ATTRIBUTE | DESCRIPTION |
---|---|
SDKResponse | Consists of AsyncRefundResponse object and raw json response string. |
Returns the Refund status
getRefundStatus(refundStatusDetail)
String orderId = "ORDER_ID";
String refId = "REFERENCE_ID";
Time readTimeout = new Time(5, TimeUnit.MINUTES);
RefundStatusDetail refundStatusDetail = new RefundStatusDetail.RefundStatusDetailBuilder(orderId, refId)
.setReadTimeout(readTimeout).build();
SDKResponse<NativeRefundStatusResponse> response = Refund.getRefundStatus(refundStatusDetail);
ATTRIBUTE | DESCRIPTION |
---|---|
RefundStatusDetail | Consists of all refund status attributes like orderId, refId, etc. |
ATTRIBUTE | DESCRIPTION |
---|---|
SDKResponse | Response having NativeRefundStatusResponse object. |