You can use the APIs below to interface with DANA's PaymentGatewayApi. To start using the API, you need to destruct instantiated DANA client. This client would be a singleton object that you can use across various api and operation.
import id.dana.invoker.Dana;
import id.dana.paymentgateway.v1.api.PaymentGatewayApi;
public class Example {
public static void main(String[] args) {
PaymentGatewayApi api = Dana.getInstance().getPaymentGatewayApi();
}
}
All URIs are relative to https://api.saas.dana.id, except if the operation defines another base path (For sandbox it is http://api.sandbox.dana.id).
| Method |
HTTP request |
Description |
| cancelOrder |
POST payment-gateway/v1.0/debit/cancel.htm |
This API is used to cancel the order from merchant's platform to DANA |
| consultPay |
POST v1.0/payment-gateway/consult-pay.htm |
This API is used to consult the list of payment methods or payment channels that user has and used in certain transactions or orders |
| createOrder |
POST payment-gateway/v1.0/debit/payment-host-to-host.htm |
This API is used for merchant to create order in DANA side |
| queryPayment |
POST payment-gateway/v1.0/debit/status.htm |
This API is used to inquiry payment status and information from merchant's platform to DANA |
| refundOrder |
POST payment-gateway/v1.0/debit/refund.htm |
This API is used to refund the order from merchant's platform to DANA |
import id.dana.invoker.Dana;
import id.dana.paymentgateway.v1.api.PaymentGatewayApi;
import id.dana.paymentgateway.v1.model.CancelOrderRequest;
import id.dana.paymentgateway.v1.model.CancelOrderResponse;
public class Example {
public static void main(String[] args) {
PaymentGatewayApi api = Dana.getInstance().getPaymentGatewayApi();
CancelOrderRequest cancelOrderRequest = new CancelOrderRequest();
try {
CancelOrderResponse response = api.cancelOrder(cancelOrderRequest);
System.out.println(response);
} catch (DanaException e) {
e.printStackTrace();
}
}
}
import id.dana.invoker.Dana;
import id.dana.paymentgateway.v1.api.PaymentGatewayApi;
import id.dana.paymentgateway.v1.model.ConsultPayRequest;
import id.dana.paymentgateway.v1.model.ConsultPayResponse;
public class Example {
public static void main(String[] args) {
PaymentGatewayApi api = Dana.getInstance().getPaymentGatewayApi();
ConsultPayRequest consultPayRequest = new ConsultPayRequest();
try {
ConsultPayResponse response = api.consultPay(consultPayRequest);
System.out.println(response);
} catch (DanaException e) {
e.printStackTrace();
}
}
}
import id.dana.invoker.Dana;
import id.dana.paymentgateway.v1.api.PaymentGatewayApi;
import id.dana.paymentgateway.v1.model.CreateOrderRequest;
import id.dana.paymentgateway.v1.model.CreateOrderResponse;
public class Example {
public static void main(String[] args) {
PaymentGatewayApi api = Dana.getInstance().getPaymentGatewayApi();
CreateOrderRequest createOrderRequest = new CreateOrderRequest();
try {
CreateOrderResponse response = api.createOrder(createOrderRequest);
System.out.println(response);
} catch (DanaException e) {
e.printStackTrace();
}
}
}
import id.dana.invoker.Dana;
import id.dana.paymentgateway.v1.api.PaymentGatewayApi;
import id.dana.paymentgateway.v1.model.QueryPaymentRequest;
import id.dana.paymentgateway.v1.model.QueryPaymentResponse;
public class Example {
public static void main(String[] args) {
PaymentGatewayApi api = Dana.getInstance().getPaymentGatewayApi();
QueryPaymentRequest queryPaymentRequest = new QueryPaymentRequest();
try {
QueryPaymentResponse response = api.queryPayment(queryPaymentRequest);
System.out.println(response);
} catch (DanaException e) {
e.printStackTrace();
}
}
}
import id.dana.invoker.Dana;
import id.dana.paymentgateway.v1.api.PaymentGatewayApi;
import id.dana.paymentgateway.v1.model.RefundOrderRequest;
import id.dana.paymentgateway.v1.model.RefundOrderResponse;
public class Example {
public static void main(String[] args) {
PaymentGatewayApi api = Dana.getInstance().getPaymentGatewayApi();
RefundOrderRequest refundOrderRequest = new RefundOrderRequest();
try {
RefundOrderResponse response = api.refundOrder(refundOrderRequest);
System.out.println(response);
} catch (DanaException e) {
e.printStackTrace();
}
}
}