Rave-Java-Library facilitates quick and easy development and integration of Java based applications with the Flutterwave API.
- Contributors: Theresa Sogunle, Oluwole Adebiyi (KingFlamez)
- Tags: rave, flutterwave, payment gateway, bank account, credit card, debit card, nigeria, kenya, ghana, international, mastercard, visa, KES, GHC, NGN, Java.
Signup for a test account here
Signup for a live account here
<dependency>
<groupId>com.github.theresasogunle</groupId>
<artifactId>Rave</artifactId>
<version>1.0.1</version>
<type>jar</type>
</dependency>
Visit Bintray
- Download latest Rave-Java-Library jar file from here
On Netbeans IDE:
Project properties -> Libraries -> Compile -> ADD JAR/folder -> Add Jar
On Intelli J IDEA:
File > Project Structure -> Project Settings > Modules > Dependencies > "+" sign > JARs or directories
- Set to go πͺ
- Simple Card Charge
import com.rave.*;
import org.json.JSONObject;
public class Main {
public static void main(String[] args) throws Exception {
RaveConstant.PUBLIC_KEY="FLWPUBK-8ba286388b24dbd6c20706def0b4ea23-X";
RaveConstant.SECRET_KEY="FLWSECK-c45e0f704619e673263844e584bba013-X";
RaveConstant.ENVIRONMENT=Environment.STAGING; //or live
CardCharge ch = new CardCharge();
ch.setCardno("4187427415564246")
.setCvv("828")
.setAmount("3000")
.setExpiryyear("19")
.setExpirymonth("09")
.setEmail("[email protected]")
.setTxRef("MXX-ASC-4578")
.setSuggested_auth("PIN")
.setPin("3310");
JSONObject charge= ch.chargeMasterAndVerveCard();
System.out.println(charge);
}
}
- Rave Card Charge
import com.rave.*;
import org.json.JSONObject;
public class Main {
public static void main(String[] args)throws JSONException {
//rave constants
RaveConstant.PUBLIC_KEY="FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X";
RaveConstant.SECRET_KEY="FLWSECK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X";
RaveConstant.ENVIRONMENT=Environment.STAGING; //or live
CardCharge ch=new CardCharge();
ch.setCardno("4187427415564246")
.setCvv("828")
.setCurrency("NGN")
.setCountry("NG")
.setAmount("9000")
.setExpiryyear("19")
.setExpirymonth("09")
.setEmail("[email protected]")
.setIP("103.238.105.185")
.setTxRef("MXX-ASC-4578")
.setDevice_fingerprint("69e6b7f0sb72037aa8428b70fbe03986c");
//for master card and verve
ch.setPin("3310")
.setSuggested_auth("PIN");
JSONObject charge= ch.chargeMasterAndVerveCard();
//if timeout
JSONObject poll=ch.chargeMasterAndVerveCard(true);
//for visa and intl cards
ch.setRedirect_url("http://www.google.com");
JSONObject chargevisa=ch.chargeVisaAndIntl();
//if timeout, poll
JSONObject pollvisa=ch.chargeVisaAndIntl(true);
}
}
- Rave Account Charge
import com.rave.AccountCharge;
import com.rave.Encryption;
import org.json.JSONObject;
public class Main {
public static void main(String[] args) throws JSONException{
//rave constants
RaveConstant.PUBLIC_KEY="FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X";
RaveConstant.SECRET_KEY="FLWSECK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X";
RaveConstant.ENVIRONMENT=Environment.STAGING; //or live
AccountCharge ch= new AccountCharge();
ch.setAccountnumber("0690000031")
.setAccountbank("044")
.setAmount("1000")
.setCountry("NG")
.setCurrency("NGN")
.setLastname("Theresa")
.setIP("1.3.4.4")
.setPayment_type("account")
.setTxRef("MX-678DH")
.setEmail("[email protected]");
JSONObject result=ch.chargeAccount();
//polling
JSONObject poll=ch.chargeAccount(true);
System.out.println(result);
//Validate The Charge
//do not forget to set your fields
ch.setTransaction_reference("ACHG-1520028650995")
.setOtp("12345");
//for polling
JSONObject val=ch.validateAccountCharge(true);
//without polling
JSONObject validate=ch.validateAccountCharge());
}
}
The documentation for each classes and methods
- AccountCharge
- AlternatePayment
- Bank
- CardCharge
- Encryption
- ExchangeRates
- Fees
- PreAuthorization
- Refund
- Transaction
- IntegrityChecksum
- Recurring Payments
The MIT License (MIT). Please see License File for more information.