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
Skip this installation if you want to use maven, gradle or ivy
- Download latest Rave-Java-Library jar file from the releases tab
- Install it and the other needed library dependencies which are contained in the
lib.zip
in the releases tab
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
- Add a file to your root folder as
env.json
which will contain yourpublic key
,secret key
andenvironment
{
"API_KEYS": {
"ENV": "LIVE",
"PUBLIC_KEY": "FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X",
"SECRET_KEY": "FLWSECK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"
}
}
-
ENV
- EitherLIVE
orSTAGING
-
PUBLIC_KEY
- Gotten From Your Rave Dashboard -
SECRET_KEY
- Gotten From Your Rave Dashboard -
Set to go 💪
mvn install
to build
<dependencies>
<dependency>
<groupId>com.github.theresasogunle</groupId>
<artifactId>Rave</artifactId>
<version>1.0</version>
<type>pom</type>
</dependency>
</dependencies>
repositories {
maven {
url "https://dl.bintray.com/theresasogunle/Rave"
}
}
<dependency org='com.github.theresasogunle' name='Rave' rev='1.0'>
<artifact name='Rave' ext='pom' ></artifact>
</dependency>
Visit https://bintray.com/theresasogunle/Rave/Rave for more info
- Getting the list of banks from Flutterwave
import com.rave.Bank;
public class Main {
public static void main(String[] args) {
// Create a bank Object
Bank B = new Bank();
// Print all banks with getAllBanks() method
System.out.println(B.getAllBanks());
}
}
- Rave Card Charge
import com.rave.Encryption;
import org.json.JSONObject;
public class Main {
public static void main(String[] args)throws JSONException {
CardCharge ch=new CardCharge();
ch.setCardno("4187427415564246")
.setCvv("828")
.setCurrency("NGN")
.setCountry("NG")
.setAmount("9000")
.setExpiryyear("19")
.setExpirymonth("09")
.setEmail("sogunledolapo@gmail.com")
.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{
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("sogunledolapo@gmail.com");
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
- FOR GTB display
*737*50*amount*159#
and return flwRef for the customer so as to complete the transaction
- Use webhooks to get notified on transaction, and set it to pending, then complete/failed once notified with same status on webhook. - - Webhooks? See guide on using webhooks here: https://flutterwavedevelopers.readme.io/v2.0/docs/events-webhooks
- After getting the notofication, requery to confirm final status
- Use webhooks to get notified on transaction, and set it to pending, then complete/failed once notified with same status on webhook.
- Webhooks? See guide on using webhooks here: https://flutterwavedevelopers.readme.io/v2.0/docs/events-webhooks
- After getting the notofication, requery to confirm final status
-Display the Mpesa Buisness account number 637747
and the Account number which is returned as orderRef in the charge response.
- Use webhooks to get notified on transaction, and set it to pending, then complete/failed once notified with same status on webhook. - - Webhooks? See guide on using webhooks here: https://flutterwavedevelopers.readme.io/v2.0/docs/events-webhooks -After getting the notofication, requery to confirm final status
- Recurring Payments
The MIT License (MIT). Please see License File for more information.