RisePay-Java -- Simple Risepay Payment API wrapper
You can request developer credentials from our Dev Portal.
If you would like to certify your application, then submit a Cert Lab request.
To utilize this class, Risepay.java into your project, and require it. create a new instance of the class.
RisePay risepay = new RisePay("gatewayApiUser","userPassword");To make a purchase using a credit card:
Functional API:
RisePay risepay = new RisePay("demo","demo");
Map<String, Object> data = new HashMap<String, Object>();
data.put("NameOnCard", "Jhonn");
data.put("CardNum", "5149612222222229");
data.put("ExpDate", "1214");
data.put("Amount", 10);
data.put("CVNum", "678");
Map<String, Object> resp = risepay.sale(data);
if((boolean)resp.get("Approved")){
System.out.println("Approved. Transaction ID = " + resp.get("PNRef"));
System.out.println("AuthCode = " + resp.get("AuthCode"));
}else{
System.out.println("Declined: "+ resp.get("Message"));
}Object API:
RisePay risepay = new RisePay("demo","demo");
Map<String, Object> data = new HashMap<String, Object>();
data.put("NameOnCard", "Jhonn");
data.put("CardNum", "5149612222222229");
data.put("ExpDate", "1214");
data.put("Amount", 10);
data.put("CVNum", "678");
Map<String, Object> resp = risepay.sale(data);
.......To make an authorization using a credit card:
Functional API:
RisePay risepay = new RisePay("demo","demo");
Map<String, Object> data = new HashMap<String, Object>();
data.put("NameOnCard", "Jhonn");
data.put("CardNum", "5149612222222229");
data.put("ExpDate", "1214");
data.put("Amount", 10);
data.put("CVNum", "678");
Map<String, Object> resp = risepay.auth(data);
if((boolean)resp.get("Approved")){
System.out.println("Approved. Transaction ID = " + resp.get("PNRef"));
System.out.println("AuthCode = " + resp.get("AuthCode"));
}else{
System.out.println("Declined: "+ resp.get("Message"));
} To void a transaction:
Functional API:
RisePay risepay = new RisePay("demo","demo");
Map<String, Object> data = new HashMap<String, Object>();
data.put("NameOnCard", "Jhonn");
data.put("CardNum", "5149612222222229");
data.put("ExpDate", "1214");
data.put("Amount", 10);
data.put("CVNum", "678");
data.put("PNRef", 1106169);
Map<String, Object> resp = risepay.Void(data);
if((boolean)resp.get("Approved")){
System.out.println("Approved. Transaction ID = " + resp.get("PNRef"));
System.out.println("AuthCode = " + resp.get("AuthCode"));
}else{
System.out.println("Declined: "+ resp.get("Message"));
} To capture a previously Authorized transaction:
Functional API:
RisePay risepay = new RisePay("demo","demo");
Map<String, Object> data = new HashMap<String, Object>();
data.put("NameOnCard", "Jhonn");
data.put("CardNum", "5149612222222229");
data.put("ExpDate", "1214");
data.put("Amount", 10);
data.put("CVNum", "678");
data.put("PNRef", 1106169);
Map<String, Object> resp = risepay.capture(data);
if((boolean)resp.get("Approved")){
System.out.println("Approved. Transaction ID = " + resp.get("PNRef"));
System.out.println("AuthCode = " + resp.get("AuthCode"));
}else{
System.out.println("Declined: "+ resp.get("Message"));
}To return a payment for already batched transaction:
Functional API:
RisePay risepay = new RisePay("demo","demo");
Map<String, Object> data = new HashMap<String, Object>();
data.put("NameOnCard", "Jhonn");
data.put("CardNum", "5149612222222229");
data.put("ExpDate", "1214");
data.put("Amount", 10);
data.put("CVNum", "678");
data.put("PNRef", 1106169);
Map<String, Object> resp = risepay.Return(data);
if((boolean)resp.get("Approved")){
System.out.println("Approved. Transaction ID = " + resp.get("PNRef"));
System.out.println("AuthCode = " + resp.get("AuthCode"));
}else{
System.out.println("Declined: "+ resp.get("Message"));
}To see complete list of RisePay API variables, review our online documentation.
You can request developer credentials from our Dev Portal. If you would like to certify your application, then submit a Cert Lab request.