├── .gitignore ├── Documentation ├── ACCOUNT.md ├── ALTPAYMENT.md ├── BANK.md ├── CARD.md ├── CHECKSUM.md ├── ENCRYPTION.md ├── EXCHANGERATES.md ├── FEES.md ├── PREAUTH.md ├── REFUND.md └── TRANSACTION.md ├── LICENSE.md ├── README.md ├── pom.xml ├── src └── main │ └── java │ └── com │ └── github │ └── theresasogunle │ ├── AccountCharge.java │ ├── AlternativePayment.java │ ├── ApiConnection.java │ ├── ApiQuery.java │ ├── Bank.java │ ├── CardCharge.java │ ├── Charge.java │ ├── Encryption.java │ ├── Endpoints.java │ ├── Environment.java │ ├── ExchangeRates.java │ ├── Fees.java │ ├── IntegrityChecksum.java │ ├── Polling.java │ ├── PreAuthorization.java │ ├── RaveConstant.java │ ├── Refund.java │ └── Transaction.java └── target ├── Rave-1.0.1-jar-with-dependencies.jar ├── Rave-1.0.1-jar-with-dependencies.jar.asc ├── Rave-1.0.1-javadoc.jar ├── Rave-1.0.1-javadoc.jar.asc ├── Rave-1.0.1-sources.jar ├── Rave-1.0.1-sources.jar.asc ├── Rave-1.0.1.jar ├── Rave-1.0.1.jar.asc ├── Rave-1.0.1.pom ├── Rave-1.0.1.pom.asc ├── classes ├── .netbeans_automatic_build └── com │ └── github │ └── theresasogunle │ ├── AccountCharge.class │ ├── AlternativePayment.class │ ├── ApiConnection.class │ ├── ApiQuery.class │ ├── Bank.class │ ├── CardCharge.class │ ├── Charge.class │ ├── Encryption.class │ ├── Endpoints.class │ ├── Environment.class │ ├── ExchangeRates.class │ ├── Fees.class │ ├── IntegrityChecksum.class │ ├── Polling.class │ ├── PreAuthorization.class │ ├── RaveConstant.class │ ├── Refund.class │ └── Transaction.class ├── jacoco.exec ├── javadoc-bundle-options ├── javadoc-options-javadoc-resources.xml └── package-list ├── maven-archiver └── pom.properties └── test-classes └── .netbeans_automatic_build /.gitignore: -------------------------------------------------------------------------------- 1 | /dist 2 | /build 3 | build.xml 4 | /nbproject 5 | .classpath 6 | .project 7 | /.settings 8 | /bin -------------------------------------------------------------------------------- /Documentation/ACCOUNT.md: -------------------------------------------------------------------------------- 1 | ## Account Charge 2 | 3 | ### Class Name - AccountCharge 4 | 5 | 6 | #### Chaining Methods 7 | >setAccountnumber("0690000031") `Set the customers account number` 8 | >setAccountbank("044") `Set the bank shortcode` 9 | >setCurrency("NGN") `Set the currency (defaults to NGN) (Optional)` 10 | >setCountry("NG") `Set the country (defaults to Nigeria) (Optional)` 11 | >setAmount("1000") `Set the amount` 12 | >setEmail("flamekeed@gmail.com") `Set the customers email` 13 | >setPhonenumber("08020000000") `Set the customers phone number` 14 | >setFirstname("Oluwole") `Set the customers first name` 15 | >setLastname("Adebiyi") `Set the customers last name` 16 | >setIP("127.0.0.0") `Set the IP address` 17 | >setTxRef("CA-GHHH-KLJH1234") `Set the txref` 18 | >setDevice_fingerprint("GFHGJGU$#%$RGUHU_setTransaction_reference("ACHG-1520028650995") `This is the unique reference/ flwRef, unique to the particular transaction being carried out. It is generated for every transaction. This can be retrieved from the account charge response` 20 | >setOtp("12345") `set the customers otp` 21 | 22 | #### Methods 23 | 1. chargeAccount() 24 | 25 | This charges the clients account 26 | 27 | returns `JSONObject` 28 | 29 | 2. chargeAccount(boolean polling) 30 | 31 | pooling=true 32 | 33 | This charges client account when theres timeout. 34 | 35 | **Parameters** 36 | 37 | 38 | returns `JSONObject` 39 | 40 | 3. validateAccountCharge() 41 | 42 | 43 | This validates account charge 44 | 45 | returns `JSONObject` 46 | 47 | 3. validateAccountCharge(boolean polling) 48 | 49 | pooling=true 50 | 51 | This validates account charge when theres timeout. 52 | 53 | returns `JSONObject` 54 | 55 | 56 | 57 | #### Sample 58 | 59 | - To use this method you have to encrypt first and pass the encrypted message in the paremter 60 | 61 | ```java 62 | 63 | 64 | 65 | 66 | //account charge parameters 67 | 68 | 69 | AccountCharge ch=new AccountCharge(); 70 | RaveConstant.PUBLIC_KEY="FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 71 | RaveConstant.SECRET_KEY="FLWSECK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 72 | RaveConstant.ENVIRONMENT=Environment.STAGING; //or live 73 | 74 | ch.setAccountnumber("0690000031") 75 | .setAccountbank("044") 76 | .setAmount("1000") 77 | .setCountry("NG") 78 | .setCurrency("NGN") 79 | .setLastname("Theresa") 80 | .setIP("1.3.4.4") 81 | .setPayment_type("account") 82 | .setTxRef("MX-678DH") 83 | .setEmail("sogunledolapo@gmail.com"); 84 | 85 | 86 | //charge account normally 87 | JSONObject result=ch.chargeAccount(); 88 | 89 | //polling 90 | JSONObject poll=ch.chargeAccount(true); 91 | 92 | //validate 93 | ch.setTransaction_reference("ACHG-1520028650995"); 94 | .setOtp("12345"); 95 | 96 | JSONObject val=ch.validateAccountCharge(); 97 | //for polling 98 | JSONObject val=ch.validateAccountCharge(true); 99 | 100 | System.out.println(val); 101 | 102 | ``` 103 | 104 | -------------------------------------------------------------------------------- /Documentation/ALTPAYMENT.md: -------------------------------------------------------------------------------- 1 | ## Alternative Payment 2 | 3 | ### Class Name - AlternativePayment 4 | 5 | 6 | #### Chaining Methods 7 | 8 | >setAccountnumber("0690000031") `Set the customers account number` 9 | >setAccountbank("044") `Set the bank shortcode` 10 | >setCurrency("NGN") `Set the currency (defaults to NGN) (Optional)` 11 | >setCountry("NG") `Set the country (defaults to Nigeria) (Optional)` 12 | >setAmount("1000") `Set the amount` 13 | >setEmail("flamekeed@gmail.com") `Set the customers email` 14 | >setPhonenumber("08020000000") `Set the customers phone number` 15 | >setFirstname("Oluwole") `Set the customers first name` 16 | >setLastname("Adebiyi") `Set the customers last name` 17 | >setPin("3310") `Set The customers pin` 18 | >setIP("127.0.0.0") `Set the IP address` 19 | >setTxRef("CA-GHHH-KLJH1234") `Set the txref` 20 | >setOrderRef("CA-GHHH-KLJH1234") `Unique ref for the mpesa transaction to be provided by the merchant.` 21 | >setNetwork("MTN") `This is the customer's mobile money network provider.` 22 | >setFlwRef("FLW-MOCK-d310263f5f73e51d01e6dab32c893679") `This is the payment gateway's unique reference.` 23 | 24 | 25 | #### Methods 26 | 1.chargeKenyaMpesa () 27 | 28 | This charges charge customers using Kenya Mpesa 29 | 30 | returns `JSONObject` 31 | 32 | 2. chargeGhanaMobileMoney() 33 | 34 | This charges charge customers using Ghana mobile money 35 | 36 | returns `JSONObject` 37 | 38 | 3. chargeNigerianUssd() 39 | 40 | This charges charge customers using nigerian USSD for GTB and Zenith Bank 41 | 42 | returns `JSONObject` 43 | 44 | 45 | #### Sample 46 | 47 | - To use this method you have to encrypt first and pass the encrypted message in the paremter 48 | 49 | ```java 50 | public static void main(String [] args) throws JSONException{ 51 | //rave constants 52 | RaveConstant.PUBLIC_KEY="FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 53 | RaveConstant.SECRET_KEY="FLWSECK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 54 | RaveConstant.ENVIRONMENT=Environment.STAGING; 55 | //for Nigerian ussd 56 | //card charge 57 | JSONObject api=new JSONObject(); 58 | Encryption encryption=new Encryption(); 59 | AlternativePayment ch=new AlternativePayment(); 60 | ch.setAccountnumber("0690000004") 61 | .setAccountbank("044") 62 | .setCurrency("NGN") 63 | .setCountry("NG") 64 | .setAmount("6000") 65 | .setFirstname("pin") 66 | .setLastname("pin") 67 | .setPin("3310") 68 | .setEmail("sogunledolapo@gmail.com") 69 | .setIP("103.238.105.185") 70 | .setTxRef("MXX-ASC-4578"); 71 | 72 | 73 | JSONObject chargeussd=ch.chargeNigerianUssd(); 74 | System.out.println(chargeussd); 75 | 76 | //for ghana mobile money 77 | 78 | payload.setOrderRef("0690000") 79 | .setNetwork("MTN") 80 | .setCurrency("GHS") 81 | .setCountry("GH") 82 | .setAmount("4000") 83 | .setFirstname("pin") 84 | .setLastname("pin") 85 | .setPin("3310") 86 | .setEmail("sogunledolapo@gmail.com") 87 | .setIP("103.238.105.185") 88 | .setTxRef("MXX-90-49578") 89 | .setPhonenumber("08020000000"); 90 | 91 | JSONObject chargegh=ch.chargeGhanaMobileMoney(); 92 | 93 | //for kenya mpesa 94 | 95 | payload.setCurrency("KES") 96 | .setCountry("KE") 97 | .setAmount("6000") 98 | .setFirstname("pin") 99 | .setLastname("pin") 100 | .setPin("3310") 101 | .setEmail("sogunledolapo@gmail.com") 102 | .setIP("103.238.105.185") 103 | .setTxRef("MXX-ASC-4578") 104 | .setOrderRef("y77yy") 105 | .setPhonenumber("0903672978"); 106 | 107 | JSONObject chargempesa=ch.chargeKenyaMpesa(); 108 | 109 | //complete transaction 110 | Transaction t=new Transaction(); 111 | t.setFlwref("FLW-MOCK-d310263f5f73e51d01e6dab32c893679"); 112 | .setTxRef(""); 113 | JSONObject response= t.verifyTransactionRequery(); 114 | JSONObject response= t.verifyTransactionXrequery(); 115 | 116 | // System.out.println(charge); 117 | 118 | 119 | } 120 | ``` 121 | -------------------------------------------------------------------------------- /Documentation/BANK.md: -------------------------------------------------------------------------------- 1 | ## Bank 2 | 3 | ### Class Name - Bank 4 | 5 | #### Methods 6 | 1. getAllBanks() 7 | 8 | This method provides a list of banks that can be charged on rave. It returns a key/value pair internetbanking in the response, if set to false it means the account can be charged using the direct account method, if set to true it means the account would be charged using the internet banking flow 9 | 10 | returns `JsonNode` 11 | 12 | #### Sample 13 | 14 | ```java 15 | 16 | RaveConstant.ENVIRONMENT=Environment.STAGING; 17 | Bank b= new Bank(); 18 | System.out.println(b.getAllBanks()); 19 | ``` 20 | 21 | -------------------------------------------------------------------------------- /Documentation/CARD.md: -------------------------------------------------------------------------------- 1 | ## Card Charge 2 | 3 | ### Class Name - CardCharge 4 | 5 | 6 | #### Chaining Methods 7 | >setCardno("4187427415564246") `set the card number` 8 | >setCvv("828") `Set the CVV` 9 | >setExpirymonth("09") `set the expiry month` 10 | >setExpiryyear("19") `set the expiry year` 11 | >setCurrency("NGN") `Set the currency (defaults to NGN) (Optional)` 12 | >setCountry("NG") `Set the country (defaults to Nigeria) (Optional)` 13 | >setPin("3310") `Set The customers pin` 14 | >setSuggested_auth("PIN") `sets the suggested auth` 15 | >setAmount("1000") `Set the amount` 16 | >setEmail("flamekeed@gmail.com") `Set the customers email` 17 | >setPhonenumber("08020000000") `Set the customers phone number` 18 | >setFirstname("Oluwole") `Set the customers first name` 19 | >setLastname("Adebiyi") `Set the customers last name` 20 | >setIP("127.0.0.0") `Set the IP address` 21 | >setTxRef("CA-GHHH-KLJH1234") `Set the txref` 22 | >setRedirect_url("http://www.google.com") `Set the redirect url` 23 | >setDevice_fingerprint("GFHGJGU$#%$RGUHU_setCharge_type("preauth") `sets the charge type` 25 | >setTransaction_reference("ACHG-1520028650995") `This is the unique reference/ flwRef, unique to the particular transaction being carried out. It is generated for every transaction. This can be retrieved from the account charge response` 26 | >setOtp("12345") `set the customers otp` 27 | 28 | #### Methods 29 | 30 | 1. chargeMasterAndVerveCard() 31 | 32 | This charges the clients using mastercard and verve cards 33 | 34 | 35 | returns `JSONObject` 36 | 37 | 2. chargeMasterAndVerveCard(boolean polling) 38 | 39 | This charges the clients using mastercard and verve cards when there is timeout 40 | 41 | 42 | returns `JSONObject` 43 | 44 | 3. chargeVisaAndIntl() 45 | 46 | This charges the clients using local visa cards and intl cards 47 | 48 | 49 | returns `JSONObject` 50 | 51 | 4. chargeVisaAndIntl(boolean polling) 52 | 53 | This charges the clients using local visa cards and intl cards when there is timeout 54 | 55 | 56 | returns `JSONObject` 57 | 58 | 5. validateCardChargeVB() 59 | 60 | This validates card charge for visa cards and intl cards 61 | 62 | returns `JSONObject` 63 | 64 | 6. validateCardCharge(boolean polling) 65 | 66 | This validates card charge for mastercards and verve cards when there is timeout 67 | 68 | returns `JSONObject` 69 | 70 | 7. validateCardCharge() 71 | 72 | This validates card charge for mastercards and verve cards 73 | 74 | returns `JSONObject` 75 | 76 | 77 | #### Sample 78 | 79 | - To use this method you have to set the fields needed and the charge accordingly 80 | ```java 81 | RaveConstant.PUBLIC_KEY="FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 82 | RaveConstant.SECRET_KEY="FLWSECK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 83 | RaveConstant.ENVIRONMENT=Environment.STAGING; //or live 84 | 85 | CardCharge payload=new CardCharge(); 86 | payload.setCardno("4187427415564246") 87 | .setCvv("828") 88 | .setCurrency("NGN") 89 | .setCountry("NG") 90 | .setAmount("9000") 91 | .setExpiryyear("19") 92 | .setExpirymonth("09") 93 | .setEmail("sogunledolapo@gmail.com") 94 | .setIP("103.238.105.185") 95 | .setTxRef("MXX-ASC-4578") 96 | .setDevice_fingerprint("69e6b7f0sb72037aa8428b70fbe03986c"); 97 | 98 | 99 | //for master card and verve 100 | payload.setPin("3310") 101 | .setSuggested_auth("PIN"); 102 | JSONObject charge= ch.chargeMasterAndVerveCard(); 103 | //if timeout 104 | JSONObject poll=ch.chargeMasterAndVerveCard(true); 105 | 106 | //for visa and intl cards 107 | payload.setRedirect_url("http://www.google.com"); 108 | JSONObject chargevisa=payload.chargeVisaAndIntl(); 109 | //if timeout, poll 110 | JSONObject pollvisa=payload.chargeVisaAndIntl(true); 111 | 112 | //validate 113 | payload.setOtp("12345") 114 | .setTransaction_reference("FLW-MOCK-75dd012dc6c6b58807d69d0e89432e9f"); 115 | 116 | JSONObject validateCharge=payload.validateCardCharge(); 117 | //if timeout, poll 118 | JSONObject validatepoll=payload.validateCardCharge(true); 119 | 120 | payload.setAuthUrl(""); 121 | payload.validateCardChargeVB(); 122 | 123 | ``` 124 | 125 | -------------------------------------------------------------------------------- /Documentation/CHECKSUM.md: -------------------------------------------------------------------------------- 1 | ## IntegrityChecksum 2 | 3 | ### Class Name - IntegrityChecksum 4 | 5 | #### Method 6 | 1. integrityChecksum(HashMap payload) 7 | - returns `String`(hashed) 8 | #### Note see (https://flutterwavedevelopers.readme.io/docs/checksum). 9 | 10 | 11 | #### Sample 12 | 13 | ```java 14 | RaveConstant.PUBLIC_KEY="FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 15 | RaveConstant.SECRET_KEY="FLWSECK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 16 | RaveConstant.ENVIRONMENT=Environment.STAGING; //or live 17 | 18 | IntegrityChecksum ch=new IntegrityChecksum(); 19 | 20 | ch.setAmount("20") 21 | .setPayment_method("both") 22 | .setCustom_description("Pay Internet") 23 | .setCustom_logo("http://localhost/payporte-3/skin/frontend/ultimo/shoppy/custom/images/logo.svg") 24 | .setCountry("NG") 25 | .setCurrency("NGN") 26 | .setCustomer_email( "user@example.com") 27 | .setCustomer_firstname("Temi") 28 | .setCustomer_lastname("Adelewa") 29 | .setCustomer_phone("234099940409") 30 | .setTxref("MG-CKSKKHH"); 31 | 32 | 33 | String hash= ch.integrityChecksum(); 34 | 35 | 36 | ``` 37 | 38 | -------------------------------------------------------------------------------- /Documentation/ENCRYPTION.md: -------------------------------------------------------------------------------- 1 | ## Encryption 2 | 3 | ### Class Name - Encryption 4 | 5 | #### Methods 6 | 1. encryptParameters(JSONObject params) 7 | 8 | This is used for encryption of parameters 9 | 10 | **Parameters** 11 | 12 | >params - This is the parameters we need to encrypt, accepts JSONObject 13 | 14 | returns `String` 15 | 16 | 2. encryptParametersPreAuth(JSONObject params) 17 | 18 | This encrypts pre auth parameters 19 | 20 | **Parameters** 21 | 22 | >params - This is the parameters we need to encrypt, accepts JSONObject 23 | 24 | returns `String` 25 | 26 | 27 | 28 | 29 | #### Sample 30 | 31 | - To use this method you have to encrypt first and pass the encrypted message in the paremter 32 | 33 | ```java 34 | JSONObject api=new JSONObject(); 35 | Encryption encryption=new Encryption(); 36 | RaveConstant.PUBLIC_KEY="FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 37 | RaveConstant.SECRET_KEY="FLWSECK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 38 | RaveConstant.ENVIRONMENT=Environment.STAGING; //or live 39 | //card charge 40 | try{ 41 | api.put("accountnumber", "0690000004"); 42 | api.put("accountbank", "044"); 43 | api.put("currency", "NGN"); 44 | api.put("country", "NG"); 45 | api.put("amount", "6000"); 46 | api.put("firstname", "pin"); 47 | api.put("lastname", "pin"); 48 | api.put("pin", "3310"); 49 | api.put("email", "flamekeed@gmail.com"); 50 | api.put("IP", "103.238.105.185"); 51 | api.put("txRef", "MXX-ASC-4578"); 52 | api.put("payment_type", "account"); 53 | 54 | }catch(Exception ex){} 55 | String encrypted_message= encryption.encryptParameters(api); 56 | 57 | ``` 58 | 59 | -------------------------------------------------------------------------------- /Documentation/EXCHANGERATES.md: -------------------------------------------------------------------------------- 1 | ## ExchangeRates 2 | 3 | ### Class Name - ExchangeRates 4 | 5 | #### Fields 6 | >origin_currency - This is the currency to convert from 7 | 8 | >destination_currency - This is the currency to convert from 9 | 10 | >amount - This is the currency to convert to 11 | 12 | #### Method 13 | 1. forex() 14 | 15 | This endpoint provides a list of banks that can be charged on rave. It returns a key/value pair internetbanking in the response, if set to false it means the account can be charged using the direct account method, if set to true it means the account would be charged using the internet banking flow 16 | 17 | >origin_currency - This is the currency to convert from 18 | >destination_currency - This is the currency to convert from 19 | >amount - This is the currency to convert to 20 | 21 | returns `JsonNode` 22 | 23 | #### Sample 24 | 25 | ```java 26 | RaveConstant.PUBLIC_KEY="FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 27 | RaveConstant.SECRET_KEY="FLWSECK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 28 | RaveConstant.ENVIRONMENT=Environment.STAGING; //or live 29 | 30 | ExchangeRates e=new ExchangeRates(); 31 | e.setAmount("500") 32 | .setDestination_currency("USD") 33 | .setOrigin_currency("NGN"); 34 | System.out.println(e.forex()); 35 | 36 | 37 | ``` 38 | 39 | -------------------------------------------------------------------------------- /Documentation/FEES.md: -------------------------------------------------------------------------------- 1 | ## Fees 2 | 3 | ### Class Name - Fees 4 | 5 | 6 | #### Fields 7 | >currency - This is the specified currency to charge the card in. 8 | 9 | >amount - This is the amount of the product or service to charged from the customer 10 | 11 | >card6 - The first 6digits of their card number, it also helps determine international fees on the transaction if the card being used is an international card 12 | 13 | #### Methods 14 | 1. getFees() 15 | 16 | 17 | >currency - This is the specified currency to charge the card in. 18 | 19 | >amount - This is the amount of the product or service to charged from the customer 20 | 21 | returns `JSONObject` 22 | 23 | 24 | 2. getFeesForCard6() 25 | 26 | >currency - This is the specified currency to charge the card in. 27 | 28 | >amount - This is the amount of the product or service to charged from the customer 29 | 30 | >card6 - The first 6digits of their card number, it also helps determine international fees on the transaction if the card being used is an international card 31 | 32 | returns `JSONObject` 33 | 34 | #### The successful response for get fees endpoint is broken down this way: 35 | 36 | `data.charge_amount:` This the total amount to be charged, total amount = amount + fee 37 | 38 | `data.fee:` This is a cumulative of the merchantfee (if applicable) + ravefee 39 | 40 | `data.merchantfee:` This is the merchant fee on the transaction, it is applicable when using a subdomain. Subdomains allow you white-label rave, and offer it as a customised service to your merchant, we allow you set a markup fee on it and earn transaction fees. In this scenario the merchant-fee would be the subdomain markup fee if applicable. 41 | 42 | `data.ravefee:` This is the fee charged per transaction by rave. 43 | 44 | 45 | #### Sample 46 | 47 | ```java 48 | RaveConstant.PUBLIC_KEY="FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 49 | RaveConstant.SECRET_KEY="FLWSECK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 50 | RaveConstant.ENVIRONMENT=Environment.STAGING; //or live 51 | Fees fee=new Fees(); 52 | //set field values 53 | fee.setAmount("500") 54 | .setCard6("829222") 55 | .setCurrency("NGN"); 56 | 57 | 58 | System.out.println(fee.getFees()); 59 | System.out.println(fee.getFeesForCard6()); 60 | 61 | ``` 62 | 63 | -------------------------------------------------------------------------------- /Documentation/PREAUTH.md: -------------------------------------------------------------------------------- 1 | ## PreAuthorization 2 | 3 | ### Class Name - Fees 4 | 5 | 6 | #### Fields 7 | <<<<<<< HEAD 8 | >cardno 9 | >cvv 10 | >expirymonth 11 | >expiryyear 12 | >currency 13 | >country 14 | >pin 15 | >suggested_auth 16 | >amount 17 | >email 18 | >phonenumber 19 | >firstname 20 | >lastname 21 | >IP 22 | >txRef 23 | >redirect_url 24 | >device_fingerprint 25 | >charge_type 26 | >flwRef(ref) - This is the payment gateway's unique reference. 27 | >action - This is the action to be taken i.e. `refund` or `void` 28 | ======= 29 | >flwRef(ref) - This is the payment gateway's unique reference. 30 | 31 | >action - This is the action to be taken i.e. `refund` or `void` 32 | >>>>>>> 669b00a4d1f8550273617d15dbd518dbc8477d31 33 | #### Methods 34 | 1. preAuthorizeCard() 35 | 36 | 37 | 38 | returns `JSONObject` 39 | 40 | 2. capture() 41 | >flwRef - This is the payment gateway's unique reference. 42 | 43 | returns `JSONObject` 44 | 45 | 46 | 3. refundOrVoid() 47 | 48 | >ref - This is the `flwRef` returned in the `capture response.` 49 | 50 | >action - This is the action to be taken i.e. `refund` or `void` 51 | 52 | 53 | #### Sample 54 | 55 | ```java 56 | RaveConstant.PUBLIC_KEY="FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 57 | RaveConstant.SECRET_KEY="FLWSECK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 58 | RaveConstant.ENVIRONMENT=Environment.STAGING; //or live 59 | 60 | PreAuthorization ch=new PreAuthorization(); 61 | 62 | //card charge 63 | ch.setCardno("5438898014560229") 64 | .setCharge_type("preauth") 65 | .setCvv("812") 66 | .setExpirymonth("08") 67 | .setExpiryyear("20") 68 | .setCurrency("NGN") 69 | .setCountry("NG") 70 | .setAmount("100") 71 | .setEmail("user@example.com") 72 | .setPhonenumber("08056552980") 73 | .setFirstname("user") 74 | .setLastname("example") 75 | .setIP("40.198.14") 76 | .setTxRef("MXX-ASC-4578") 77 | .setRedirect_url("https://rave-web.herokuapp.com/receivepayment") 78 | .setDevice_fingerprint("69e6b7f0b72037aa8428b70fbe03986c"); 79 | 80 | 81 | 82 | JSONObject response=ch.preAuthorizeCard(); 83 | 84 | 85 | ch.setFlwref("FLW-MOCK-d310263f5f73e51d01e6dab32c893679") 86 | .setAction("refund"); 87 | 88 | JSONObject capture= ch.capture(); 89 | JSONObject refund= ch.refundOrVoid(); 90 | 91 | ``` 92 | 93 | -------------------------------------------------------------------------------- /Documentation/REFUND.md: -------------------------------------------------------------------------------- 1 | ## Refund 2 | 3 | ### Class Name - Refund 4 | 5 | #### Fields 6 | >ref - This is the flwRef returned in the charge response 7 | 8 | 9 | #### Methods 10 | 1. refund() 11 | 12 | This method allows you initiate refunds for Successful transactions 13 | 14 | **Parameters** 15 | 16 | >ref - This is the flwRef returned in the charge response 17 | 18 | returns `JSONObject` 19 | 20 | 21 | 22 | #### Sample 23 | 24 | ```java 25 | RaveConstant.PUBLIC_KEY="FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 26 | RaveConstant.SECRET_KEY="FLWSECK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 27 | RaveConstant.ENVIRONMENT=Environment.STAGING; //or live 28 | Refund rf=new Refund(); 29 | 30 | rf.setRef("FLW-MOCK-dcd2cd407f37649b04eb1342247e0bf6"); 31 | 32 | System.out.println(rf.refund()); 33 | 34 | ``` 35 | 36 | -------------------------------------------------------------------------------- /Documentation/TRANSACTION.md: -------------------------------------------------------------------------------- 1 | ## Transaction 2 | 3 | ### Class Name - Transaction 4 | 5 | #### Fields 6 | >flw_ref - This is the `flwRef` returned in the `charge response` 7 | >txref 8 | 9 | #### Methods 10 | 1. verifyTransactionRequery() 11 | 12 | This method allows you to verify transactions 13 | 14 | **Parameters** 15 | 16 | >flw_ref - This is the `flwRef` returned in the `charge response` 17 | 18 | returns `JSONObject` 19 | 20 | 21 | 2. verifyTransactionXrequery() 22 | 23 | This method allows you to verify transactions using your own transaction reference or the flwref 24 | 25 | #### Sample 26 | 27 | ```java 28 | RaveConstant.PUBLIC_KEY="FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 29 | RaveConstant.SECRET_KEY="FLWSECK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 30 | RaveConstant.ENVIRONMENT=Environment.STAGING; //or live 31 | 32 | Transaction t=new Transaction(); 33 | 34 | t.setFlwref("FLW-MOCK-d310263f5f73e51d01e6dab32c893679") 35 | .setTxRef(""); 36 | JSONObject response= t.verifyTransactionRequery(); 37 | JSONObject tt= t.verifyTransactionXrequery(); 38 | 39 | System.out.println(tt); 40 | ``` 41 | 42 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | 2 | # The MIT License (MIT) 3 | Copyright (c) 2018 Sogunle Theresa 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Coverage Status](https://coveralls.io/repos/github/theresasogunle/Rave-Java-Library/badge.svg)](https://coveralls.io/github/theresasogunle/Rave-Java-Library) 2 | [![Maintainability](https://api.codeclimate.com/v1/badges/540ffe707c495f483166/maintainability)](https://codeclimate.com/github/theresasogunle/Rave-Java-Library/maintainability) 3 | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/theresasogunle/Rave-Java-Library/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/theresasogunle/Rave-Java-Library/?branch=master) 4 | 5 | # Flutterwave Rave (Rave-Java-Library) 6 | Rave-Java-Library facilitates quick and easy development and integration of Java based applications with the Flutterwave API. 7 | 8 | - **Contributors:** **Theresa Sogunle**, Oluwole Adebiyi (KingFlamez) 9 | - **Tags:** rave, flutterwave, payment gateway, bank account, credit card, debit card, nigeria, kenya, ghana, international, mastercard, visa, KES, GHC, NGN, Java. 10 | 11 | # Getting Started 12 | 13 | ## Prerequisite 14 | > Signup for a test account [here](http://rave.frontendpwc.com/) 15 | 16 | > Signup for a live account [here](https://rave.flutterwave.com) 17 | 18 | ## Installation (Jar file) 19 | 20 | ### Maven 21 | 22 | ```bash 23 | 24 | com.github.theresasogunle 25 | Rave 26 | 1.0.1 27 | jar 28 | 29 | ``` 30 | 31 | Visit [Bintray](https://bintray.com/theresasogunle/Rave/Rave) 32 | 33 | ### Jar 34 | 35 | - Download latest Rave-Java-Library jar file from [here](https://github.com/theresasogunle/Rave-Java-Library/releases/latest) 36 | 37 | ### How to Install `Jar` Libraries 38 | >On Netbeans IDE: `Project properties -> Libraries -> Compile -> ADD JAR/folder -> Add Jar` 39 | 40 | >On Intelli J IDEA: `File > Project Structure -> Project Settings > Modules > Dependencies > "+" sign > JARs or directories` 41 | 42 | - Set to go 💪 43 | 44 | ## Sample Use 45 | 46 | - Simple Card Charge 47 | 48 | ```java 49 | import com.rave.*; 50 | import org.json.JSONObject; 51 | 52 | 53 | public class Main { 54 | 55 | public static void main(String[] args) throws Exception { 56 | 57 | RaveConstant.PUBLIC_KEY="FLWPUBK-8ba286388b24dbd6c20706def0b4ea23-X"; 58 | RaveConstant.SECRET_KEY="FLWSECK-c45e0f704619e673263844e584bba013-X"; 59 | RaveConstant.ENVIRONMENT=Environment.STAGING; //or live 60 | 61 | 62 | CardCharge ch = new CardCharge(); 63 | 64 | ch.setCardno("4187427415564246") 65 | .setCvv("828") 66 | .setAmount("3000") 67 | .setExpiryyear("19") 68 | .setExpirymonth("09") 69 | .setEmail("flamekeed@gmail.com") 70 | .setTxRef("MXX-ASC-4578") 71 | .setSuggested_auth("PIN") 72 | .setPin("3310"); 73 | 74 | JSONObject charge= ch.chargeMasterAndVerveCard(); 75 | 76 | System.out.println(charge); 77 | } 78 | } 79 | ``` 80 | 81 | - Rave Card Charge 82 | ```java 83 | import com.rave.*; 84 | import org.json.JSONObject; 85 | 86 | public class Main { 87 | 88 | public static void main(String[] args)throws JSONException { 89 | //rave constants 90 | RaveConstant.PUBLIC_KEY="FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 91 | RaveConstant.SECRET_KEY="FLWSECK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 92 | RaveConstant.ENVIRONMENT=Environment.STAGING; //or live 93 | 94 | CardCharge ch=new CardCharge(); 95 | ch.setCardno("4187427415564246") 96 | .setCvv("828") 97 | .setCurrency("NGN") 98 | .setCountry("NG") 99 | .setAmount("9000") 100 | .setExpiryyear("19") 101 | .setExpirymonth("09") 102 | .setEmail("sogunledolapo@gmail.com") 103 | .setIP("103.238.105.185") 104 | .setTxRef("MXX-ASC-4578") 105 | .setDevice_fingerprint("69e6b7f0sb72037aa8428b70fbe03986c"); 106 | 107 | //for master card and verve 108 | 109 | ch.setPin("3310") 110 | .setSuggested_auth("PIN"); 111 | JSONObject charge= ch.chargeMasterAndVerveCard(); 112 | //if timeout 113 | JSONObject poll=ch.chargeMasterAndVerveCard(true); 114 | 115 | 116 | //for visa and intl cards 117 | ch.setRedirect_url("http://www.google.com"); 118 | JSONObject chargevisa=ch.chargeVisaAndIntl(); 119 | //if timeout, poll 120 | JSONObject pollvisa=ch.chargeVisaAndIntl(true); 121 | 122 | } 123 | } 124 | ``` 125 | 126 | - Rave Account Charge 127 | ```java 128 | import com.rave.AccountCharge; 129 | import com.rave.Encryption; 130 | import org.json.JSONObject; 131 | 132 | public class Main { 133 | 134 | public static void main(String[] args) throws JSONException{ 135 | //rave constants 136 | RaveConstant.PUBLIC_KEY="FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 137 | RaveConstant.SECRET_KEY="FLWSECK-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X"; 138 | RaveConstant.ENVIRONMENT=Environment.STAGING; //or live 139 | 140 | 141 | AccountCharge ch= new AccountCharge(); 142 | 143 | ch.setAccountnumber("0690000031") 144 | .setAccountbank("044") 145 | .setAmount("1000") 146 | .setCountry("NG") 147 | .setCurrency("NGN") 148 | .setLastname("Theresa") 149 | .setIP("1.3.4.4") 150 | .setPayment_type("account") 151 | .setTxRef("MX-678DH") 152 | .setEmail("sogunledolapo@gmail.com"); 153 | 154 | JSONObject result=ch.chargeAccount(); 155 | //polling 156 | JSONObject poll=ch.chargeAccount(true); 157 | System.out.println(result); 158 | //Validate The Charge 159 | //do not forget to set your fields 160 | ch.setTransaction_reference("ACHG-1520028650995") 161 | .setOtp("12345"); 162 | //for polling 163 | JSONObject val=ch.validateAccountCharge(true); 164 | //without polling 165 | JSONObject validate=ch.validateAccountCharge()); 166 | } 167 | } 168 | 169 | ``` 170 | 171 | ## Test Implementation 172 | 173 | 174 | 175 | 176 | 177 | 178 | ## Classes and Methods 179 | 180 | The documentation for each classes and methods 181 | 182 | 1. [AccountCharge](Documentation/ACCOUNT.md) 183 | 2. [AlternatePayment](Documentation/ALTPAYMENT.md) 184 | 3. [Bank](Documentation/BANK.md) 185 | 4. [CardCharge](Documentation/CARD.md) 186 | 5. [Encryption](Documentation/ENCRYPTION.md) 187 | 6. [ExchangeRates](Documentation/EXCHANGERATES.md) 188 | 7. [Fees](Documentation/FEES.md) 189 | 8. [PreAuthorization](Documentation/PREAUTH.md) 190 | 9. [Refund](Documentation/REFUND.md) 191 | 10. [Transaction](Documentation/REFUND.md) 192 | 11. [IntegrityChecksum](Documentation/CHECKSUM.md) 193 | 194 | 195 | ## Todo 196 | 197 | - Recurring Payments 198 | 199 | ## License 200 | 201 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information. 202 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | com.github.theresasogunle 5 | Rave 6 | 1.0.1 7 | jar 8 | Rave 9 | 10 | UTF-8 11 | 1.7 12 | 1.7 13 | 14 | A rave java library 15 | 16 | com.github.theresasogunle 17 | https://github.com/theresasogunle/Rave-Java 18 | 19 | 20 | 21 | 22 | bintray-theresasogunle-Rave 23 | theresasogunle-Rave 24 | https://api.bintray.com/maven/theresasogunle/Rave/Rave/;publish=1 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | org.apache.maven.plugins 33 | maven-compiler-plugin 34 | 2.3.2 35 | 36 | 1.8 37 | 1.8 38 | 39 | 40 | 41 | maven-assembly-plugin 42 | 2.3 43 | 44 | 45 | jar-with-dependencies 46 | 47 | 48 | 49 | 50 | package 51 | 52 | single 53 | 54 | 55 | 56 | 57 | 58 | org.apache.maven.plugins 59 | maven-source-plugin 60 | 2.1.2 61 | 62 | 63 | attach-sources 64 | 65 | jar 66 | 67 | 68 | 69 | 70 | 71 | 72 | org.apache.maven.plugins 73 | maven-gpg-plugin 74 | 75 | 76 | sign-artifacts 77 | verify 78 | 79 | sign 80 | 81 | 82 | 83 | 84 | 85 | org.apache.maven.plugins 86 | maven-release-plugin 87 | 2.4.2 88 | 89 | 90 | 91 | org.sonarsource.java 92 | sonar-java-plugin 93 | 4.4.0.8066 94 | 95 | 96 | 97 | org.apache.maven.plugins 98 | maven-compiler-plugin 99 | 2.3.2 100 | 101 | 1.8 102 | 1.8 103 | 104 | 105 | 106 | maven-assembly-plugin 107 | 2.3 108 | 109 | 110 | jar-with-dependencies 111 | 112 | 113 | 114 | 115 | package 116 | 117 | single 118 | 119 | 120 | 121 | 122 | 123 | org.apache.maven.plugins 124 | maven-source-plugin 125 | 2.1.2 126 | 127 | 128 | attach-sources 129 | 130 | jar 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | org.jacoco 139 | jacoco-maven-plugin 140 | 0.7.4.201502262128 141 | 142 | 143 | jacoco-initialize 144 | 145 | prepare-agent 146 | 147 | 148 | 149 | 150 | jacoco-report 151 | 152 | 153 | report 154 | 155 | 156 | 157 | 158 | 159 | org.eluder.coveralls 160 | coveralls-maven-plugin 161 | 4.3.0 162 | 163 | dakvAtKl39YvqHlqpvkHQb26M7CZMEsNg 164 | 165 | 166 | 167 | org.apache.maven.plugins 168 | maven-javadoc-plugin 169 | 170 | true 171 | true 172 | true 173 | true 174 | true 175 | 176 | 177 | 178 | 179 | attach-javadocs 180 | 181 | jar 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | com.sun 195 | tools 196 | 1.8 197 | system 198 | C:\Program Files\Java\jdk1.8.0_11\lib\tools.jar 199 | 200 | 201 | commons-logging 202 | commons-logging 203 | 1.1.3 204 | 205 | 206 | 207 | org.apache.httpcomponents 208 | httpasyncclient 209 | 4.0.2 210 | 211 | 212 | 213 | org.apache.httpcomponents 214 | httpclient 215 | 4.3.2 216 | 217 | 218 | 219 | 220 | 221 | 222 | org.apache.httpcomponents 223 | httpcore 224 | 4.4.4 225 | 226 | 227 | 228 | org.apache.httpcomponents 229 | httpcore-nio 230 | 4.3-beta2 231 | 232 | 233 | 234 | org.apache.httpcomponents 235 | httpmime 236 | 4.3.6 237 | 238 | 239 | 240 | org.json 241 | json 242 | 20180130 243 | 244 | 245 | 246 | com.mashape.unirest 247 | unirest-java 248 | 1.4.9 249 | 250 | 251 | 252 | 253 | 254 | 255 | org.slf4j 256 | slf4j-api 257 | 1.7.7 258 | 259 | 260 | 261 | ch.qos.logback 262 | logback-core 263 | 1.1.3 264 | 265 | 266 | 267 | ch.qos.logback 268 | logback-classic 269 | 1.1.3 270 | 271 | 272 | 273 | 274 | junit 275 | junit 276 | 4.12 277 | 278 | 279 | 280 | net.sourceforge.cobertura 281 | cobertura 282 | 2.1.1 283 | test 284 | 285 | 286 | 287 | net.minidev 288 | json-smart 289 | 2.2 290 | 291 | 292 | 293 | com.jayway.jsonpath 294 | json-path 295 | 2.4.0 296 | 297 | 298 | 299 | org.skyscreamer 300 | jsonassert 301 | 1.2.3 302 | 303 | 304 | 305 | 306 | org.hamcrest 307 | hamcrest-core 308 | 1.3 309 | 310 | 311 | 312 | 313 | commons-codec 314 | commons-codec 315 | 1.6 316 | 317 | 318 | 319 | 320 | -------------------------------------------------------------------------------- /src/main/java/com/github/theresasogunle/AccountCharge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.github.theresasogunle; 7 | 8 | 9 | 10 | 11 | import static com.github.theresasogunle.Encryption.encryptData; 12 | import org.json.JSONException; 13 | 14 | import org.json.JSONObject; 15 | 16 | 17 | 18 | 19 | /** 20 | * 21 | * @author Theresa 22 | */ 23 | public class AccountCharge { 24 | 25 | Encryption e=new Encryption(); 26 | 27 | private String accountnumber,accountbank,currency,country, 28 | amount,email,phonenumber,firstname,lastname,IP, 29 | txRef,passcode,device_fingerprint; 30 | 31 | private String transaction_reference;//to be called 32 | private String otp;//to be called 33 | 34 | public JSONObject setJSON() { 35 | JSONObject json=new JSONObject(); 36 | try{ 37 | json.put("PBFPubKey",RaveConstant.PUBLIC_KEY); 38 | json.put("accountnumber",this.getAccountnumber());//expected result' 39 | json.put("accountbank",this.getAccountbank()); 40 | json.put("currency", this.getCurrency()); 41 | json.put("country", this.getCountry()); 42 | json.put("amount", this.getAmount()); 43 | json.put("firstname", this.getFirstname()); 44 | json.put("lastname", this.getLastname()); 45 | json.put("passcode", this.getPasscode()); 46 | json.put("email", this.getEmail()); 47 | json.put("IP", this.getIP()); 48 | json.put("payment_type", "account"); 49 | json.put("txRef", this.getTxRef()); 50 | json.put("device_fingerprint", this.getDevice_fingerprint()); 51 | 52 | }catch( JSONException ex){ex.getMessage();} 53 | return json; 54 | } 55 | 56 | 57 | /** 58 | * 59 | 60 | * @return json 61 | */ 62 | 63 | public JSONObject chargeAccount() { 64 | 65 | JSONObject json=setJSON(); 66 | 67 | 68 | String message= json.toString(); 69 | 70 | String encrypt_secret_key=Encryption.getKey(RaveConstant.SECRET_KEY); 71 | String client= encryptData(message,encrypt_secret_key); 72 | 73 | Charge ch=new Charge(); 74 | 75 | return ch.charge(client); 76 | 77 | } 78 | public JSONObject chargeAccount(boolean polling) { 79 | 80 | JSONObject json=setJSON(); 81 | 82 | Polling p=new Polling(); 83 | 84 | return p.handleTimeoutCharge(json); 85 | 86 | } 87 | 88 | 89 | public JSONObject validateAccountCharge(){ 90 | Charge vcharge= new Charge(); 91 | return vcharge.validateAccountCharge(this.getTransaction_reference(), this.getOtp()); 92 | } 93 | 94 | 95 | public JSONObject validateAccountCharge(boolean polling){ 96 | Polling p=new Polling(); 97 | return p.validateAccountChargeTimeout(this.getTransaction_reference(),this.getOtp()); 98 | } 99 | 100 | /** 101 | * @return the accountnumber 102 | */ 103 | public String getAccountnumber() { 104 | return accountnumber; 105 | } 106 | 107 | /** 108 | * @param accountnumber the accountnumber to set 109 | * @return AccountCharge 110 | */ 111 | public AccountCharge setAccountnumber(String accountnumber) { 112 | this.accountnumber = accountnumber; 113 | return this; 114 | } 115 | 116 | /** 117 | * @return the accountbank 118 | */ 119 | public String getAccountbank() { 120 | return accountbank; 121 | } 122 | 123 | /** 124 | * @param accountbank the accountbank to set 125 | * @return AccountCharge 126 | */ 127 | public AccountCharge setAccountbank(String accountbank) { 128 | this.accountbank = accountbank; 129 | return this; 130 | } 131 | 132 | /** 133 | * @return the currency 134 | */ 135 | public String getCurrency() { 136 | return currency; 137 | } 138 | 139 | /** 140 | * @param currency the currency to set 141 | * @return AccountCharge 142 | */ 143 | public AccountCharge setCurrency(String currency) { 144 | this.currency = currency; 145 | return this; 146 | } 147 | 148 | /** 149 | * @return the country 150 | */ 151 | public String getCountry() { 152 | return country; 153 | } 154 | 155 | /** 156 | * @param country the country to set 157 | * @return AccountCharge 158 | */ 159 | public AccountCharge setCountry(String country) { 160 | this.country = country; 161 | return this; 162 | } 163 | 164 | /** 165 | * @return the amount 166 | */ 167 | public String getAmount() { 168 | return amount; 169 | } 170 | 171 | /** 172 | * @param amount the amount to set 173 | * @return AccountCharge 174 | */ 175 | public AccountCharge setAmount(String amount) { 176 | this.amount = amount; 177 | return this; 178 | } 179 | 180 | /** 181 | * @return the email 182 | */ 183 | public String getEmail() { 184 | return email; 185 | } 186 | 187 | /** 188 | * @param email the email to set 189 | * @return AccountCharge 190 | */ 191 | public AccountCharge setEmail(String email) { 192 | this.email = email; 193 | return this; 194 | } 195 | 196 | /** 197 | * @return the phonenumber 198 | */ 199 | public String getPhonenumber() { 200 | return phonenumber; 201 | } 202 | 203 | /** 204 | * @param phonenumber the phonenumber to set 205 | * @return AccountCharge 206 | */ 207 | public AccountCharge setPhonenumber(String phonenumber) { 208 | this.phonenumber = phonenumber; 209 | return this; 210 | } 211 | 212 | /** 213 | * @return the firstname 214 | * 215 | */ 216 | public String getFirstname() { 217 | return firstname; 218 | } 219 | 220 | /** 221 | * @param firstname the firstname to set 222 | * @return AccountCharge 223 | */ 224 | public AccountCharge setFirstname(String firstname) { 225 | this.firstname = firstname; 226 | return this; 227 | } 228 | 229 | /** 230 | * @return the lastname 231 | */ 232 | public String getLastname() { 233 | return lastname; 234 | } 235 | 236 | /** 237 | * @param lastname the lastname to set 238 | * @return AccountCharge 239 | */ 240 | public AccountCharge setLastname(String lastname) { 241 | this.lastname = lastname; 242 | return this; 243 | } 244 | 245 | /** 246 | * @return the IP 247 | */ 248 | public String getIP() { 249 | return IP; 250 | } 251 | 252 | /** 253 | * @param IP the IP to set 254 | * @return AccountCharge 255 | */ 256 | public AccountCharge setIP(String IP) { 257 | this.IP = IP; 258 | return this; 259 | } 260 | 261 | /** 262 | * @return the txRef 263 | */ 264 | public String getTxRef() { 265 | return txRef; 266 | } 267 | 268 | /** 269 | * @param txRef the txRef to set 270 | * @return AccountCharge 271 | */ 272 | public AccountCharge setTxRef(String txRef) { 273 | this.txRef = txRef; 274 | return this; 275 | } 276 | 277 | /** 278 | * @return the passcode 279 | */ 280 | public String getPasscode() { 281 | return passcode; 282 | } 283 | 284 | /** 285 | * @param passcode the passcode to set 286 | * @return AccountCharge 287 | */ 288 | public AccountCharge setPasscode(String passcode) { 289 | this.passcode = passcode; 290 | return this; 291 | } 292 | 293 | /** 294 | * @return the device_fingerprint 295 | */ 296 | public String getDevice_fingerprint() { 297 | return device_fingerprint; 298 | } 299 | 300 | /** 301 | * @param device_fingerprint the device_fingerprint to set 302 | * @return AccountCharge 303 | */ 304 | public AccountCharge setDevice_fingerprint(String device_fingerprint) { 305 | this.device_fingerprint = device_fingerprint; 306 | return this; 307 | } 308 | 309 | /** 310 | * @return the transaction_reference 311 | */ 312 | public String getTransaction_reference() { 313 | return transaction_reference; 314 | } 315 | 316 | /** 317 | * @param transaction_reference the transaction_reference to set 318 | * @return AccountCharge 319 | */ 320 | public AccountCharge setTransaction_reference(String transaction_reference) { 321 | this.transaction_reference = transaction_reference; 322 | return this; 323 | } 324 | 325 | /** 326 | * @return the otp 327 | */ 328 | public String getOtp() { 329 | return otp; 330 | } 331 | 332 | /** 333 | * @param otp the otp to set 334 | * @return AccountCharge 335 | */ 336 | public AccountCharge setOtp(String otp) { 337 | this.otp = otp; 338 | return this; 339 | } 340 | 341 | 342 | 343 | 344 | 345 | } 346 | -------------------------------------------------------------------------------- /src/main/java/com/github/theresasogunle/AlternativePayment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.github.theresasogunle; 7 | 8 | 9 | 10 | import static com.github.theresasogunle.Encryption.encryptData; 11 | import org.json.JSONException; 12 | import org.json.JSONObject; 13 | 14 | 15 | 16 | /** 17 | * 18 | * @author Theresa 19 | */ 20 | public class AlternativePayment { 21 | 22 | ApiConnection apiConnection; 23 | 24 | Encryption e=new Encryption(); 25 | 26 | 27 | private String accountnumber,accountbank,currency,country, 28 | amount,firstname,lastname, 29 | pin,email,IP,txRef,phonenumber,orderRef,network, 30 | flwRef; 31 | 32 | 33 | /** 34 | * 35 | * @throws JSONException it throws JSON exception 36 | * @return JSONObject 37 | */ 38 | 39 | // charge customers using nigerian USSD for GTB and Zenith Bank,Ghana mobile money and Kenya Mpesa 40 | 41 | public JSONObject chargeNigerianUssd () { 42 | //getting charge endpoint 43 | JSONObject json=new JSONObject(); 44 | try{ 45 | json.put("accountnumber", this.getAccountnumber()); 46 | json.put("accountbank", this.getAccountbank()); 47 | json.put("currency", this.getCurrency()); 48 | json.put("country", this.getCountry()); 49 | json.put("amount", this.getAmount()); 50 | json.put("firstname", this.getFirstname()); 51 | json.put("lastname", this.getLastname()); 52 | json.put("pin", this.getPin()); 53 | json.put("email", this.getEmail()); 54 | json.put("IP", this.getIP()); 55 | json.put("txRef", this.getTxRef()); 56 | json.put("payment_type", "ussd"); 57 | 58 | }catch(JSONException ex){ex.getMessage();} 59 | String message= json.toString(); 60 | 61 | String encrypt_secret_key=Encryption.getKey(RaveConstant.SECRET_KEY); 62 | String client= encryptData(message,encrypt_secret_key); 63 | 64 | Charge ch=new Charge(); 65 | 66 | return ch.charge(client); 67 | 68 | } 69 | /** 70 | * 71 | * @throws JSONException it throws JSON exception 72 | * @return JSONObject 73 | */ 74 | 75 | 76 | public JSONObject chargeGhanaMobileMoney () { 77 | //getting charge endpoint 78 | JSONObject json=new JSONObject(); 79 | try{ 80 | json.put("orderRef",this.getOrderRef()); 81 | json.put("network", this.getNetwork()); 82 | json.put("currency", this.getCurrency()); 83 | json.put("country", this.getCountry()); 84 | json.put("amount", this.getAmount()); 85 | json.put("firstname", this.getFirstname()); 86 | json.put("lastname", this.getLastname()); 87 | json.put("pin", this.getPin()); 88 | json.put("email", this.getEmail()); 89 | json.put("IP", this.getIP()); 90 | json.put("txRef", this.getTxRef()); 91 | json.put("payment_type", "mobilemoneygh"); 92 | json.put("is_mobile_money_gh", "1"); 93 | json.put("phonenumber",this.getPhonenumber()); 94 | }catch(JSONException ex){ex.getMessage();} 95 | String message= json.toString(); 96 | 97 | String encrypt_secret_key=Encryption.getKey(RaveConstant.SECRET_KEY); 98 | String client= encryptData(message,encrypt_secret_key); 99 | 100 | Charge ch=new Charge(); 101 | 102 | return ch.charge(client); 103 | 104 | } 105 | /** 106 | * 107 | * @throws JSONException it throws JSON exception 108 | * @return JSONObject 109 | */ 110 | 111 | public JSONObject chargeKenyaMpesa () { 112 | //getting charge endpoint 113 | JSONObject json=new JSONObject(); 114 | try{ 115 | json.put("currency", this.getCurrency()); 116 | json.put("country", this.getCountry()); 117 | json.put("amount", this.getAmount()); 118 | json.put("firstname", this.getFirstname()); 119 | json.put("lastname", this.getLastname()); 120 | json.put("pin", this.getPin()); 121 | json.put("email", this.getEmail()); 122 | json.put("IP", this.getIP()); 123 | json.put("txRef", this.getTxRef()); 124 | json.put("orderRef", this.getOrderRef()); 125 | json.put("phonenumber", this.getPhonenumber()); 126 | json.put("payment_type", "mpesa"); 127 | json.put("is_mpesa", "1"); 128 | }catch(JSONException ex){ex.getMessage();} 129 | String message= json.toString(); 130 | 131 | String encrypt_secret_key=Encryption.getKey(RaveConstant.SECRET_KEY); 132 | String client= encryptData(message,encrypt_secret_key); 133 | 134 | Charge ch=new Charge(); 135 | 136 | return ch.charge(client); 137 | 138 | } 139 | 140 | /** 141 | * 142 | * @param txref 143 | * @param flwref 144 | * @return JSONObject 145 | */ 146 | //to requery transaction for ghana mobile money,kenya mpesa and nigerian ussd using xquery 147 | 148 | /** 149 | * @return the accountnumber 150 | */ 151 | public String getAccountnumber() { 152 | return accountnumber; 153 | } 154 | 155 | /** 156 | * @param accountnumber the accountnumber to set 157 | * @return AlternativePayment 158 | */ 159 | public AlternativePayment setAccountnumber(String accountnumber) { 160 | this.accountnumber = accountnumber; 161 | return this; 162 | } 163 | 164 | /** 165 | * @return the accountbank 166 | */ 167 | public String getAccountbank() { 168 | return accountbank; 169 | } 170 | 171 | /** 172 | * @param accountbank the accountbank to set 173 | * @return AlternativePayment 174 | */ 175 | public AlternativePayment setAccountbank(String accountbank) { 176 | this.accountbank = accountbank; 177 | return this; 178 | } 179 | 180 | /** 181 | * @return the currency 182 | */ 183 | public String getCurrency() { 184 | return currency; 185 | } 186 | 187 | /** 188 | * @param currency the currency to set 189 | * @return AlternativePayment 190 | */ 191 | public AlternativePayment setCurrency(String currency) { 192 | this.currency = currency; 193 | return this; 194 | } 195 | 196 | /** 197 | * @return the country 198 | */ 199 | public String getCountry() { 200 | return country; 201 | } 202 | 203 | /** 204 | * @param country the country to set 205 | * @return AlternativePayment 206 | */ 207 | public AlternativePayment setCountry(String country) { 208 | this.country = country; 209 | return this; 210 | } 211 | 212 | /** 213 | * @return the amount 214 | */ 215 | public String getAmount() { 216 | return amount; 217 | } 218 | 219 | /** 220 | * @param amount the amount to set 221 | * @return AlternativePayment 222 | */ 223 | public AlternativePayment setAmount(String amount) { 224 | this.amount = amount; 225 | return this; 226 | } 227 | 228 | /** 229 | * @return the firstname 230 | */ 231 | public String getFirstname() { 232 | return firstname; 233 | } 234 | 235 | /** 236 | * @param firstname the firstname to set 237 | * @return AlternativePayment 238 | */ 239 | public AlternativePayment setFirstname(String firstname) { 240 | this.firstname = firstname; 241 | return this; 242 | } 243 | 244 | /** 245 | * @return the lastname 246 | */ 247 | public String getLastname() { 248 | return lastname; 249 | } 250 | 251 | /** 252 | * @param lastname the lastname to set 253 | * @return AlternativePayment 254 | */ 255 | public AlternativePayment setLastname(String lastname) { 256 | this.lastname = lastname; 257 | return this; 258 | } 259 | 260 | /** 261 | * @return the pin 262 | */ 263 | public String getPin() { 264 | return pin; 265 | } 266 | 267 | /** 268 | * @param pin the pin to set 269 | * @return AlternativePayment 270 | */ 271 | public AlternativePayment setPin(String pin) { 272 | this.pin = pin; 273 | return this; 274 | } 275 | 276 | /** 277 | * @return the email 278 | */ 279 | public String getEmail() { 280 | return email; 281 | } 282 | 283 | /** 284 | * @param email the email to set 285 | * @return AlternativePayment 286 | */ 287 | public AlternativePayment setEmail(String email) { 288 | this.email = email; 289 | return this; 290 | } 291 | 292 | /** 293 | * @return the IP 294 | */ 295 | public String getIP() { 296 | return IP; 297 | } 298 | 299 | /** 300 | * @param IP the IP to set 301 | * @return AlternativePayment 302 | */ 303 | public AlternativePayment setIP(String IP) { 304 | this.IP = IP; 305 | return this; 306 | } 307 | 308 | /** 309 | * @return the txRef 310 | */ 311 | public String getTxRef() { 312 | return txRef; 313 | } 314 | 315 | /** 316 | * @param txRef the txRef to set 317 | * @return AlternativePayment 318 | */ 319 | public AlternativePayment setTxRef(String txRef) { 320 | this.txRef = txRef; 321 | return this; 322 | } 323 | 324 | /** 325 | * @return the phonenumber 326 | */ 327 | public String getPhonenumber() { 328 | return phonenumber; 329 | } 330 | 331 | /** 332 | * @param phonenumber the phonenumber to set 333 | * @return AlternativePayment 334 | */ 335 | public AlternativePayment setPhonenumber(String phonenumber) { 336 | this.phonenumber = phonenumber; 337 | return this; 338 | } 339 | 340 | /** 341 | * @return the orderRef 342 | */ 343 | public String getOrderRef() { 344 | return orderRef; 345 | } 346 | 347 | /** 348 | * @param orderRef the orderRef to set 349 | * @return AlternativePayment 350 | */ 351 | public AlternativePayment setOrderRef(String orderRef) { 352 | this.orderRef = orderRef; 353 | return this; 354 | } 355 | 356 | /** 357 | * @return the network 358 | */ 359 | public String getNetwork() { 360 | return network; 361 | } 362 | 363 | /** 364 | * @param network the network to set 365 | * @return AlternativePayment 366 | */ 367 | public AlternativePayment setNetwork(String network) { 368 | this.network = network; 369 | return this; 370 | } 371 | 372 | /** 373 | * @return the flwRef 374 | */ 375 | public String getFlwRef() { 376 | return flwRef; 377 | } 378 | 379 | /** 380 | * @param flwRef the flwRef to set 381 | * @return AlternativePayment 382 | */ 383 | public AlternativePayment setFlwRef(String flwRef) { 384 | this.flwRef = flwRef; 385 | return this; 386 | } 387 | } 388 | -------------------------------------------------------------------------------- /src/main/java/com/github/theresasogunle/ApiConnection.java: -------------------------------------------------------------------------------- 1 | 2 | package com.github.theresasogunle; 3 | 4 | import com.mashape.unirest.http.HttpResponse; 5 | import com.mashape.unirest.http.JsonNode; 6 | import com.mashape.unirest.http.Unirest; 7 | import com.mashape.unirest.http.exceptions.UnirestException; 8 | import org.json.JSONObject; 9 | import java.security.KeyManagementException; 10 | import java.security.NoSuchAlgorithmException; 11 | import java.util.HashMap; 12 | import java.util.logging.Level; 13 | import java.util.logging.Logger; 14 | import javax.net.ssl.SSLContext; 15 | import org.apache.http.conn.ssl.SSLConnectionSocketFactory; 16 | import static org.apache.http.conn.ssl.SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER; 17 | import org.apache.http.conn.ssl.SSLContexts; 18 | import org.apache.http.impl.client.CloseableHttpClient; 19 | import org.apache.http.impl.client.HttpClients; 20 | 21 | 22 | 23 | /** 24 | * @author Theresa 25 | */ 26 | public class ApiConnection { 27 | 28 | final private String url; 29 | 30 | /** 31 | * @param url - Flutterwave API url 32 | */ 33 | public ApiConnection(String url) { 34 | this.url = url; 35 | this.enforceTlsV1point2(); 36 | } 37 | private void enforceTlsV1point2() { 38 | try { 39 | SSLContext sslContext = SSLContexts.custom() 40 | .useTLS() 41 | .build(); 42 | SSLConnectionSocketFactory f = new SSLConnectionSocketFactory( 43 | sslContext, 44 | new String[]{"TLSv1.2"}, 45 | null, 46 | BROWSER_COMPATIBLE_HOSTNAME_VERIFIER); 47 | CloseableHttpClient httpClient = HttpClients.custom() 48 | .setSSLSocketFactory(f) 49 | .build(); 50 | Unirest.setHttpClient(httpClient); 51 | 52 | } catch (NoSuchAlgorithmException | KeyManagementException ex) { 53 | Logger.getLogger(ApiConnection.class.getName()).log(Level.SEVERE, null, ex); 54 | } 55 | } 56 | 57 | 58 | /** 59 | * Connects to and queries Flutterwave API with POST 60 | * 61 | * @param query - APIQuery containing parameters to send 62 | * @return - JSONObject containing API response 63 | */ 64 | public JSONObject connectAndQuery(ApiQuery query) { 65 | try { 66 | HttpResponse queryForResponse = Unirest.post(url) 67 | .header("Accept", "application/json") 68 | .fields(query.getParams()) 69 | .asJson(); 70 | 71 | 72 | 73 | try{ 74 | return queryForResponse.getBody().getObject(); 75 | }catch(Exception ex){} 76 | } catch (UnirestException e) { 77 | } 78 | return null; 79 | } 80 | /** 81 | * Connects to and queries API with POST 82 | * 83 | * @param query - HashMap containing parameters to send 84 | * @return - JSONObject containing API response 85 | */ 86 | public JSONObject connectAndQuery(HashMap query) { 87 | try { 88 | HttpResponse queryForResponse = Unirest.post(url) 89 | .header("Accept", "application/json") 90 | 91 | .fields(query) 92 | .asJson(); 93 | return queryForResponse.getBody().getObject(); 94 | } catch (UnirestException e) { 95 | } 96 | return null; 97 | } 98 | 99 | /** 100 | * Used to send a GET request to the Flutterwave API 101 | * 102 | * @return - JSONObject containing the API response 103 | */ 104 | public JsonNode connectAndQueryWithGet() { 105 | try { 106 | HttpResponse queryForResponse = Unirest.get(url) 107 | .header("content-type", "application/json") 108 | 109 | .asJson(); 110 | 111 | return queryForResponse.getBody(); 112 | 113 | } catch (UnirestException e) { 114 | System.out.println("Cant query at this time!"); 115 | } 116 | return null; 117 | } 118 | 119 | 120 | } 121 | -------------------------------------------------------------------------------- /src/main/java/com/github/theresasogunle/ApiQuery.java: -------------------------------------------------------------------------------- 1 | package com.github.theresasogunle; 2 | 3 | import java.util.HashMap; 4 | 5 | 6 | public class ApiQuery { 7 | 8 | final private HashMap queryMap; 9 | 10 | /** 11 | * Initializes a new query map 12 | */ 13 | public ApiQuery() { 14 | this.queryMap = new HashMap<>(); 15 | } 16 | 17 | /** 18 | * Used to add a parameter to the query map 19 | * 20 | * @param key 21 | * @param value 22 | */ 23 | public void putParams(String key, Object value) { 24 | this.queryMap.put(key, value); 25 | } 26 | 27 | 28 | public HashMap getParams() { 29 | return this.queryMap; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/github/theresasogunle/Bank.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.github.theresasogunle; 7 | 8 | import com.mashape.unirest.http.JsonNode; 9 | 10 | 11 | /** 12 | * 13 | * @author Theresa 14 | */ 15 | public class Bank { 16 | private ApiConnection apiConnection; 17 | Endpoints ed= new Endpoints(); 18 | 19 | public JsonNode getAllBanks(){ 20 | this.apiConnection = new ApiConnection(ed.getBankEndPoint()); 21 | 22 | return this.apiConnection.connectAndQueryWithGet(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/github/theresasogunle/CardCharge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.github.theresasogunle; 7 | 8 | 9 | 10 | 11 | import static com.github.theresasogunle.Encryption.encryptData; 12 | import static com.github.theresasogunle.Encryption.getKey; 13 | import java.awt.Desktop; 14 | import java.io.IOException; 15 | import java.net.URI; 16 | import java.net.URISyntaxException; 17 | import org.json.JSONException; 18 | 19 | import org.json.JSONObject; 20 | 21 | /** 22 | * 23 | * @author Theresa 24 | */ 25 | public class CardCharge { 26 | JSONObject api=new JSONObject(); 27 | Endpoints ed=new Endpoints(); 28 | ApiConnection apiConnection; 29 | 30 | Encryption e=new Encryption(); 31 | private String cardno,cvv,expirymonth,expiryyear,currency,country,pin,suggested_auth, 32 | amount,email,phonenumber,firstname,lastname,txRef,redirect_url,device_fingerprint,IP, 33 | charge_type; 34 | 35 | private String transactionreference,otp, authUrl; 36 | /** 37 | * 38 | 39 | * 40 | * @return JSONObject 41 | */ 42 | 43 | public JSONObject setJSON() { 44 | JSONObject json=new JSONObject(); 45 | try{ 46 | 47 | json.put("cardno", this.getCardno()); 48 | json.put("cvv", this.getCvv()); 49 | json.put("currency", this.getCurrency()); 50 | json.put("country", this.getCountry()); 51 | json.put("amount", this.getAmount()); 52 | json.put("expiryyear", this.getExpiryyear()); 53 | json.put("expirymonth", this.getExpirymonth()); 54 | json.put("email", this.getEmail()); 55 | json.put("IP", this.getIP()); 56 | json.put("txRef", this.getTxRef()); 57 | json.put("device_fingerprint", this.getDevice_fingerprint()); 58 | // json.put("pin", this.getPin()); 59 | //json.put("suggested_auth", this.getSuggested_auth()); 60 | json.put("firstname", this.getFirstname()); 61 | json.put("lastname", this.getLastname()); 62 | json.put("redirect_url", this.getRedirect_url()); 63 | json.put("charge_type", this.getCharge_type()); 64 | }catch( JSONException ex){ex.getMessage();} 65 | return json; 66 | } 67 | 68 | 69 | public JSONObject chargeMasterAndVerveCard() throws JSONException{ 70 | JSONObject json= setJSON(); 71 | 72 | json.put("PBFPubKey",RaveConstant.PUBLIC_KEY); 73 | json.put("pin",this.getPin() ); 74 | json.put("suggested_auth",this.getSuggested_auth() ); 75 | 76 | 77 | String message= json.toString(); 78 | 79 | String encrypt_secret_key=getKey(RaveConstant.SECRET_KEY); 80 | String client= encryptData(message,encrypt_secret_key); 81 | 82 | Charge ch=new Charge(); 83 | 84 | return ch.charge(client); 85 | 86 | } 87 | public JSONObject chargeMasterAndVerveCard(boolean polling) { 88 | JSONObject json= setJSON(); 89 | 90 | json.put("PBFPubKey",RaveConstant.PUBLIC_KEY); 91 | json.put("pin",this.getPin() ); 92 | json.put("suggested_auth",this.getSuggested_auth() ); 93 | Polling p=new Polling(); 94 | 95 | return p.handleTimeoutCharge(json); 96 | 97 | } 98 | public JSONObject chargeVisaAndIntl() throws JSONException{ 99 | JSONObject json= setJSON(); 100 | json.put("PBFPubKey",RaveConstant.PUBLIC_KEY); 101 | json.put("redirect_url", this.getRedirect_url() ); 102 | 103 | String message= json.toString(); 104 | 105 | String encrypt_secret_key=getKey(RaveConstant.SECRET_KEY); 106 | String client= encryptData(message,encrypt_secret_key); 107 | 108 | Charge ch=new Charge(); 109 | 110 | return ch.charge(client); 111 | 112 | } 113 | 114 | public JSONObject chargeVisaAndIntl(boolean polling) throws JSONException{ 115 | JSONObject json= setJSON(); 116 | json.put("PBFPubKey",RaveConstant.PUBLIC_KEY); 117 | json.put("redirect_url", this.getRedirect_url() ); 118 | Polling p=new Polling(); 119 | 120 | return p.handleTimeoutCharge(json); 121 | 122 | } 123 | 124 | 125 | /* 126 | if AuthMode::"PIN" 127 | @params transaction reference(flwRef),OTP 128 | * @return JSONObject 129 | */ 130 | 131 | public JSONObject validateCardCharge(){ 132 | Charge vch= new Charge(); 133 | 134 | return vch.validateCardCharge(this.getTransactionreference(), this.getOtp()); 135 | } 136 | //if timeout 137 | public JSONObject validateCardCharge(boolean polling){ 138 | 139 | Polling p=new Polling(); 140 | 141 | return p.validateCardChargeTimeout(this.getTransactionreference(), this.getOtp()); 142 | } 143 | 144 | /* 145 | if AuthMode::"VBSECURE"or "AVS_VBVSECURECODE" 146 | @params authUrl This requires that you copy the authurl returned in the response 147 | and paste it in the argument and it opens a small window for card validation 148 | */ 149 | public void validateCardChargeVB(){ 150 | 151 | if (Desktop.isDesktopSupported()) { 152 | try{ 153 | Desktop.getDesktop().browse(new URI(this.getAuthUrl())); 154 | }catch(URISyntaxException | IOException ex){} 155 | } 156 | } 157 | 158 | 159 | /** 160 | * @return the cardno 161 | */ 162 | public String getCardno() { 163 | return cardno; 164 | } 165 | 166 | /** 167 | * @param cardno the cardno to set 168 | * @return CardCharge 169 | */ 170 | public CardCharge setCardno(String cardno) { 171 | this.cardno = cardno; 172 | 173 | return this; 174 | } 175 | 176 | /** 177 | * @return the cvv 178 | */ 179 | public String getCvv() { 180 | return cvv; 181 | } 182 | 183 | /** 184 | * @param cvv the cvv to set 185 | * @return CardCharge 186 | */ 187 | public CardCharge setCvv(String cvv) { 188 | this.cvv = cvv; 189 | 190 | return this; 191 | } 192 | 193 | /** 194 | * @return the expirymonth 195 | */ 196 | public String getExpirymonth() { 197 | return expirymonth; 198 | } 199 | 200 | /** 201 | * @param expirymonth the expirymonth to set 202 | * @return CardCharge 203 | */ 204 | public CardCharge setExpirymonth(String expirymonth) { 205 | this.expirymonth = expirymonth; 206 | 207 | return this; 208 | } 209 | 210 | /** 211 | * @return the expiryyear 212 | */ 213 | public String getExpiryyear() { 214 | return expiryyear; 215 | } 216 | 217 | /** 218 | * @param expiryyear the expiryyear to set 219 | * @return CardCharge 220 | */ 221 | public CardCharge setExpiryyear(String expiryyear) { 222 | this.expiryyear = expiryyear; 223 | 224 | return this; 225 | } 226 | 227 | /** 228 | * @return the currency 229 | */ 230 | public String getCurrency() { 231 | return currency; 232 | } 233 | 234 | /** 235 | * @param currency the currency to set 236 | * @return CardCharge 237 | */ 238 | public CardCharge setCurrency(String currency) { 239 | this.currency = currency; 240 | 241 | return this; 242 | } 243 | 244 | /** 245 | * @return the country 246 | */ 247 | public String getCountry() { 248 | return country; 249 | } 250 | 251 | /** 252 | * @param country the country to set 253 | * @return CardCharge 254 | */ 255 | public CardCharge setCountry(String country) { 256 | this.country = country; 257 | 258 | return this; 259 | } 260 | 261 | /** 262 | * @return the pin 263 | */ 264 | public String getPin() { 265 | return pin; 266 | } 267 | 268 | /** 269 | * @param pin the pin to set 270 | * @return CardCharge 271 | */ 272 | public CardCharge setPin(String pin) { 273 | this.pin = pin; 274 | 275 | return this; 276 | } 277 | 278 | /** 279 | * @return the suggested_auth 280 | */ 281 | public String getSuggested_auth() { 282 | return suggested_auth; 283 | } 284 | 285 | /** 286 | * @param suggested_auth the suggested_auth to set 287 | * @return CardCharge 288 | */ 289 | public CardCharge setSuggested_auth(String suggested_auth) { 290 | this.suggested_auth = suggested_auth; 291 | 292 | return this; 293 | } 294 | 295 | /** 296 | * @return the amount 297 | */ 298 | public String getAmount() { 299 | return amount; 300 | } 301 | 302 | /** 303 | * @param amount the amount to set 304 | * @return CardCharge 305 | */ 306 | public CardCharge setAmount(String amount) { 307 | this.amount = amount; 308 | 309 | return this; 310 | } 311 | 312 | /** 313 | * @return the email 314 | */ 315 | public String getEmail() { 316 | return email; 317 | } 318 | 319 | /** 320 | * @param email the email to set 321 | * @return CardCharge 322 | */ 323 | public CardCharge setEmail(String email) { 324 | this.email = email; 325 | 326 | return this; 327 | } 328 | 329 | /** 330 | * @return the phonenumber 331 | */ 332 | public String getPhonenumber() { 333 | return phonenumber; 334 | } 335 | 336 | /** 337 | * @param phonenumber the phonenumber to set 338 | * @return CardCharge 339 | */ 340 | public CardCharge setPhonenumber(String phonenumber) { 341 | this.phonenumber = phonenumber; 342 | 343 | return this; 344 | } 345 | 346 | /** 347 | * @return the firstname 348 | */ 349 | public String getFirstname() { 350 | return firstname; 351 | } 352 | 353 | /** 354 | * @param firstname the firstname to set 355 | * @return CardCharge 356 | */ 357 | public CardCharge setFirstname(String firstname) { 358 | this.firstname = firstname; 359 | 360 | return this; 361 | } 362 | 363 | /** 364 | * @return the lastname 365 | */ 366 | public String getLastname() { 367 | return lastname; 368 | } 369 | 370 | /** 371 | * @param lastname the lastname to set 372 | * @return CardCharge 373 | */ 374 | public CardCharge setLastname(String lastname) { 375 | this.lastname = lastname; 376 | 377 | return this; 378 | } 379 | 380 | /** 381 | * @return the IP 382 | */ 383 | public String getIP() { 384 | return IP; 385 | } 386 | 387 | /** 388 | * @param IP the IP to set 389 | * @return CardCharge 390 | */ 391 | public CardCharge setIP(String IP) { 392 | this.IP = IP; 393 | 394 | return this; 395 | } 396 | 397 | /** 398 | * @return the txRef 399 | */ 400 | public String getTxRef() { 401 | return txRef; 402 | } 403 | 404 | /** 405 | * @param txRef the txRef to set 406 | * @return CardCharge 407 | */ 408 | public CardCharge setTxRef(String txRef) { 409 | this.txRef = txRef; 410 | 411 | return this; 412 | } 413 | 414 | /** 415 | * @return the redirect_url 416 | */ 417 | public String getRedirect_url() { 418 | return redirect_url; 419 | } 420 | 421 | /** 422 | * @param redirect_url the redirect_url to set 423 | * @return CardCharge 424 | */ 425 | public CardCharge setRedirect_url(String redirect_url) { 426 | this.redirect_url = redirect_url; 427 | 428 | return this; 429 | } 430 | 431 | /** 432 | * @return the device_fingerprint 433 | */ 434 | public String getDevice_fingerprint() { 435 | return device_fingerprint; 436 | } 437 | 438 | /** 439 | * @param device_fingerprint the device_fingerprint to set 440 | * @return CardCharge 441 | */ 442 | public CardCharge setDevice_fingerprint(String device_fingerprint) { 443 | this.device_fingerprint = device_fingerprint; 444 | 445 | return this; 446 | } 447 | 448 | /** 449 | * @return the charge_type 450 | */ 451 | public String getCharge_type() { 452 | return charge_type; 453 | } 454 | 455 | /** 456 | * @param charge_type the charge_type to set 457 | * @return CardCharge 458 | */ 459 | public CardCharge setCharge_type(String charge_type) { 460 | this.charge_type = charge_type; 461 | 462 | return this; 463 | } 464 | 465 | /** 466 | * @return the transaction_reference 467 | */ 468 | public String getTransactionreference() { 469 | return transactionreference; 470 | } 471 | 472 | /** 473 | * @param transaction_reference the transaction_reference to set 474 | * @return CardCharge 475 | */ 476 | public CardCharge setTransactionreference(String transaction_reference) { 477 | this.transactionreference= transaction_reference; 478 | 479 | return this; 480 | } 481 | 482 | /** 483 | * @return the otp 484 | */ 485 | public String getOtp() { 486 | return otp; 487 | } 488 | 489 | /** 490 | * @param otp the otp to set 491 | * @return CardCharge 492 | */ 493 | public CardCharge setOtp(String otp) { 494 | this.otp = otp; 495 | 496 | return this; 497 | } 498 | 499 | /** 500 | * @return the authUrl 501 | */ 502 | public String getAuthUrl() { 503 | return authUrl; 504 | } 505 | 506 | /** 507 | * @param authUrl the authUrl to set 508 | * @return CardCharge 509 | */ 510 | public CardCharge setAuthUrl(String authUrl) { 511 | this.authUrl = authUrl; 512 | 513 | return this; 514 | } 515 | } 516 | -------------------------------------------------------------------------------- /src/main/java/com/github/theresasogunle/Charge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.github.theresasogunle; 7 | 8 | 9 | import org.json.JSONObject; 10 | 11 | 12 | 13 | /** 14 | * 15 | * @author Theresa 16 | */ 17 | public class Charge { 18 | 19 | ApiConnection apiConnection; 20 | Endpoints ed= new Endpoints(); 21 | 22 | 23 | /** 24 | * 25 | * @param client 26 | * @return JSONObject 27 | */ 28 | 29 | 30 | //for all charges 31 | public JSONObject charge(String client){ 32 | this.apiConnection = new ApiConnection(ed.getChargeEndPoint()); 33 | 34 | String alg="3DES-24"; 35 | 36 | 37 | ApiQuery api=new ApiQuery(); 38 | 39 | api.putParams("PBFPubKey", RaveConstant.PUBLIC_KEY); 40 | 41 | api.putParams("client", client); 42 | 43 | api.putParams("alg", alg); 44 | 45 | 46 | return this.apiConnection.connectAndQuery(api); 47 | } 48 | /** 49 | * 50 | * 51 | * @return JSONObject 52 | * @param transaction_reference 53 | * @param otp 54 | * 55 | */ 56 | 57 | public JSONObject validateAccountCharge(String transaction_reference, String otp){ 58 | 59 | this.apiConnection = new ApiConnection(ed.getValidateAccountChargeEndPoint()); 60 | 61 | ApiQuery api=new ApiQuery(); 62 | 63 | api.putParams("PBFPubKey",RaveConstant.PUBLIC_KEY); 64 | api.putParams("transactionreference", transaction_reference); 65 | 66 | api.putParams("otp", otp); 67 | 68 | return this.apiConnection.connectAndQuery(api); 69 | } 70 | /** 71 | * 72 | * 73 | * @return JSONObject 74 | * @param transaction_reference 75 | * @param otp 76 | * 77 | */ 78 | 79 | public JSONObject validateCardCharge(String transaction_reference, String otp){ 80 | 81 | this.apiConnection = new ApiConnection(ed.getValidateCardChargeEndPoint()); 82 | 83 | ApiQuery api=new ApiQuery(); 84 | 85 | api.putParams("PBFPubKey",RaveConstant.PUBLIC_KEY); 86 | api.putParams("transaction_reference", transaction_reference); 87 | 88 | api.putParams("otp", otp); 89 | 90 | return this.apiConnection.connectAndQuery(api); 91 | } 92 | 93 | 94 | 95 | 96 | 97 | } 98 | -------------------------------------------------------------------------------- /src/main/java/com/github/theresasogunle/Encryption.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.github.theresasogunle; 7 | 8 | import java.io.UnsupportedEncodingException; 9 | import java.security.InvalidKeyException; 10 | import java.security.MessageDigest; 11 | import java.util.Arrays; 12 | import java.security.NoSuchAlgorithmException; 13 | import java.util.Base64; 14 | import java.util.logging.Level; 15 | import java.util.logging.Logger; 16 | import javax.crypto.BadPaddingException; 17 | import javax.crypto.Cipher; 18 | import javax.crypto.IllegalBlockSizeException; 19 | import javax.crypto.NoSuchPaddingException; 20 | import javax.crypto.SecretKey; 21 | import javax.crypto.spec.SecretKeySpec; 22 | import org.json.JSONObject; 23 | /** 24 | * 25 | * @author Theresa 26 | */ 27 | 28 | 29 | public class Encryption { 30 | 31 | 32 | RaveConstant keys= new RaveConstant(); 33 | 34 | 35 | // Method to turn bytes in hex 36 | public static String toHexStr(byte[] bytes){ 37 | 38 | StringBuilder builder = new StringBuilder(); 39 | 40 | for(int i = 0; i < bytes.length; i++ ){ 41 | builder.append(String.format("%02x", bytes[i])); 42 | } 43 | 44 | return builder.toString(); 45 | } 46 | 47 | // this is the getKey function that generates an encryption Key for you by passing your Secret Key as a parameter. 48 | public static String getKey(String seedKey) { 49 | try { 50 | MessageDigest md = MessageDigest.getInstance("md5"); 51 | byte[] hashedString = md.digest(seedKey.getBytes("utf-8")); 52 | byte[] subHashString = toHexStr(Arrays.copyOfRange(hashedString, hashedString.length - 12, hashedString.length)).getBytes("utf-8"); 53 | String subSeedKey = seedKey.replace("FLWSECK-", ""); 54 | subSeedKey = subSeedKey.substring(0, 12); 55 | byte[] combineArray = new byte[24]; 56 | System.arraycopy(subSeedKey.getBytes(), 0, combineArray, 0, 12); 57 | System.arraycopy(subHashString, subHashString.length - 12, combineArray, 12, 12); 58 | return new String(combineArray); 59 | } catch (NoSuchAlgorithmException | UnsupportedEncodingException ex) { 60 | Logger.getGlobal().log(Level.SEVERE, null, ex); 61 | } 62 | return null; 63 | } 64 | 65 | // This is the encryption function that encrypts your payload by passing the stringified format and your encryption Key. 66 | public static String encryptData(String message, String _encryptionKey) { 67 | try { 68 | final byte[] digestOfPassword = _encryptionKey.getBytes("utf-8"); 69 | final byte[] keyBytes = Arrays.copyOf(digestOfPassword, 24); 70 | 71 | final SecretKey key = new SecretKeySpec( keyBytes , "DESede"); 72 | final Cipher cipher = Cipher.getInstance("DESede/ECB/PKCS5Padding"); 73 | cipher.init(Cipher.ENCRYPT_MODE, key); 74 | final byte[] plainTextBytes = message.getBytes("utf-8"); 75 | final byte[] cipherText = cipher.doFinal(plainTextBytes); 76 | return Base64.getEncoder().encodeToString(cipherText); 77 | 78 | } catch (UnsupportedEncodingException | NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) { 79 | 80 | 81 | return ""; 82 | } 83 | 84 | } 85 | 86 | /** 87 | * 88 | * @param api(JSON object) 89 | * @return String 90 | */ 91 | 92 | public String encryptParameters(JSONObject api) { 93 | 94 | try{ 95 | api.put("PBFPubKey",RaveConstant.PUBLIC_KEY); 96 | }catch(Exception ex){} 97 | 98 | 99 | 100 | String message= api.toString(); 101 | 102 | String encrypt_secret_key=getKey(RaveConstant.SECRET_KEY); 103 | String encrypted_message= encryptData(message,encrypt_secret_key); 104 | 105 | 106 | return encrypted_message; 107 | 108 | } 109 | /** 110 | * 111 | * 112 | * @return String 113 | * @param api 114 | * 115 | */ 116 | 117 | 118 | public String encryptParametersPreAuth(JSONObject api){ 119 | 120 | try{ 121 | api.put("PBFPubKey","FLWPUBK-8cd258c49f38e05292e5472b2b15906e-X"); 122 | }catch(Exception ex){} 123 | 124 | String message= api.toString(); 125 | 126 | 127 | 128 | String encrypt_secret_key=getKey("FLWSECK-c51891678d48c39eff3701ff686bdb69-X"); 129 | String encrypted_message= encryptData(message,encrypt_secret_key); 130 | 131 | 132 | return encrypted_message; 133 | 134 | } 135 | 136 | 137 | 138 | } 139 | -------------------------------------------------------------------------------- /src/main/java/com/github/theresasogunle/Endpoints.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.github.theresasogunle; 7 | 8 | import com.github.theresasogunle.RaveConstant; 9 | 10 | 11 | /** 12 | * 13 | * @author Theresa 14 | */ 15 | public class Endpoints { 16 | RaveConstant key= new RaveConstant(); 17 | String staging_url="https://ravesandboxapi.flutterwave.com/"; 18 | String live_url="https://api.ravepay.co/"; 19 | String url; 20 | public String BANK_ENDPOINT; 21 | public static String CHARGE_ENDPOINT; 22 | public static String CARD_VALIDATE_ENDPOINT; 23 | public static String ACCOUNT_VALIDATE_ENDPOINT; 24 | public static String TIMEOUT_ENDPOINT; 25 | public static String POLL_ENDPOINT; 26 | public static String FEES_ENDPOINT; 27 | public static String REFUND_ENDPOINT; 28 | public static String FOREX_ENDPOINT; 29 | public static String VERIFY_TRANSACTION_ENDPOINT; 30 | public static String VERIFY_XREQUERY_ENDPOINT; 31 | public static String CAPTURE_ENDPOINT; 32 | public static String REFUNDVOID_ENDPOINT; 33 | public static String CHARGE_TIMEOUT_ENDPOINT; 34 | public static String VALIDATE_CARD_CHARGE_TIMEOUT_ENDPOINT; 35 | public static String VALIDATE_ACCOUNT_CHARGE_TIMEOUT_ENDPOINT; 36 | 37 | 38 | 39 | void init(){ 40 | 41 | 42 | if(RaveConstant.ENVIRONMENT.toString().equalsIgnoreCase("live")){ 43 | 44 | url=live_url; 45 | 46 | } 47 | else { 48 | url=staging_url; 49 | } 50 | 51 | BANK_ENDPOINT= url+"flwv3-pug/getpaidx/api/flwpbf-banks.js?json=1"; 52 | CHARGE_ENDPOINT =url+"flwv3-pug/getpaidx/api/charge"; 53 | CARD_VALIDATE_ENDPOINT = url+"flwv3-pug/getpaidx/api/validatecharge"; 54 | ACCOUNT_VALIDATE_ENDPOINT=url+"flwv3-pug/getpaidx/api/validate"; 55 | TIMEOUT_ENDPOINT=url+"flwv3-pug/getpaidx/api/charge?use_polling=1"; 56 | POLL_ENDPOINT=url+"flwv3-pug/getpaidx/api/requests/RCORE_CHREQ_3FC28781846AD8E1C598"; 57 | FEES_ENDPOINT=url+"flwv3-pug/getpaidx/api/fee"; 58 | REFUND_ENDPOINT=url+"gpx/merchant/transactions/refund"; 59 | FOREX_ENDPOINT=url+"flwv3-pug/getpaidx/api/forex"; 60 | VERIFY_TRANSACTION_ENDPOINT=url+"flwv3-pug/getpaidx/api/verify"; 61 | VERIFY_XREQUERY_ENDPOINT=url+"flwv3-pug/getpaidx/api/xrequery"; 62 | CAPTURE_ENDPOINT=url+"flwv3-pug/getpaidx/api/capture"; 63 | REFUNDVOID_ENDPOINT=url+"flwv3-pug/getpaidx/api/refundorvoid"; 64 | CHARGE_TIMEOUT_ENDPOINT=url+"flwv3-pug/getpaidx/api/charge?use_polling=1"; 65 | VALIDATE_CARD_CHARGE_TIMEOUT_ENDPOINT=url+"flwv3-pug/getpaidx/api/validatecharge?use_polling=1"; 66 | VALIDATE_ACCOUNT_CHARGE_TIMEOUT_ENDPOINT= url+"flwv3-pug/getpaidx/api/validate?use_polling=1"; 67 | 68 | } 69 | 70 | public String getBankEndPoint(){ 71 | init(); 72 | return BANK_ENDPOINT; 73 | 74 | } 75 | 76 | public String getChargeEndPoint(){ 77 | init(); 78 | return CHARGE_ENDPOINT; 79 | 80 | } 81 | public String getValidateCardChargeEndPoint(){ 82 | init(); 83 | return CARD_VALIDATE_ENDPOINT; 84 | 85 | } 86 | public String getValidateAccountChargeEndPoint(){ 87 | init(); 88 | return ACCOUNT_VALIDATE_ENDPOINT; 89 | 90 | } 91 | public String getFeesEndPoint(){ 92 | init(); 93 | return FEES_ENDPOINT; 94 | 95 | } 96 | public String getRefundEndPoint(){ 97 | init(); 98 | return REFUND_ENDPOINT; 99 | 100 | } 101 | public String getForexEndPoint(){ 102 | init(); 103 | return FOREX_ENDPOINT; 104 | 105 | } 106 | public String getVerifyEndPoint(){ 107 | init(); 108 | return VERIFY_TRANSACTION_ENDPOINT; 109 | 110 | } 111 | public String getVerifyXrequeryEndPoint(){ 112 | init(); 113 | return VERIFY_XREQUERY_ENDPOINT; 114 | 115 | } 116 | public String getCaptureEndPoint(){ 117 | init(); 118 | return CAPTURE_ENDPOINT; 119 | 120 | } 121 | public String getRefundOrVoidEndPoint(){ 122 | init(); 123 | return REFUNDVOID_ENDPOINT; 124 | 125 | } 126 | public String getChargeTimeoutEndpoint(){ 127 | init(); 128 | return CHARGE_TIMEOUT_ENDPOINT; 129 | 130 | } 131 | public String getValidateCardChargeTimeoutEndpoint(){ 132 | init(); 133 | return VALIDATE_CARD_CHARGE_TIMEOUT_ENDPOINT; 134 | 135 | } 136 | public String getValidateAccountChargeTimeoutEndpoint(){ 137 | init(); 138 | return VALIDATE_ACCOUNT_CHARGE_TIMEOUT_ENDPOINT; 139 | 140 | } 141 | 142 | 143 | 144 | 145 | 146 | } 147 | -------------------------------------------------------------------------------- /src/main/java/com/github/theresasogunle/Environment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.github.theresasogunle; 7 | 8 | /** 9 | * 10 | * @author Theresa 11 | */ 12 | public enum Environment { 13 | STAGING, 14 | LIVE 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/github/theresasogunle/ExchangeRates.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.github.theresasogunle; 7 | 8 | import org.json.JSONObject; 9 | 10 | /** 11 | * 12 | * @author Theresa 13 | */ 14 | public class ExchangeRates { 15 | ApiConnection apiConnection; 16 | Endpoints end= new Endpoints(); 17 | 18 | private String amount; 19 | private String origin_currency; 20 | private String destination_currency; 21 | 22 | 23 | /** 24 | * @return JSONObject 25 | */ 26 | public JSONObject forex(){ 27 | 28 | 29 | this.apiConnection = new ApiConnection(end.getForexEndPoint()); 30 | ApiQuery api= new ApiQuery(); 31 | 32 | //API PARAMETERS 33 | api.putParams("SECKEY", RaveConstant.SECRET_KEY); 34 | api.putParams("origin_currency", this.getOrigin_currency()); 35 | api.putParams("destination_currency", this.getDestination_currency()); 36 | api.putParams("amount", this.getAmount()); 37 | 38 | 39 | return this.apiConnection.connectAndQuery(api); 40 | 41 | } 42 | 43 | /** 44 | * @return the amount 45 | */ 46 | public String getAmount() { 47 | return amount; 48 | } 49 | 50 | /** 51 | * @param amount the amount to set 52 | * @return ExchangeRates 53 | */ 54 | public ExchangeRates setAmount(String amount) { 55 | this.amount = amount; 56 | return this; 57 | } 58 | 59 | /** 60 | * @return the origin_currency 61 | */ 62 | public String getOrigin_currency() { 63 | return origin_currency; 64 | } 65 | 66 | /** 67 | * @param origin_currency the origin_currency to set 68 | * @return ExchangeRates 69 | */ 70 | public ExchangeRates setOrigin_currency(String origin_currency) { 71 | this.origin_currency = origin_currency; 72 | return this; 73 | } 74 | 75 | /** 76 | * @return the destination_currency 77 | */ 78 | public String getDestination_currency() { 79 | return destination_currency; 80 | } 81 | 82 | /** 83 | * @param destination_currency the destination_currency to set 84 | * @return ExchangeRates 85 | */ 86 | public ExchangeRates setDestination_currency(String destination_currency) { 87 | this.destination_currency = destination_currency; 88 | return this; 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/main/java/com/github/theresasogunle/Fees.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.github.theresasogunle; 7 | 8 | 9 | 10 | import org.json.JSONObject; 11 | 12 | /** 13 | * 14 | * @author Theresa 15 | */ 16 | public class Fees { 17 | private ApiConnection apiConnection; 18 | 19 | Endpoints end= new Endpoints(); 20 | 21 | private String amount; 22 | private String currency; 23 | private String card6; 24 | /** 25 | * 26 | * 27 | * @return JSONObject 28 | * 29 | */ 30 | 31 | public JSONObject getFees(){ 32 | 33 | this.apiConnection = new ApiConnection(end.getFeesEndPoint()); 34 | 35 | ApiQuery api= new ApiQuery(); 36 | api.putParams("amount", this.getAmount()); 37 | api.putParams("PBFPubKey", RaveConstant.PUBLIC_KEY); 38 | api.putParams("currency", this.getCurrency()); 39 | api.putParams("ptype",2); 40 | 41 | 42 | return this.apiConnection.connectAndQuery(api); 43 | } 44 | /*used only when the user has entered first 6digits of their card number, 45 | it also helps determine international fees on the transaction if the card being used is an international card 46 | */ 47 | 48 | public JSONObject getFeesForCard6(){ 49 | 50 | this.apiConnection = new ApiConnection(end.getFeesEndPoint()); 51 | 52 | ApiQuery api= new ApiQuery(); 53 | api.putParams("amount", this.getAmount()); 54 | api.putParams("PBFPubKey", RaveConstant.PUBLIC_KEY); 55 | api.putParams("currency", this.getCurrency()); 56 | api.putParams("ptype",2); 57 | api.putParams("card6", this.getCard6()); 58 | 59 | return this.apiConnection.connectAndQuery(api); 60 | } 61 | 62 | /** 63 | * @return the amount 64 | */ 65 | public String getAmount() { 66 | return amount; 67 | } 68 | 69 | /** 70 | * @param amount the amount to set 71 | */ 72 | public Fees setAmount(String amount) { 73 | this.amount = amount; 74 | return this; 75 | } 76 | 77 | /** 78 | * @return the currency 79 | */ 80 | public String getCurrency() { 81 | return currency; 82 | } 83 | 84 | /** 85 | * @param currency the currency to set 86 | */ 87 | public Fees setCurrency(String currency) { 88 | this.currency = currency; 89 | return this; 90 | } 91 | 92 | /** 93 | * @return the card6 94 | */ 95 | public String getCard6() { 96 | return card6; 97 | } 98 | 99 | /** 100 | * @param card6 the card6 to set 101 | */ 102 | public Fees setCard6(String card6) { 103 | this.card6 = card6; 104 | return this; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /src/main/java/com/github/theresasogunle/IntegrityChecksum.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * To change this license header, choose License Headers in Project Properties. 4 | * To change this template file, choose Tools | Templates 5 | * and open the template in the editor. 6 | */ 7 | package com.github.theresasogunle; 8 | 9 | import java.nio.charset.StandardCharsets; 10 | import java.security.MessageDigest; 11 | import java.util.Arrays; 12 | import java.util.Base64; 13 | 14 | import java.util.HashMap; 15 | 16 | /** 17 | * 18 | * @author Theresa 19 | */ 20 | public class IntegrityChecksum { 21 | 22 | RaveConstant key=new RaveConstant(); 23 | private String amount, payment_method,custom_description; 24 | private String custom_logo,country,currency,customer_email; 25 | private String customer_lastname,customer_firstname,customer_phone,txref; 26 | /** 27 | * 28 | * 29 | * @return String 30 | * 31 | */ 32 | 33 | 34 | public String integrityChecksum(){ 35 | HashMap payload=new HashMap(); 36 | 37 | payload.put("PBFPubKey" , RaveConstant.PUBLIC_KEY); 38 | payload.put("amount" ,this.getAmount()); 39 | payload.put("payment_method", this.getPayment_method()); 40 | payload.put("custom_description",this.getCustom_description()); 41 | payload.put("custom_logo",this.getCustom_logo()); 42 | payload.put("country", this.getCountry()); 43 | payload.put("currency", this.getCurrency()); 44 | payload.put ("customer_email", this.getCustomer_email()); 45 | payload.put( "customer_firstname", this.getCustomer_firstname()); 46 | payload.put("customer_lastname", this.getCustomer_lastname()); 47 | payload.put("customer_phone", this.getCustomer_phone()); 48 | payload.put( "txref",this.getTxref()); 49 | 50 | 51 | 52 | Object[] keys=payload.keySet().toArray(); 53 | Arrays.sort(keys); 54 | String hashedPayload = ""; 55 | 56 | 57 | for (Object key : keys) { 58 | hashedPayload+=payload.get(key); 59 | } 60 | String hashString = hashedPayload + RaveConstant.SECRET_KEY; 61 | String hash_string=""; 62 | 63 | try{ 64 | MessageDigest digest = MessageDigest.getInstance("SHA-256"); 65 | byte[] hash = digest.digest(hashString.getBytes(StandardCharsets.UTF_8)); 66 | hash_string=Base64.getEncoder().encodeToString(hash); 67 | // System.out.println(hash_string); 68 | }catch(Exception ex){} 69 | 70 | return hash_string; 71 | } 72 | 73 | /** 74 | * @return the amount 75 | */ 76 | public String getAmount() { 77 | return amount; 78 | } 79 | 80 | /** 81 | * @param amount the amount to set 82 | * @return IntegrityChecksum 83 | */ 84 | public IntegrityChecksum setAmount(String amount) { 85 | this.amount = amount; 86 | return this; 87 | } 88 | 89 | /** 90 | * @return the payment_method 91 | */ 92 | public String getPayment_method() { 93 | return payment_method; 94 | } 95 | 96 | /** 97 | * @param payment_method the payment_method to set 98 | * @return IntegrityChecksum 99 | */ 100 | public IntegrityChecksum setPayment_method(String payment_method) { 101 | this.payment_method = payment_method; 102 | return this; 103 | } 104 | 105 | /** 106 | * @return the custom_description 107 | */ 108 | public String getCustom_description() { 109 | return custom_description; 110 | } 111 | 112 | /** 113 | * @param custom_description the custom_description to set 114 | * @return IntegrityChecksum 115 | */ 116 | public IntegrityChecksum setCustom_description(String custom_description) { 117 | this.custom_description = custom_description; 118 | return this; 119 | } 120 | 121 | /** 122 | * @return the custom_logo 123 | * 124 | */ 125 | public String getCustom_logo() { 126 | return custom_logo; 127 | } 128 | 129 | /** 130 | * @param custom_logo the custom_logo to set 131 | * @return IntegrityChecksum 132 | */ 133 | public IntegrityChecksum setCustom_logo(String custom_logo) { 134 | this.custom_logo = custom_logo; 135 | return this; 136 | } 137 | 138 | /** 139 | * @return the country 140 | */ 141 | public String getCountry() { 142 | return country; 143 | } 144 | 145 | /** 146 | * @param country the country to set 147 | * @return IntegrityChecksum 148 | */ 149 | public IntegrityChecksum setCountry(String country) { 150 | this.country = country; 151 | return this; 152 | } 153 | 154 | /** 155 | * @return the currency 156 | */ 157 | public String getCurrency() { 158 | return currency; 159 | } 160 | 161 | /** 162 | * @param currency the currency to set 163 | * @return IntegrityChecksum 164 | */ 165 | public IntegrityChecksum setCurrency(String currency) { 166 | this.currency = currency; 167 | return this; 168 | } 169 | 170 | /** 171 | * @return the customer_email 172 | */ 173 | public String getCustomer_email() { 174 | return customer_email; 175 | } 176 | 177 | /** 178 | * @param customer_email the customer_email to set 179 | * @return IntegrityChecksum 180 | */ 181 | public IntegrityChecksum setCustomer_email(String customer_email) { 182 | this.customer_email = customer_email; 183 | return this; 184 | } 185 | 186 | /** 187 | * @return the customer_lastname 188 | */ 189 | public String getCustomer_lastname() { 190 | return customer_lastname; 191 | } 192 | 193 | /** 194 | * @param customer_lastname the customer_lastname to set 195 | * @return IntegrityChecksum 196 | */ 197 | public IntegrityChecksum setCustomer_lastname(String customer_lastname) { 198 | this.customer_lastname = customer_lastname; 199 | return this; 200 | } 201 | 202 | /** 203 | * @return the customer_firstname 204 | */ 205 | public String getCustomer_firstname() { 206 | return customer_firstname; 207 | } 208 | 209 | /** 210 | * @param customer_firstname the customer_firstname to set 211 | * @return IntegrityChecksum 212 | */ 213 | public IntegrityChecksum setCustomer_firstname(String customer_firstname) { 214 | this.customer_firstname = customer_firstname; 215 | return this; 216 | } 217 | 218 | /** 219 | * @return the customer_phone 220 | */ 221 | public String getCustomer_phone() { 222 | return customer_phone; 223 | } 224 | 225 | /** 226 | * @param customer_phone the customer_phone to set 227 | * @return IntegrityChecksum 228 | */ 229 | public IntegrityChecksum setCustomer_phone(String customer_phone) { 230 | this.customer_phone = customer_phone; 231 | return this; 232 | } 233 | 234 | /** 235 | * @return the txref 236 | */ 237 | public String getTxref() { 238 | return txref; 239 | } 240 | 241 | /** 242 | * @param txref the txref to set 243 | * @return IntegrityChecksum 244 | */ 245 | public IntegrityChecksum setTxref(String txref) { 246 | this.txref = txref; 247 | return this; 248 | } 249 | 250 | 251 | } 252 | -------------------------------------------------------------------------------- /src/main/java/com/github/theresasogunle/Polling.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.github.theresasogunle; 7 | 8 | import static com.github.theresasogunle.Encryption.encryptData; 9 | import org.json.JSONException; 10 | import org.json.JSONObject; 11 | 12 | /** 13 | * 14 | * @author Theresa 15 | */ 16 | public class Polling { 17 | ApiConnection apiConnection; 18 | final private Endpoints ed=new Endpoints(); 19 | Encryption e=new Encryption(); 20 | RaveConstant key=new RaveConstant(); 21 | 22 | 23 | //if timeout, start polling 24 | /** 25 | * 26 | *@param json 27 | * @throws JSONException 28 | * @return JSONObject 29 | */ 30 | public JSONObject handleTimeoutCharge(JSONObject json){ 31 | this.apiConnection = new ApiConnection(ed.getChargeTimeoutEndpoint()); 32 | JSONObject tcharge= null; 33 | 34 | String message= json.toString(); 35 | 36 | String encrypt_secret_key=Encryption.getKey( RaveConstant.SECRET_KEY); 37 | String client= encryptData(message,encrypt_secret_key); 38 | 39 | String alg="3DES-24"; 40 | 41 | ApiQuery api=new ApiQuery(); 42 | 43 | api.putParams("PBFPubKey", RaveConstant.PUBLIC_KEY); 44 | 45 | api.putParams("client", client); 46 | 47 | api.putParams("alg", alg); 48 | 49 | tcharge= this.apiConnection.connectAndQuery(api); 50 | 51 | return tcharge; 52 | 53 | } 54 | /** 55 | * 56 | * @param transaction_reference 57 | * @param otp 58 | * @return String 59 | */ 60 | public JSONObject validateCardChargeTimeout(String transaction_reference,String otp){ 61 | 62 | this.apiConnection = new ApiConnection(ed.getValidateCardChargeTimeoutEndpoint()); 63 | ApiQuery api=new ApiQuery(); 64 | 65 | api.putParams("PBFPubKey",RaveConstant.PUBLIC_KEY); 66 | api.putParams("transaction_reference", transaction_reference); 67 | 68 | api.putParams("otp", otp); 69 | 70 | return this.apiConnection.connectAndQuery(api); 71 | } 72 | 73 | 74 | /** 75 | * 76 | * @param transaction_reference 77 | * @param otp 78 | * @return String 79 | */ 80 | public JSONObject validateAccountChargeTimeout(String transaction_reference,String otp){ 81 | 82 | this.apiConnection = new ApiConnection(ed.getValidateAccountChargeTimeoutEndpoint()); 83 | ApiQuery api=new ApiQuery(); 84 | 85 | api.putParams("PBFPubKey",RaveConstant.PUBLIC_KEY); 86 | api.putParams("transaction_reference", transaction_reference); 87 | 88 | api.putParams("otp", otp); 89 | 90 | return this.apiConnection.connectAndQuery(api); 91 | } 92 | 93 | 94 | 95 | 96 | 97 | } 98 | -------------------------------------------------------------------------------- /src/main/java/com/github/theresasogunle/PreAuthorization.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.github.theresasogunle; 7 | 8 | 9 | import static com.github.theresasogunle.Encryption.encryptData; 10 | import java.net.InetAddress; 11 | import java.net.UnknownHostException; 12 | import org.json.JSONException; 13 | import org.json.JSONObject; 14 | 15 | 16 | 17 | /** 18 | * 19 | * @author Theresa 20 | */ 21 | public class PreAuthorization { 22 | ApiConnection apiConnection; 23 | Endpoints end=new Endpoints(); 24 | Encryption e=new Encryption(); 25 | private String flwref; 26 | private String action; 27 | RaveConstant key=new RaveConstant(); 28 | private String cardno,cvv,expirymonth,expiryyear,currency,country; 29 | private String amount,email,phonenumber,firstname,lastname,IP; 30 | private String txRef,redirect_url,device_fingerprint,charge_type; 31 | /* 32 | NB: For Preauth payment please use the keys below: 33 | | Public Key | FLWPUBK-8cd258c49f38e05292e5472b2b15906e-X | 34 | | Secret Key | FLWSECK-c51891678d48c39eff3701ff686bdb69-X | 35 | 36 | Preauth payments is based on approval per merchant, 37 | and is not open to accounts except approval to use these payment method is given. 38 | */ 39 | /** 40 | * @return JSONObject 41 | * @throws JSONException 42 | */ 43 | public JSONObject setJSON(){ 44 | JSONObject json= new JSONObject(); 45 | try{ 46 | InetAddress inetAddress = InetAddress.getLocalHost(); 47 | IP= inetAddress.getHostAddress(); 48 | String public_key="FLWPUBK-8cd258c49f38e05292e5472b2b15906e-X "; 49 | json.put("PBFPubKey",public_key); 50 | json.put("cardno", this.getCardno()); 51 | json.put("charge_type",this.getCharge_type()); 52 | json.put("cvv", this.getCvv()); 53 | json.put("expirymonth", this.getExpirymonth()); 54 | json.put("expiryyear",this.getExpiryyear()); 55 | json.put( "currency", this.getCurrency()); 56 | json.put("country", this.getCountry()); 57 | json.put("amount",this.getAmount()); 58 | json.put("email", this.getEmail()); 59 | json.put("phonenumber", this.getPhonenumber()); 60 | json.put("firstname", this.getFirstname()); 61 | json.put("lastname", this.getLastname()); 62 | json.put("IP", IP); 63 | json.put("txRef", this.getTxRef()); 64 | json.put("redirect_url", this.getRedirect_url()); 65 | json.put("device_fingerprint", this.getDevice_fingerprint()); 66 | }catch(UnknownHostException | JSONException ex){ex.getMessage();} 67 | return json; 68 | 69 | } 70 | /** 71 | * @return JSONObject 72 | * @throws JSONException 73 | */ 74 | public JSONObject preAuthorizeCard()throws JSONException{ 75 | 76 | this.apiConnection = new ApiConnection(end.getChargeEndPoint()); 77 | JSONObject json= setJSON(); 78 | String public_key="FLWPUBK-8cd258c49f38e05292e5472b2b15906e-X "; 79 | //preauthorization requires special public key 80 | 81 | 82 | //else us the normal public key 83 | // String public_key=key.getPublicKey(); 84 | 85 | 86 | //preauthorization requires special public key 87 | 88 | String message= json.toString(); 89 | String secret_key="FLWSECK-c51891678d48c39eff3701ff686bdb69-X"; 90 | 91 | String encrypt_secret_key=Encryption.getKey(secret_key); 92 | String client= encryptData(message,encrypt_secret_key); 93 | String alg="3DES-24"; 94 | 95 | ApiQuery api=new ApiQuery(); 96 | 97 | api.putParams("PBFPubKey", public_key); 98 | api.putParams("client", client); 99 | api.putParams("alg", alg); 100 | System.out.println("Succesful"); 101 | 102 | 103 | return this.apiConnection.connectAndQuery(api); 104 | } 105 | /** 106 | * @return the JSONObject 107 | */ 108 | public JSONObject capture(){ 109 | this.apiConnection = new ApiConnection(end.getCaptureEndPoint()); 110 | ApiQuery api= new ApiQuery(); 111 | 112 | String secret_key="FLWSECK-c51891678d48c39eff3701ff686bdb69-X"; 113 | 114 | // String secret_key=key.getSecretKey(); 115 | api.putParams("flwRef", this.getFlwref()); 116 | api.putParams("SECKEY", secret_key); 117 | 118 | 119 | return this.apiConnection.connectAndQuery(api); 120 | } 121 | /** 122 | * @return JSONObject 123 | */ 124 | 125 | public JSONObject refundOrVoid(){ 126 | this.apiConnection = new ApiConnection(end.getRefundOrVoidEndPoint()); 127 | ApiQuery api= new ApiQuery(); 128 | String secret_key="FLWSECK-c51891678d48c39eff3701ff686bdb69-X"; 129 | // String secret_key=key.getSecretKey(); 130 | api.putParams("ref", this.getFlwref()); 131 | api.putParams("action", this.getAction()); 132 | api.putParams("SECKEY", secret_key); 133 | 134 | return this.apiConnection.connectAndQuery(api); 135 | 136 | } 137 | 138 | /** 139 | * @return the flwref 140 | */ 141 | public String getFlwref() { 142 | return flwref; 143 | } 144 | 145 | /** 146 | * @param flwref the flwref to set 147 | * @return PreAuthorization 148 | */ 149 | public PreAuthorization setFlwref(String flwref) { 150 | this.flwref = flwref; 151 | return this; 152 | } 153 | 154 | /** 155 | * @return the action 156 | */ 157 | public String getAction() { 158 | return action; 159 | } 160 | 161 | /** 162 | * @param action the action to set 163 | * @return PreAuthorization 164 | */ 165 | public PreAuthorization setAction(String action) { 166 | this.action = action; 167 | return this; 168 | } 169 | 170 | /** 171 | * @return the cardno 172 | */ 173 | public String getCardno() { 174 | return cardno; 175 | } 176 | 177 | /** 178 | * @param cardno the cardno to set 179 | * @return PreAuthorization 180 | */ 181 | public PreAuthorization setCardno(String cardno) { 182 | this.cardno = cardno; 183 | return this; 184 | } 185 | 186 | /** 187 | * @return the cvv 188 | */ 189 | public String getCvv() { 190 | return cvv; 191 | } 192 | 193 | /** 194 | * @param cvv the cvv to set 195 | * @return PreAuthorization 196 | */ 197 | public PreAuthorization setCvv(String cvv) { 198 | this.cvv = cvv; 199 | return this; 200 | } 201 | 202 | /** 203 | * @return the expirymonth 204 | */ 205 | public String getExpirymonth() { 206 | return expirymonth; 207 | } 208 | 209 | /** 210 | * @param expirymonth the expirymonth to set 211 | * @return PreAuthorization 212 | */ 213 | public PreAuthorization setExpirymonth(String expirymonth) { 214 | this.expirymonth = expirymonth; 215 | return this; 216 | } 217 | 218 | /** 219 | * @return the expiryyear 220 | */ 221 | public String getExpiryyear() { 222 | return expiryyear; 223 | } 224 | 225 | /** 226 | * @param expiryyear the expiryyear to set 227 | * @return PreAuthorization 228 | */ 229 | public PreAuthorization setExpiryyear(String expiryyear) { 230 | this.expiryyear = expiryyear; 231 | return this; 232 | } 233 | 234 | /** 235 | * @return the currency 236 | */ 237 | public String getCurrency() { 238 | return currency; 239 | } 240 | 241 | /** 242 | * @param currency the currency to set 243 | * @return PreAuthorization 244 | */ 245 | public PreAuthorization setCurrency(String currency) { 246 | this.currency = currency; 247 | return this; 248 | } 249 | 250 | /** 251 | * @return the country 252 | */ 253 | public String getCountry() { 254 | return country; 255 | } 256 | 257 | /** 258 | * @param country the country to set 259 | * @return PreAuthorization 260 | */ 261 | public PreAuthorization setCountry(String country) { 262 | this.country = country; 263 | return this; 264 | } 265 | 266 | /** 267 | * @return the amount 268 | */ 269 | public String getAmount() { 270 | return amount; 271 | } 272 | 273 | /** 274 | * @param amount the amount to set 275 | * @return PreAuthorization 276 | */ 277 | public PreAuthorization setAmount(String amount) { 278 | this.amount = amount; 279 | return this; 280 | } 281 | 282 | /** 283 | * @return the email 284 | */ 285 | public String getEmail() { 286 | return email; 287 | } 288 | 289 | /** 290 | * @param email the email to set 291 | * @return PreAuthorization 292 | */ 293 | public PreAuthorization setEmail(String email) { 294 | this.email = email; 295 | return this; 296 | } 297 | 298 | /** 299 | * @return the phonenumber 300 | */ 301 | public String getPhonenumber() { 302 | return phonenumber; 303 | } 304 | 305 | /** 306 | * @param phonenumber the phonenumber to set 307 | * @return PreAuthorization 308 | */ 309 | public PreAuthorization setPhonenumber(String phonenumber) { 310 | this.phonenumber = phonenumber; 311 | return this; 312 | } 313 | 314 | /** 315 | * @return the firstname 316 | */ 317 | public String getFirstname() { 318 | return firstname; 319 | } 320 | 321 | /** 322 | * @param firstname the firstname to set 323 | * @return PreAuthorization 324 | */ 325 | public PreAuthorization setFirstname(String firstname) { 326 | this.firstname = firstname; 327 | return this; 328 | } 329 | 330 | /** 331 | * @return the lastname 332 | */ 333 | public String getLastname() { 334 | return lastname; 335 | } 336 | 337 | /** 338 | * @param lastname the lastname to set 339 | * @return PreAuthorization 340 | */ 341 | public PreAuthorization setLastname(String lastname) { 342 | this.lastname = lastname; 343 | return this; 344 | } 345 | 346 | /** 347 | * @return the IP 348 | */ 349 | public String getIP() { 350 | return IP; 351 | } 352 | 353 | /** 354 | * @param IP the IP to set 355 | * @return PreAuthorization 356 | */ 357 | public PreAuthorization setIP(String IP) { 358 | this.IP = IP; 359 | return this; 360 | } 361 | 362 | /** 363 | * @return the txRef 364 | */ 365 | public String getTxRef() { 366 | return txRef; 367 | } 368 | 369 | /** 370 | * @param txRef the txRef to set 371 | * @return PreAuthorization 372 | */ 373 | public PreAuthorization setTxRef(String txRef) { 374 | this.txRef = txRef; 375 | return this; 376 | } 377 | 378 | /** 379 | * @return the redirect_url 380 | */ 381 | public String getRedirect_url() { 382 | return redirect_url; 383 | } 384 | 385 | /** 386 | * @param redirect_url the redirect_url to set 387 | * @return PreAuthorization 388 | */ 389 | public PreAuthorization setRedirect_url(String redirect_url) { 390 | this.redirect_url = redirect_url; 391 | return this; 392 | } 393 | 394 | /** 395 | * @return the device_fingerprint 396 | */ 397 | public String getDevice_fingerprint() { 398 | return device_fingerprint; 399 | } 400 | 401 | /** 402 | * @param device_fingerprint the device_fingerprint to set 403 | * @return PreAuthorization 404 | */ 405 | public PreAuthorization setDevice_fingerprint(String device_fingerprint) { 406 | this.device_fingerprint = device_fingerprint; 407 | return this; 408 | } 409 | 410 | /** 411 | * @return the charge_type 412 | */ 413 | public String getCharge_type() { 414 | return charge_type; 415 | } 416 | 417 | /** 418 | * @param charge_type the charge_type to set 419 | * @return PreAuthorization 420 | */ 421 | public PreAuthorization setCharge_type(String charge_type) { 422 | this.charge_type = charge_type; 423 | return this; 424 | } 425 | } 426 | -------------------------------------------------------------------------------- /src/main/java/com/github/theresasogunle/RaveConstant.java: -------------------------------------------------------------------------------- 1 | package com.github.theresasogunle; 2 | 3 | /** 4 | * @author Theresa 5 | */ 6 | public class RaveConstant { 7 | 8 | public static String SECRET_KEY; 9 | public static String PUBLIC_KEY; 10 | public static Environment ENVIRONMENT; 11 | 12 | } 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/com/github/theresasogunle/Refund.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.github.theresasogunle; 7 | 8 | 9 | import org.json.JSONObject; 10 | 11 | /** 12 | * 13 | * @author Theresa 14 | */ 15 | public class Refund { 16 | private ApiConnection apiConnection; 17 | final private RaveConstant key= new RaveConstant(); 18 | Endpoints end= new Endpoints(); 19 | private String ref; 20 | /** 21 | * @return JSONObject 22 | * 23 | */ 24 | public JSONObject refund(){ 25 | this.apiConnection = new ApiConnection(end.getRefundEndPoint()); 26 | ApiQuery api= new ApiQuery(); 27 | 28 | api.putParams("ref", this.getRef()); 29 | api.putParams("seckey", RaveConstant.SECRET_KEY); 30 | 31 | 32 | return this.apiConnection.connectAndQuery(api); 33 | } 34 | 35 | /** 36 | * @return the ref 37 | */ 38 | public String getRef() { 39 | return ref; 40 | } 41 | 42 | /** 43 | * @param ref the ref to set 44 | */ 45 | public void setRef(String ref) { 46 | this.ref = ref; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/github/theresasogunle/Transaction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | package com.github.theresasogunle; 7 | 8 | 9 | import org.json.JSONObject; 10 | 11 | /** 12 | * 13 | * @author Theresa 14 | */ 15 | public class Transaction { 16 | ApiConnection apiConnection; 17 | 18 | Endpoints end= new Endpoints(); 19 | private String flwref, txRef; 20 | 21 | //requery all failed transactions 22 | /** 23 | * @return JSONObject 24 | * 25 | */ 26 | public JSONObject verifyTransactionRequery(){ 27 | 28 | this.apiConnection = new ApiConnection(end.getVerifyEndPoint()); 29 | ApiQuery api= new ApiQuery(); 30 | api.putParams("txref", this.getTxRef()); 31 | api.putParams("flw_ref", this.getFlwref()); 32 | api.putParams("SECKEY", RaveConstant.SECRET_KEY ); 33 | 34 | return this.apiConnection.connectAndQuery(api); 35 | } 36 | 37 | /** 38 | * @return JSONObject 39 | * 40 | */ 41 | public JSONObject verifyTransactionXrequery(){ 42 | 43 | this.apiConnection = new ApiConnection(end.getVerifyXrequeryEndPoint()); 44 | 45 | ApiQuery api= new ApiQuery(); 46 | 47 | api.putParams("txref", this.getTxRef()); 48 | api.putParams("txref", this.getTxRef()); 49 | api.putParams("SECKEY", RaveConstant.SECRET_KEY); 50 | api.putParams("last_attempt", 1); 51 | api.putParams("only_successful", 1); 52 | 53 | return this.apiConnection.connectAndQuery(api); 54 | } 55 | 56 | /** 57 | * @return the flwref 58 | */ 59 | public String getFlwref() { 60 | return flwref; 61 | } 62 | 63 | /** 64 | * @param flwref the flwref to set 65 | * @return Transaction 66 | */ 67 | public Transaction setFlwref(String flwref) { 68 | this.flwref = flwref; 69 | return this; 70 | } 71 | 72 | /** 73 | * @return the txRef 74 | */ 75 | public String getTxRef() { 76 | return txRef; 77 | } 78 | 79 | /** 80 | * @param txRef the txRef to set 81 | * @return Transaction 82 | */ 83 | public Transaction setTxRef(String txRef) { 84 | this.txRef = txRef; 85 | return this; 86 | } 87 | 88 | 89 | 90 | } 91 | -------------------------------------------------------------------------------- /target/Rave-1.0.1-jar-with-dependencies.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/Rave-1.0.1-jar-with-dependencies.jar -------------------------------------------------------------------------------- /target/Rave-1.0.1-jar-with-dependencies.jar.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNATURE----- 2 | 3 | iQEzBAABCAAdFiEElbpyer/KdhNKVnk1bSZ9LSalrokFAlrgocUACgkQbSZ9LSal 4 | ronrXggAmKZewAvQj4DfNcgx8e0KPB/8BM7XVW4PGQnTCb4epahiN6NHtpffkQzi 5 | b9wZx2pwgLznYW45OgZNxiK3ImmVCAl5wITaOVs4I7FlNXSD9qeiQgjcpzKxb262 6 | Jhsdx5XfAg/ZEbIeYB5RsZPshrgykFKsj5iaXQuaRIOJCXALDlVmefoY7JrjZI0H 7 | 1a/Jouylq/dfxgBPvRcRSVa2h0qosNyCTbTiPdBzXddReGNXjrPqy0xNczO7Z2Cv 8 | +nQ0mDMBVlPW7lJPZmjgoOTcilYkrlCk9gAyz3yKp9XDWVMpiS0iAWBzKDMWXRso 9 | VvfdeBXxbEjTh9o969odNdZcX0pAdg== 10 | =kAVx 11 | -----END PGP SIGNATURE----- 12 | -------------------------------------------------------------------------------- /target/Rave-1.0.1-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/Rave-1.0.1-javadoc.jar -------------------------------------------------------------------------------- /target/Rave-1.0.1-javadoc.jar.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNATURE----- 2 | 3 | iQEzBAABCAAdFiEElbpyer/KdhNKVnk1bSZ9LSalrokFAlrgocUACgkQbSZ9LSal 4 | ronQjgf6AoxZDCtbBhCsmWgeKrjREl5ASY+cjeo86GF8v7RPg3OM4hqFw8m9C0Su 5 | QBZe0t93jzZ9DDBe2eF2Pxyf1tEM0tNaRQ0QL/S3wwPsCjmr7U6LL9k0r5uUIF9q 6 | Ihl6NJuvozRM0JA9vjE4lCCBX+0sfieHxQF8GLBJjBzfqyBtjuLcNh4e+X8w04Da 7 | +z3A8qglNIwplEDtEPDkE9C6r4jnETbljaRtyU4bWxPyFGMqHszwVSnd83CfSUlg 8 | cy4i58q+RDpf6SvgKT/iDfePrjNtGfiwurOP2Jdl9kscqej3Ka5CVzsCntpmocqh 9 | 7mEaKGZQBmoPPNLZQG0rVJpsvAh8ww== 10 | =qHU7 11 | -----END PGP SIGNATURE----- 12 | -------------------------------------------------------------------------------- /target/Rave-1.0.1-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/Rave-1.0.1-sources.jar -------------------------------------------------------------------------------- /target/Rave-1.0.1-sources.jar.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNATURE----- 2 | 3 | iQEzBAABCAAdFiEElbpyer/KdhNKVnk1bSZ9LSalrokFAlrgocUACgkQbSZ9LSal 4 | rol3Sgf/cp3bdjVT5HKLHi0W+lIwpzbwzKJXl6G5Lbs04+7aP8n1n+FlqXxNcuSY 5 | 1cFjuUkyaAz1gTqoAaDCYiwLY80TNG6IwckmbJg9iSP4nEtBIJgTYwXEDzdQW2UU 6 | aevoLhaOIziiIJiQEOswbFHEE95MpxIRJokcYAoWW5ZW+H5tyat7O9n81wJ7GFbb 7 | plZBdcqSKXqQXQoiZN6S+vCm66jucsesiecyxX9fXI2c1agnnT0GKZiLutYWYLHQ 8 | rVX4/4EhuNDQCZ0e+33lytWC+/f000jydwVzFQ6vKygvXXsTW1922Mide1HxzvOZ 9 | 8aStavJx3Cu0OadqIqJSoAp0SRYX5w== 10 | =rh6E 11 | -----END PGP SIGNATURE----- 12 | -------------------------------------------------------------------------------- /target/Rave-1.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/Rave-1.0.1.jar -------------------------------------------------------------------------------- /target/Rave-1.0.1.jar.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNATURE----- 2 | 3 | iQEzBAABCAAdFiEElbpyer/KdhNKVnk1bSZ9LSalrokFAlrgocQACgkQbSZ9LSal 4 | rokNWAf/dL/Z4NfgEPmBJjrjwBqmKJHQq8Pwme7huTR5Cr1bc4avtCjeEZas2zFS 5 | 0PtsREf+7iC7mHrIs9QRzB0Nnck1i+qaZZ6XL/xf35u9xbvhvCH4Y1/1obnLZ/UD 6 | 30gufoxAaKeJbzrOxwCRY8ebLw/N4+lb2UICIHnYo05cnX0mcu6P4C8/PtFtl7Qy 7 | r4su/XAlgqYAfdIT/SNJDHrF5F1pa3t/CKtNvzaUYDROMQp7WZe7WANiBz0RLf3m 8 | ikkBku7an1GbqyllsBBqNm3BnyfykLr8wmr6BMscXt0YqaVgy+PSPZ4qs754W2oA 9 | iTH6FRpW2aegTPit+55Tu3rKehg0yg== 10 | =wJqK 11 | -----END PGP SIGNATURE----- 12 | -------------------------------------------------------------------------------- /target/Rave-1.0.1.pom: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | com.github.theresasogunle 5 | Rave 6 | 1.0.1 7 | jar 8 | Rave 9 | 10 | UTF-8 11 | 1.7 12 | 1.7 13 | 14 | A rave java library 15 | 16 | com.github.theresasogunle 17 | https://github.com/theresasogunle/Rave-Java 18 | 19 | 20 | 21 | 22 | bintray-theresasogunle-Rave 23 | theresasogunle-Rave 24 | https://api.bintray.com/maven/theresasogunle/Rave/Rave/;publish=1 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | org.apache.maven.plugins 33 | maven-compiler-plugin 34 | 2.3.2 35 | 36 | 1.8 37 | 1.8 38 | 39 | 40 | 41 | maven-assembly-plugin 42 | 2.3 43 | 44 | 45 | jar-with-dependencies 46 | 47 | 48 | 49 | 50 | package 51 | 52 | single 53 | 54 | 55 | 56 | 57 | 58 | org.apache.maven.plugins 59 | maven-source-plugin 60 | 2.1.2 61 | 62 | 63 | attach-sources 64 | 65 | jar 66 | 67 | 68 | 69 | 70 | 71 | 72 | org.apache.maven.plugins 73 | maven-gpg-plugin 74 | 75 | 76 | sign-artifacts 77 | verify 78 | 79 | sign 80 | 81 | 82 | 83 | 84 | 85 | org.apache.maven.plugins 86 | maven-release-plugin 87 | 2.4.2 88 | 89 | 90 | 91 | org.sonarsource.java 92 | sonar-java-plugin 93 | 4.4.0.8066 94 | 95 | 96 | 97 | org.apache.maven.plugins 98 | maven-compiler-plugin 99 | 2.3.2 100 | 101 | 1.8 102 | 1.8 103 | 104 | 105 | 106 | maven-assembly-plugin 107 | 2.3 108 | 109 | 110 | jar-with-dependencies 111 | 112 | 113 | 114 | 115 | package 116 | 117 | single 118 | 119 | 120 | 121 | 122 | 123 | org.apache.maven.plugins 124 | maven-source-plugin 125 | 2.1.2 126 | 127 | 128 | attach-sources 129 | 130 | jar 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | org.jacoco 139 | jacoco-maven-plugin 140 | 0.7.4.201502262128 141 | 142 | 143 | jacoco-initialize 144 | 145 | prepare-agent 146 | 147 | 148 | 149 | 150 | jacoco-report 151 | 152 | 153 | report 154 | 155 | 156 | 157 | 158 | 159 | org.eluder.coveralls 160 | coveralls-maven-plugin 161 | 4.3.0 162 | 163 | dakvAtKl39YvqHlqpvkHQb26M7CZMEsNg 164 | 165 | 166 | 167 | org.apache.maven.plugins 168 | maven-javadoc-plugin 169 | 170 | true 171 | true 172 | true 173 | true 174 | true 175 | 176 | 177 | 178 | 179 | attach-javadocs 180 | 181 | jar 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | com.sun 195 | tools 196 | 1.8 197 | system 198 | C:\Program Files\Java\jdk1.8.0_11\lib\tools.jar 199 | 200 | 201 | commons-logging 202 | commons-logging 203 | 1.1.3 204 | 205 | 206 | 207 | org.apache.httpcomponents 208 | httpasyncclient 209 | 4.0.2 210 | 211 | 212 | 213 | org.apache.httpcomponents 214 | httpclient 215 | 4.3.2 216 | 217 | 218 | 219 | 220 | 221 | 222 | org.apache.httpcomponents 223 | httpcore 224 | 4.4.4 225 | 226 | 227 | 228 | org.apache.httpcomponents 229 | httpcore-nio 230 | 4.3-beta2 231 | 232 | 233 | 234 | org.apache.httpcomponents 235 | httpmime 236 | 4.3.6 237 | 238 | 239 | 240 | org.json 241 | json 242 | 20180130 243 | 244 | 245 | 246 | com.mashape.unirest 247 | unirest-java 248 | 1.4.9 249 | 250 | 251 | 252 | 253 | 254 | 255 | org.slf4j 256 | slf4j-api 257 | 1.7.7 258 | 259 | 260 | 261 | ch.qos.logback 262 | logback-core 263 | 1.1.3 264 | 265 | 266 | 267 | ch.qos.logback 268 | logback-classic 269 | 1.1.3 270 | 271 | 272 | 273 | 274 | junit 275 | junit 276 | 4.12 277 | 278 | 279 | 280 | net.sourceforge.cobertura 281 | cobertura 282 | 2.1.1 283 | test 284 | 285 | 286 | 287 | net.minidev 288 | json-smart 289 | 2.2 290 | 291 | 292 | 293 | com.jayway.jsonpath 294 | json-path 295 | 2.4.0 296 | 297 | 298 | 299 | org.skyscreamer 300 | jsonassert 301 | 1.2.3 302 | 303 | 304 | 305 | 306 | org.hamcrest 307 | hamcrest-core 308 | 1.3 309 | 310 | 311 | 312 | 313 | commons-codec 314 | commons-codec 315 | 1.6 316 | 317 | 318 | 319 | 320 | -------------------------------------------------------------------------------- /target/Rave-1.0.1.pom.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNATURE----- 2 | 3 | iQEzBAABCAAdFiEElbpyer/KdhNKVnk1bSZ9LSalrokFAlrgocQACgkQbSZ9LSal 4 | ronwVgf+OuMe9ZayXGr3hFu3LvH/bV61LVhVJX9h2CA+/UpYTaBZRukwvFXuaXaw 5 | koHDQGLXBFnpgl6NnvemNiQN/cY8zxa/tssgQo9yQ6DPxPZZrZcBYdKVE8+xVqso 6 | urg7SQWatAGEUt2wtUBETlPHaWR9gd2vPjt/Ml8Qf7v1RMFj43IZLokzgu6Pe1MH 7 | FB4RTPv0MC6z4tWLOJF53UnlyaZCIXs1Cq2r/RVchDVaO/bERzn0JcIIdQVelWey 8 | RXwHs13ohPfeRkvbWbVqZnX33CXh8floylpt2TCuLv+Ouqx+8U59yOOVu3oAUqvZ 9 | dPNsoR8+aYhdQAZVG5A2V8h0fEFD9A== 10 | =bTnv 11 | -----END PGP SIGNATURE----- 12 | -------------------------------------------------------------------------------- /target/classes/.netbeans_automatic_build: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/.netbeans_automatic_build -------------------------------------------------------------------------------- /target/classes/com/github/theresasogunle/AccountCharge.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/com/github/theresasogunle/AccountCharge.class -------------------------------------------------------------------------------- /target/classes/com/github/theresasogunle/AlternativePayment.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/com/github/theresasogunle/AlternativePayment.class -------------------------------------------------------------------------------- /target/classes/com/github/theresasogunle/ApiConnection.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/com/github/theresasogunle/ApiConnection.class -------------------------------------------------------------------------------- /target/classes/com/github/theresasogunle/ApiQuery.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/com/github/theresasogunle/ApiQuery.class -------------------------------------------------------------------------------- /target/classes/com/github/theresasogunle/Bank.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/com/github/theresasogunle/Bank.class -------------------------------------------------------------------------------- /target/classes/com/github/theresasogunle/CardCharge.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/com/github/theresasogunle/CardCharge.class -------------------------------------------------------------------------------- /target/classes/com/github/theresasogunle/Charge.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/com/github/theresasogunle/Charge.class -------------------------------------------------------------------------------- /target/classes/com/github/theresasogunle/Encryption.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/com/github/theresasogunle/Encryption.class -------------------------------------------------------------------------------- /target/classes/com/github/theresasogunle/Endpoints.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/com/github/theresasogunle/Endpoints.class -------------------------------------------------------------------------------- /target/classes/com/github/theresasogunle/Environment.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/com/github/theresasogunle/Environment.class -------------------------------------------------------------------------------- /target/classes/com/github/theresasogunle/ExchangeRates.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/com/github/theresasogunle/ExchangeRates.class -------------------------------------------------------------------------------- /target/classes/com/github/theresasogunle/Fees.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/com/github/theresasogunle/Fees.class -------------------------------------------------------------------------------- /target/classes/com/github/theresasogunle/IntegrityChecksum.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/com/github/theresasogunle/IntegrityChecksum.class -------------------------------------------------------------------------------- /target/classes/com/github/theresasogunle/Polling.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/com/github/theresasogunle/Polling.class -------------------------------------------------------------------------------- /target/classes/com/github/theresasogunle/PreAuthorization.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/com/github/theresasogunle/PreAuthorization.class -------------------------------------------------------------------------------- /target/classes/com/github/theresasogunle/RaveConstant.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/com/github/theresasogunle/RaveConstant.class -------------------------------------------------------------------------------- /target/classes/com/github/theresasogunle/Refund.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/com/github/theresasogunle/Refund.class -------------------------------------------------------------------------------- /target/classes/com/github/theresasogunle/Transaction.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/classes/com/github/theresasogunle/Transaction.class -------------------------------------------------------------------------------- /target/jacoco.exec: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/jacoco.exec -------------------------------------------------------------------------------- /target/javadoc-bundle-options/javadoc-options-javadoc-resources.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | src/main/javadoc 10 | 11 | -------------------------------------------------------------------------------- /target/javadoc-bundle-options/package-list: -------------------------------------------------------------------------------- 1 | java.applet 2 | java.awt 3 | java.awt.color 4 | java.awt.datatransfer 5 | java.awt.dnd 6 | java.awt.event 7 | java.awt.font 8 | java.awt.geom 9 | java.awt.im 10 | java.awt.im.spi 11 | java.awt.image 12 | java.awt.image.renderable 13 | java.awt.print 14 | java.beans 15 | java.beans.beancontext 16 | java.io 17 | java.lang 18 | java.lang.annotation 19 | java.lang.instrument 20 | java.lang.invoke 21 | java.lang.management 22 | java.lang.ref 23 | java.lang.reflect 24 | java.math 25 | java.net 26 | java.nio 27 | java.nio.channels 28 | java.nio.channels.spi 29 | java.nio.charset 30 | java.nio.charset.spi 31 | java.nio.file 32 | java.nio.file.attribute 33 | java.nio.file.spi 34 | java.rmi 35 | java.rmi.activation 36 | java.rmi.dgc 37 | java.rmi.registry 38 | java.rmi.server 39 | java.security 40 | java.security.acl 41 | java.security.cert 42 | java.security.interfaces 43 | java.security.spec 44 | java.sql 45 | java.text 46 | java.text.spi 47 | java.time 48 | java.time.chrono 49 | java.time.format 50 | java.time.temporal 51 | java.time.zone 52 | java.util 53 | java.util.concurrent 54 | java.util.concurrent.atomic 55 | java.util.concurrent.locks 56 | java.util.function 57 | java.util.jar 58 | java.util.logging 59 | java.util.prefs 60 | java.util.regex 61 | java.util.spi 62 | java.util.stream 63 | java.util.zip 64 | javax.accessibility 65 | javax.activation 66 | javax.activity 67 | javax.annotation 68 | javax.annotation.processing 69 | javax.crypto 70 | javax.crypto.interfaces 71 | javax.crypto.spec 72 | javax.imageio 73 | javax.imageio.event 74 | javax.imageio.metadata 75 | javax.imageio.plugins.bmp 76 | javax.imageio.plugins.jpeg 77 | javax.imageio.spi 78 | javax.imageio.stream 79 | javax.jws 80 | javax.jws.soap 81 | javax.lang.model 82 | javax.lang.model.element 83 | javax.lang.model.type 84 | javax.lang.model.util 85 | javax.management 86 | javax.management.loading 87 | javax.management.modelmbean 88 | javax.management.monitor 89 | javax.management.openmbean 90 | javax.management.relation 91 | javax.management.remote 92 | javax.management.remote.rmi 93 | javax.management.timer 94 | javax.naming 95 | javax.naming.directory 96 | javax.naming.event 97 | javax.naming.ldap 98 | javax.naming.spi 99 | javax.net 100 | javax.net.ssl 101 | javax.print 102 | javax.print.attribute 103 | javax.print.attribute.standard 104 | javax.print.event 105 | javax.rmi 106 | javax.rmi.CORBA 107 | javax.rmi.ssl 108 | javax.script 109 | javax.security.auth 110 | javax.security.auth.callback 111 | javax.security.auth.kerberos 112 | javax.security.auth.login 113 | javax.security.auth.spi 114 | javax.security.auth.x500 115 | javax.security.cert 116 | javax.security.sasl 117 | javax.sound.midi 118 | javax.sound.midi.spi 119 | javax.sound.sampled 120 | javax.sound.sampled.spi 121 | javax.sql 122 | javax.sql.rowset 123 | javax.sql.rowset.serial 124 | javax.sql.rowset.spi 125 | javax.swing 126 | javax.swing.border 127 | javax.swing.colorchooser 128 | javax.swing.event 129 | javax.swing.filechooser 130 | javax.swing.plaf 131 | javax.swing.plaf.basic 132 | javax.swing.plaf.metal 133 | javax.swing.plaf.multi 134 | javax.swing.plaf.nimbus 135 | javax.swing.plaf.synth 136 | javax.swing.table 137 | javax.swing.text 138 | javax.swing.text.html 139 | javax.swing.text.html.parser 140 | javax.swing.text.rtf 141 | javax.swing.tree 142 | javax.swing.undo 143 | javax.tools 144 | javax.transaction 145 | javax.transaction.xa 146 | javax.xml 147 | javax.xml.bind 148 | javax.xml.bind.annotation 149 | javax.xml.bind.annotation.adapters 150 | javax.xml.bind.attachment 151 | javax.xml.bind.helpers 152 | javax.xml.bind.util 153 | javax.xml.crypto 154 | javax.xml.crypto.dom 155 | javax.xml.crypto.dsig 156 | javax.xml.crypto.dsig.dom 157 | javax.xml.crypto.dsig.keyinfo 158 | javax.xml.crypto.dsig.spec 159 | javax.xml.datatype 160 | javax.xml.namespace 161 | javax.xml.parsers 162 | javax.xml.soap 163 | javax.xml.stream 164 | javax.xml.stream.events 165 | javax.xml.stream.util 166 | javax.xml.transform 167 | javax.xml.transform.dom 168 | javax.xml.transform.sax 169 | javax.xml.transform.stax 170 | javax.xml.transform.stream 171 | javax.xml.validation 172 | javax.xml.ws 173 | javax.xml.ws.handler 174 | javax.xml.ws.handler.soap 175 | javax.xml.ws.http 176 | javax.xml.ws.soap 177 | javax.xml.ws.spi 178 | javax.xml.ws.spi.http 179 | javax.xml.ws.wsaddressing 180 | javax.xml.xpath 181 | org.ietf.jgss 182 | org.omg.CORBA 183 | org.omg.CORBA.DynAnyPackage 184 | org.omg.CORBA.ORBPackage 185 | org.omg.CORBA.TypeCodePackage 186 | org.omg.CORBA.portable 187 | org.omg.CORBA_2_3 188 | org.omg.CORBA_2_3.portable 189 | org.omg.CosNaming 190 | org.omg.CosNaming.NamingContextExtPackage 191 | org.omg.CosNaming.NamingContextPackage 192 | org.omg.Dynamic 193 | org.omg.DynamicAny 194 | org.omg.DynamicAny.DynAnyFactoryPackage 195 | org.omg.DynamicAny.DynAnyPackage 196 | org.omg.IOP 197 | org.omg.IOP.CodecFactoryPackage 198 | org.omg.IOP.CodecPackage 199 | org.omg.Messaging 200 | org.omg.PortableInterceptor 201 | org.omg.PortableInterceptor.ORBInitInfoPackage 202 | org.omg.PortableServer 203 | org.omg.PortableServer.CurrentPackage 204 | org.omg.PortableServer.POAManagerPackage 205 | org.omg.PortableServer.POAPackage 206 | org.omg.PortableServer.ServantLocatorPackage 207 | org.omg.PortableServer.portable 208 | org.omg.SendingContext 209 | org.omg.stub.java.rmi 210 | org.w3c.dom 211 | org.w3c.dom.bootstrap 212 | org.w3c.dom.events 213 | org.w3c.dom.ls 214 | org.w3c.dom.views 215 | org.xml.sax 216 | org.xml.sax.ext 217 | org.xml.sax.helpers 218 | -------------------------------------------------------------------------------- /target/maven-archiver/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven 2 | #Wed Apr 25 16:40:43 WAT 2018 3 | version=1.0.1 4 | groupId=com.github.theresasogunle 5 | artifactId=Rave 6 | -------------------------------------------------------------------------------- /target/test-classes/.netbeans_automatic_build: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/theresasogunle/Rave-Java-Library/5c71759ceb825161c12b4d13ea8f644d8eef09df/target/test-classes/.netbeans_automatic_build --------------------------------------------------------------------------------