├── .gitignore ├── Keys.json ├── LICENSE ├── README.md ├── pom.xml ├── src ├── me │ └── iyanuadelekan │ │ └── paystackjava │ │ ├── constants │ │ └── Definitions.java │ │ └── core │ │ ├── ApiConnection.java │ │ ├── ApiQuery.java │ │ ├── Customers.java │ │ ├── Keys.java │ │ ├── Pages.java │ │ ├── PaystackInline.java │ │ ├── Plans.java │ │ ├── Subscriptions.java │ │ └── Transactions.java └── test │ └── java │ └── Test.java └── target ├── classes ├── Main.class └── me │ └── iyanuadelekan │ └── paystackjava │ ├── constants │ └── Definitions.class │ └── core │ ├── ApiConnection.class │ ├── ApiQuery.class │ ├── Customers.class │ ├── Keys.class │ ├── Pages.class │ ├── PaystackInline.class │ ├── Plans.class │ ├── Subscriptions.class │ └── Transactions.class ├── maven-archiver └── pom.properties ├── maven-status └── maven-compiler-plugin │ ├── compile │ └── default-compile │ │ ├── createdFiles.lst │ │ └── inputFiles.lst │ └── testCompile │ └── default-testCompile │ ├── createdFiles.lst │ └── inputFiles.lst ├── paystackjava-1.1.0.jar ├── surefire-reports ├── TEST-test.java.Tests.xml └── test.java.Tests.txt └── test-classes └── test └── java └── Test.class /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Example user template template 3 | ### Example user template 4 | 5 | # IntelliJ project files 6 | .idea 7 | bin 8 | boot 9 | conf 10 | lib 11 | *.iml 12 | .DS_Store 13 | out 14 | gen 15 | -------------------------------------------------------------------------------- /Keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "API_KEYS": { 3 | "KEY_IN_USE": "sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 4 | "TEST_SECRET_KEY": "sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 5 | "TEST_PUBLIC_KEY": "pk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 6 | "LIVE_SECRET_KEY": "sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 7 | "LIVE_PUBLIC_KEY": "pk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Iyanu Adelekan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Issue Count](https://codeclimate.com/github/SeunAdelekan/PaystackJava/badges/issue_count.svg)](https://codeclimate.com/github/SeunAdelekan/PaystackJava) 2 | [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) 3 | 4 | # PaystackJava 5 | 6 | A Java API wrapper for the facilitation of quick and easy development and integration of Java based applications with the the Paystack API. 7 | 8 | PaystackJava removes the grunt involved in consuming the Paystack API and implements a diverse array of helper methods to enable rapid prototyping and testing. 9 | 10 | ## Links 11 | - Project: https://github.com/IyanuAdelekan/PaystackJava 12 | 13 | 14 | ## Getting started 15 | ### Dependencies: 16 | - Unirest (Installation procedures here: https://github.com/Mashape/unirest-java#installing) 17 | 18 | ### PaystackJava installation: 19 | - Download PaystackJava 20 | - Add jar file as a Module to your Java project: 21 | - On Intellij IDEA: File -> Project Structure -> Modules -> Dependencies Tab -> Add -> JARs or Directories -> Attach jar 22 | - On Netbeans: Project properties -> Libraries -> Compile -> ADD JAR/folder -> Add Jar 23 | 24 | 25 | ## Examples 26 | 27 | To create a new Paystack customer: 28 | ```java 29 | Customers customers = new Customers(); 30 | customers.createCustomer("[email]","[first_name]","[last_name]","[phone]","[metadata]"); 31 | ``` 32 | 33 | To fetch a customer 34 | ```java 35 | Customers customers = new Customers(); 36 | customers.fetchCustomer("[id_or_customer_code]"); 37 | ``` 38 | 39 | But what if you want to get the server JSON respone? 40 | ```java 41 | Customers customers = new Customers(); 42 | JSONObject jsonObject = new JSONObject(customers.fetchCustomer("[id_or_customer_code]")); 43 | ``` 44 | 45 | Want to initialize a Paystack transaction? 46 | ```java 47 | Transactions transactions = new Transactions(); 48 | transactions.initializeTransaction("[reference]","[amount]","[email]","[plan]","[callback_url]"); 49 | ``` 50 | 51 | Don't like using strings to make your API requests? 52 | ```java 53 | ApiQuery apiQuery = new ApiQuery(); 54 | apiQuery.putParams("name","Offering collections"); 55 | new Pages().createPage(apiQuery); 56 | ``` 57 | 58 | Or maybe you just love using HashMaps 59 | ```java 60 | HashMap query = new HashMap(); 61 | query.put("name","Offering collections"); 62 | new Pages().createPage(query); 63 | ``` 64 | 65 | 66 | **Remember to always shut down the API connection once you are done making requests** 67 | #### PaystackJava utilizes a background event loop and your Java application won't be able to exit until you manually shutdown all the threads by invoking: 68 | ```java 69 | ApiConnection.shutDown(); 70 | ``` 71 | 72 | ## NOTE 73 | ### PaystackJava utilizes a Keys.json file for the management of api key resources. This file must be placed in your root project directory and has the following structure: 74 | ```json 75 | { 76 | "API_KEYS":{ 77 | "KEY_IN_USE": "sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 78 | "TEST_SECRET_KEY": "sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 79 | "TEST_PUBLIC_KEY": "pk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 80 | "LIVE_SECRET_KEY": "sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 81 | "LIVE_PUBLIC_KEY": "pk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 82 | } 83 | } 84 | ``` 85 | ### The value attached to KEY_IN_USE is the value used for Authorization by PaystackJava 86 | 87 | ## Utilities at a glance 88 | ### ApiConnection {Class}: 89 | #### methods: 90 | - connectAndQuery [JSONObject] 91 | - connectAndQueryWithGet [JSONObject] 92 | - connectAndQueryWithPut [JSONObject] 93 | - shutDown [void] 94 | 95 | ### ApiQuery {Class}: 96 | #### methods: 97 | - newQuery [void] 98 | - putParams [JSONObject] 99 | 100 | ### PaystackInline {Class}: 101 | #### methods: 102 | - paystackStandard [JSONObject] 103 | - verifyTransactions [JSONObject] 104 | - chargeReturningCustomer [JSONObject] 105 | - updateCustomer [JSONObject] 106 | 107 | ### Customers {Class}: 108 | #### methods: 109 | - createCustomer [JSONObject] 110 | - listCustomers [JSONObject] 111 | - fetchCustomer [JSONObject] 112 | - updateCustomer [JSONObject] 113 | 114 | ### Customers {Class}: 115 | #### methods: 116 | - createCustomer [JSONObject] 117 | - listCustomers [JSONObject] 118 | - fetchCustomer [JSONObject] 119 | - updateCustomer [JSONObject] 120 | 121 | ### Transactions {Class}: 122 | #### methods: 123 | - initializeTransaction [JSONObject] 124 | - verifyTransaction [JSONObject] 125 | - listTransactions [JSONObject] 126 | - fetchTransaction [JSONObject] 127 | - chargeAuthorization [JSONObject] 128 | - chargeToken [JSONObject] 129 | - exportTransactions [JSONObject] 130 | 131 | ### Plans {Class}: 132 | #### methods: 133 | - listPlans [JSONObject] 134 | - fetchPlan [JSONObject] 135 | - updatePlan [JSONObject] 136 | - updateCustomer [JSONObject] 137 | 138 | ### Pages {Class}: 139 | #### methods: 140 | - createPage [JSONObject] 141 | - listPages [JSONObject] 142 | - fetchPage [JSONObject] 143 | - updatePage [JSONObject] 144 | 145 | License 146 | ---- 147 | 148 | The MIT License (MIT) 149 | 150 | Copyright (c) 2016 Iyanu Adelekan 151 | 152 | Permission is hereby granted, free of charge, to any person obtaining a copy 153 | of this software and associated documentation files (the "Software"), to deal 154 | in the Software without restriction, including without limitation the rights 155 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 156 | copies of the Software, and to permit persons to whom the Software is 157 | furnished to do so, subject to the following conditions: 158 | 159 | The above copyright notice and this permission notice shall be included in all 160 | copies or substantial portions of the Software. 161 | 162 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 163 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 164 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 165 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 166 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 167 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 168 | SOFTWARE. 169 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | me.iyanuadelekan 6 | paystackjava 7 | jar 8 | 1.1.0 9 | 10 | PaystackJava 11 | A Java based API wrapper for the Paystack API 💰💸💰💰 12 | https://github.com/SeunAdelekan/PaystackJava 13 | 14 | 15 | 16 | The MIT License (MIT) 17 | https://github.com/SeunAdelekan/PaystackJava/blob/master/LICENSE 18 | repo 19 | 20 | 21 | 22 | 23 | scm:git:https://github.com/SeunAdelekan/PaystackJava.git 24 | HEAD 25 | https://github.com/SeunAdelekan/PaystackJava 26 | 27 | 28 | 29 | src 30 | 31 | 32 | 33 | 34 | com.mashape.unirest 35 | unirest-java 36 | 1.4.9 37 | 38 | 39 | org.apache.httpcomponents 40 | httpclient 41 | 4.5.3 42 | 43 | 44 | org.apache.httpcomponents 45 | httpasyncclient 46 | 4.1.3 47 | 48 | 49 | org.apache.httpcomponents 50 | httpmime 51 | 4.5.3 52 | 53 | 54 | org.json 55 | json 56 | 20170516 57 | 58 | 59 | junit 60 | junit 61 | 4.12 62 | test 63 | 64 | 65 | -------------------------------------------------------------------------------- /src/me/iyanuadelekan/paystackjava/constants/Definitions.java: -------------------------------------------------------------------------------- 1 | package me.iyanuadelekan.paystackjava.constants; 2 | 3 | /** 4 | * @author Iyanu Adelekan on 17/07/2016. 5 | */ 6 | public class Definitions { 7 | 8 | /** 9 | * The following are URL definitions for the Paystack API. All URLs are 10 | * RESTful endpoints and as such modification of any of these URL resources 11 | * will lead to problems with querying the Paystack API. Only modify if you 12 | * know what you are doing. 13 | */ 14 | private final static String BASE_API_ENDPOINT = "https://api.paystack.co"; 15 | 16 | public static final String PAYSTACK_INLINE_PAYSTACK_STANDARD = BASE_API_ENDPOINT + "/transaction/initialize"; 17 | public static final String PAYSTACK_INLINE_VERIFY_TRANSACTIONS = BASE_API_ENDPOINT + "/transaction/verify/"; 18 | public static final String PAYSTACK_INLINE_CHARGE_AUTHORIZATION = BASE_API_ENDPOINT + "/transaction/charge_authorization"; 19 | 20 | //URL definitions for customer endpoint 21 | public static final String PAYSTACK_CUSTOMERS_CREATE_CUSTOMER = BASE_API_ENDPOINT + "/customer"; 22 | public static final String PAYSTACK_CUSTOMERS_LIST_CUSTOMERS = BASE_API_ENDPOINT + "/customer"; 23 | public static final String PAYSTACK_CUSTOMERS_FETCH_CUSTOMER = BASE_API_ENDPOINT + "/customer/"; 24 | public static final String PAYSTACK_CUSTOMERS_UPDATE_CUSTOMER = BASE_API_ENDPOINT + "/customer/"; 25 | 26 | //URL definitions for transaction endpoints 27 | public static final String PAYSTACK_TRANSACTIONS_INITIALIZE_TRANSACTION = BASE_API_ENDPOINT + "/transaction/initialize"; 28 | public static final String PAYSTACK_TRANSACTIONS_VERIFY_TRANSACTION = BASE_API_ENDPOINT + "/transaction/verify/"; 29 | public static final String PAYSTACK_TRANSACTIONS_LIST_TRANSACTIONS = BASE_API_ENDPOINT + "/transaction"; 30 | public static final String PAYSTACK_TRANSACTIONS_FETCH_TRANSACTION = BASE_API_ENDPOINT + "/transaction/"; 31 | public static final String PAYSTACK_TRANSACTIONS_CHARGE_AUTHORIZATION = BASE_API_ENDPOINT + "/transaction/charge_authorization"; 32 | public static final String PAYSTACK_TRANSACTIONS_CHARGE_TOKEN = BASE_API_ENDPOINT + "/transaction/charge_token"; 33 | public static final String PAYSTACK_TRANSACTIONS_EXPORT_TRANSACTIONS = BASE_API_ENDPOINT + "/transaction/export"; 34 | 35 | //URL definitions for plan endpoint 36 | public static final String PAYSTACK_PLANS_CREATE_PLAN = BASE_API_ENDPOINT + "/plan"; 37 | public static final String PAYSTACK_PLANS_LIST_PLANS = BASE_API_ENDPOINT + "/plan"; 38 | public static final String PAYSTACK_PLANS_FETCH_PLAN = BASE_API_ENDPOINT + "/plan/"; 39 | public static final String PAYSTACK_PLANS_UPDATE_PLAN = BASE_API_ENDPOINT + "/plan/"; 40 | 41 | //URL definitions for subscription endpoints 42 | public static final String PAYSTACK_SUBSCRIPTIONS_CREATE_SUBSCRIPTION = BASE_API_ENDPOINT + "/subscription"; 43 | public static final String PAYSTACK_SUBSCRIPTIONS_DISABLE_SUBSCRIPTION = BASE_API_ENDPOINT + "/subscription/disable"; 44 | public static final String PAYSTACK_SUBSCRIPTIONS_ENABLE_SUBSCRIPTION = BASE_API_ENDPOINT + "/subscription/enable"; 45 | public static final String PAYSTACK_SUBSCRIPTIONS_FETCH_SUBSCRIPTION = BASE_API_ENDPOINT + "/subscription/"; 46 | 47 | //URL definitions for page endpoint 48 | public static final String PAYSTACK_PAGES_CREATE_PAGE = BASE_API_ENDPOINT + "/page"; 49 | public static final String PAYSTACK_PAGES_LIST_PAGES = BASE_API_ENDPOINT + "/page"; 50 | public static final String PAYSTACK_PAGES_FETCH_PAGE = BASE_API_ENDPOINT + "/page/"; 51 | public static final String PAYSTACK_PAGES_UPDATE_PAGE = BASE_API_ENDPOINT + "/page/"; 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/me/iyanuadelekan/paystackjava/core/ApiConnection.java: -------------------------------------------------------------------------------- 1 | package me.iyanuadelekan.paystackjava.core; 2 | 3 | import com.mashape.unirest.http.HttpResponse; 4 | import com.mashape.unirest.http.JsonNode; 5 | import com.mashape.unirest.http.Unirest; 6 | import com.mashape.unirest.http.exceptions.UnirestException; 7 | import org.json.JSONObject; 8 | 9 | import java.io.FileNotFoundException; 10 | import java.io.IOException; 11 | import java.security.KeyManagementException; 12 | import java.security.NoSuchAlgorithmException; 13 | import java.util.HashMap; 14 | import java.util.logging.Level; 15 | import java.util.logging.Logger; 16 | import javax.net.ssl.SSLContext; 17 | import org.apache.http.conn.ssl.SSLConnectionSocketFactory; 18 | import static org.apache.http.conn.ssl.SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER; 19 | import org.apache.http.conn.ssl.SSLContexts; 20 | import org.apache.http.impl.client.CloseableHttpClient; 21 | import org.apache.http.impl.client.HttpClients; 22 | 23 | /** 24 | * @author Iyanu Adelekan on 17/07/2016. 25 | */ 26 | public class ApiConnection { 27 | 28 | private String url; 29 | private String apiKey; 30 | 31 | /** 32 | * @param url - Paystack API URL 33 | */ 34 | public ApiConnection(String url) { 35 | this.url = url; 36 | Keys keys = new Keys(); 37 | 38 | try { 39 | keys.initKeys(); 40 | } catch (FileNotFoundException e) { 41 | System.out.print("Required Keys.json file could not be found."); 42 | e.printStackTrace(); 43 | } 44 | 45 | this.apiKey = keys.KEY_IN_USE; 46 | this.enforceTlsV1point2(); 47 | } 48 | 49 | private void enforceTlsV1point2() { 50 | try { 51 | SSLContext sslContext = SSLContexts.custom() 52 | .useTLS() 53 | .build(); 54 | SSLConnectionSocketFactory f = new SSLConnectionSocketFactory( 55 | sslContext, 56 | new String[]{"TLSv1.2"}, 57 | null, 58 | BROWSER_COMPATIBLE_HOSTNAME_VERIFIER); 59 | CloseableHttpClient httpClient = HttpClients.custom() 60 | .setSSLSocketFactory(f) 61 | .build(); 62 | Unirest.setHttpClient(httpClient); 63 | 64 | } catch (NoSuchAlgorithmException ex) { 65 | Logger.getLogger(ApiConnection.class.getName()).log(Level.SEVERE, null, ex); 66 | } catch (KeyManagementException ex) { 67 | Logger.getLogger(ApiConnection.class.getName()).log(Level.SEVERE, null, ex); 68 | } 69 | } 70 | 71 | /** 72 | * Connects to and queries Paystack API with POST 73 | * 74 | * @param query - APIQuery containing parameters to send 75 | * @return - JSONObject containing API response 76 | */ 77 | public JSONObject connectAndQuery(ApiQuery query) { 78 | try { 79 | HttpResponse queryForResponse = Unirest.post(url) 80 | .header("Accept", "application/json") 81 | .header("Authorization", "Bearer " + apiKey) 82 | .fields(query.getParams()) 83 | .asJson(); 84 | return queryForResponse.getBody().getObject(); 85 | } catch (UnirestException e) { 86 | e.printStackTrace(); 87 | } 88 | return null; 89 | } 90 | 91 | /** 92 | * Connects to and queries API with POST 93 | * 94 | * @param query - HashMap containing parameters to send 95 | * @return - JSONObject containing API response 96 | */ 97 | public JSONObject connectAndQuery(HashMap query) { 98 | try { 99 | HttpResponse queryForResponse = Unirest.post(url) 100 | .header("Accept", "application/json") 101 | .header("Authorization", "Bearer " + apiKey) 102 | .fields(query) 103 | .asJson(); 104 | return queryForResponse.getBody().getObject(); 105 | } catch (UnirestException e) { 106 | e.printStackTrace(); 107 | } 108 | return null; 109 | } 110 | 111 | /** 112 | * Used to send a GET request to the Paystack API 113 | * 114 | * @return - JSONObject containing the API response 115 | */ 116 | public JSONObject connectAndQueryWithGet() { 117 | try { 118 | HttpResponse queryForResponse = Unirest.get(url) 119 | .header("Accept", "application/json") 120 | .header("Authorization", "Bearer " + apiKey) 121 | .asJson(); 122 | return queryForResponse.getBody().getObject(); 123 | } catch (UnirestException e) { 124 | e.printStackTrace(); 125 | } 126 | return null; 127 | } 128 | 129 | /** 130 | * Used to send a GET request to the Paystack API 131 | * 132 | * @param query - APIQuery containing parameters to send 133 | * @return - JSONObject containing API response 134 | */ 135 | public JSONObject connectAndQueryWithGet(ApiQuery query) { 136 | try { 137 | HttpResponse queryForResponse = Unirest.get(url) 138 | .header("Accept", "application/json") 139 | .header("Authorization", "Bearer " + apiKey) 140 | .queryString(query.getParams()) 141 | .asJson(); 142 | return queryForResponse.getBody().getObject(); 143 | } catch (UnirestException e) { 144 | e.printStackTrace(); 145 | } 146 | return null; 147 | } 148 | 149 | /** 150 | * Used to send a GET request to the Paystack API 151 | * 152 | * @param query - HashMap containing parameters to send 153 | * @return - JSONObject containing API response 154 | */ 155 | public JSONObject connectAndQueryWithGet(HashMap query) { 156 | try { 157 | HttpResponse queryForResponse = Unirest.get(url) 158 | .header("Accept", "application/json") 159 | .header("Authorization", "Bearer " + apiKey) 160 | .queryString(query) 161 | .asJson(); 162 | return queryForResponse.getBody().getObject(); 163 | } catch (UnirestException e) { 164 | e.printStackTrace(); 165 | } 166 | return null; 167 | } 168 | 169 | /** 170 | * Used to send a PUT request to the Paystack API 171 | * 172 | * @param query - APIQuery containing parameters to send 173 | * @return - JSONObject containing API response 174 | */ 175 | public JSONObject connectAndQueryWithPut(ApiQuery query) { 176 | try { 177 | HttpResponse queryForResponse = Unirest.put(url) 178 | .header("Accept", "application/json") 179 | .header("Authorization", "Bearer " + apiKey) 180 | .fields(query.getParams()) 181 | .asJson(); 182 | return queryForResponse.getBody().getObject(); 183 | } catch (UnirestException e) { 184 | e.printStackTrace(); 185 | } 186 | return null; 187 | } 188 | 189 | /** 190 | * Used to send a PUT request to the Paystack API 191 | * 192 | * @param query - HashMap containing parameters to send 193 | * @return - JSONObject containing API response 194 | */ 195 | public JSONObject connectAndQueryWithPut(HashMap query) { 196 | try { 197 | HttpResponse queryForResponse = Unirest.get(url) 198 | .header("Accept", "application/json") 199 | .header("Authorization", "Bearer " + apiKey) 200 | .queryString(query) 201 | .asJson(); 202 | return queryForResponse.getBody().getObject(); 203 | } catch (UnirestException e) { 204 | e.printStackTrace(); 205 | } 206 | return null; 207 | } 208 | 209 | /** 210 | * Called to shut down the background event loop 211 | */ 212 | public static void shutDown() { 213 | try { 214 | Unirest.shutdown(); 215 | } catch (IOException e) { 216 | e.printStackTrace(); 217 | } 218 | } 219 | 220 | } 221 | -------------------------------------------------------------------------------- /src/me/iyanuadelekan/paystackjava/core/ApiQuery.java: -------------------------------------------------------------------------------- 1 | package me.iyanuadelekan.paystackjava.core; 2 | 3 | import java.util.HashMap; 4 | 5 | /** 6 | * @author Iyanu Adelekan on 17/07/2016. 7 | */ 8 | public class ApiQuery { 9 | 10 | private HashMap queryMap; 11 | 12 | /** 13 | * Initializes a new query map 14 | */ 15 | public ApiQuery() { 16 | this.queryMap = new HashMap(); 17 | } 18 | 19 | /** 20 | * Used to add a parameter to the query map 21 | * 22 | * @param key 23 | * @param value 24 | */ 25 | public void putParams(String key, Object value) { 26 | this.queryMap.put(key, value); 27 | } 28 | 29 | /** 30 | * Used to get all parameters within the query map 31 | * 32 | * @return - HashMap containin g query parameters 33 | */ 34 | public HashMap getParams() { 35 | return this.queryMap; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/me/iyanuadelekan/paystackjava/core/Customers.java: -------------------------------------------------------------------------------- 1 | package me.iyanuadelekan.paystackjava.core; 2 | 3 | import me.iyanuadelekan.paystackjava.constants.Definitions; 4 | 5 | import org.json.JSONObject; 6 | import java.util.HashMap; 7 | 8 | /** 9 | * @author Iyanu Adelekan on 17/07/2016. 10 | */ 11 | public class Customers { 12 | 13 | private ApiConnection apiConnection; 14 | 15 | /** 16 | * Used to create a new customer 17 | * 18 | * @param queryMap 19 | * @return JSONObject 20 | */ 21 | public JSONObject createCustomer(HashMap queryMap) { 22 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_CUSTOMERS_CREATE_CUSTOMER); 23 | return this.apiConnection.connectAndQuery(queryMap); 24 | } 25 | 26 | /** 27 | * Used to create a new customer 28 | * 29 | * @param query 30 | * @return JSONObject 31 | */ 32 | public JSONObject createCustomer(ApiQuery query) { 33 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_CUSTOMERS_CREATE_CUSTOMER); 34 | return this.apiConnection.connectAndQuery(query); 35 | } 36 | 37 | /** 38 | * Used to create a new customer 39 | * 40 | * @param email 41 | * @param firstName 42 | * @param lastName 43 | * @param phone 44 | * @param metadata 45 | * @return JSONObject 46 | */ 47 | public JSONObject createCustomer(String email, String firstName, String lastName, 48 | String phone, Object metadata) { 49 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_CUSTOMERS_CREATE_CUSTOMER); 50 | ApiQuery apiQuery = new ApiQuery(); 51 | 52 | apiQuery.putParams("email", email); 53 | apiQuery.putParams("first_name", firstName); 54 | apiQuery.putParams("last_name", lastName); 55 | apiQuery.putParams("phone", phone); 56 | apiQuery.putParams("metadata", metadata); 57 | 58 | return this.apiConnection.connectAndQuery(apiQuery); 59 | } 60 | 61 | /** 62 | * Used to get a list of customers 63 | * 64 | * @param queryMap 65 | * @return JSONObject 66 | */ 67 | public JSONObject listCustomers(HashMap queryMap) { 68 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_CUSTOMERS_LIST_CUSTOMERS); 69 | return this.apiConnection.connectAndQueryWithGet(queryMap); 70 | } 71 | 72 | /** 73 | * Used to get a list of customers 74 | * 75 | * @param query 76 | * @return JSONObject 77 | */ 78 | public JSONObject listCustomers(ApiQuery query) { 79 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_CUSTOMERS_LIST_CUSTOMERS); 80 | return this.apiConnection.connectAndQueryWithGet(query); 81 | } 82 | 83 | /** 84 | * Used to get a list of customers 85 | * 86 | * @param perPage 87 | * @param page 88 | * @return JSONObject 89 | */ 90 | public JSONObject listCustomers(int perPage, int page) { 91 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_CUSTOMERS_LIST_CUSTOMERS); 92 | 93 | ApiQuery apiQuery = new ApiQuery(); 94 | apiQuery.putParams("perPage", perPage); 95 | apiQuery.putParams("page", page); 96 | 97 | return this.apiConnection.connectAndQueryWithGet(apiQuery); 98 | } 99 | 100 | /** 101 | * Used to get a customer 102 | * 103 | * @param idOrCustomerCode 104 | * @return JSONObject 105 | */ 106 | public JSONObject fetchCustomer(String idOrCustomerCode) { 107 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_CUSTOMERS_FETCH_CUSTOMER + idOrCustomerCode); 108 | return this.apiConnection.connectAndQueryWithGet(); 109 | } 110 | 111 | /** 112 | * Used to update a customer 113 | * 114 | * @param queryMap 115 | * @param idOrCustomerCode 116 | * @return JSONObject 117 | */ 118 | public JSONObject updateCustomer(HashMap queryMap, String idOrCustomerCode) { 119 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_CUSTOMERS_UPDATE_CUSTOMER + idOrCustomerCode); 120 | return this.apiConnection.connectAndQueryWithPut(queryMap); 121 | } 122 | 123 | /** 124 | * Used to update a customer 125 | * 126 | * @param query 127 | * @param idOrCustomerCode 128 | * @return JSONObject 129 | */ 130 | public JSONObject updateCustomer(ApiQuery query, String idOrCustomerCode) { 131 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_CUSTOMERS_UPDATE_CUSTOMER + idOrCustomerCode); 132 | return this.apiConnection.connectAndQueryWithPut(query); 133 | } 134 | 135 | /** 136 | * Used to update a customer 137 | * 138 | * @param idOrCustomerCode 139 | * @param email 140 | * @param firstName 141 | * @param lastName 142 | * @param phone 143 | * @param metadata 144 | * @return JSONObject 145 | */ 146 | public JSONObject updateCustomer(String idOrCustomerCode, String email, String firstName, String lastName, 147 | String phone, Object metadata) { 148 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_CUSTOMERS_UPDATE_CUSTOMER.concat(idOrCustomerCode)); 149 | 150 | ApiQuery apiQuery = new ApiQuery(); 151 | apiQuery.putParams("first_name", firstName); 152 | apiQuery.putParams("last_name", lastName); 153 | apiQuery.putParams("phone", phone); 154 | apiQuery.putParams("metadata", metadata); 155 | 156 | return this.apiConnection.connectAndQueryWithPut(apiQuery); 157 | } 158 | 159 | } 160 | -------------------------------------------------------------------------------- /src/me/iyanuadelekan/paystackjava/core/Keys.java: -------------------------------------------------------------------------------- 1 | package me.iyanuadelekan.paystackjava.core; 2 | 3 | import org.json.JSONObject; 4 | import java.io.File; 5 | import java.io.FileNotFoundException; 6 | import java.util.Scanner; 7 | 8 | /** 9 | * @author Iyanu Adelekan on 18/07/2016. 10 | */ 11 | class Keys { 12 | 13 | private String TEST_SECRET_KEY; 14 | private String TEST_PUBLIC_KEY; 15 | private String LIVE_SECRET_KEY; 16 | private String LIVE_PUBLIC_KEY; 17 | String KEY_IN_USE; 18 | 19 | /** 20 | * Used to initialise all necessary API keys 21 | * 22 | * @throws FileNotFoundException 23 | */ 24 | void initKeys() throws FileNotFoundException { 25 | JSONObject keyObject; 26 | String fileContent = ""; 27 | File file = new File("Keys.json"); 28 | Scanner scanner = new Scanner(file); 29 | 30 | while (scanner.hasNext()) { 31 | fileContent += scanner.nextLine(); 32 | } 33 | keyObject = new JSONObject(fileContent).getJSONObject("API_KEYS"); 34 | 35 | this.KEY_IN_USE = keyObject.getString("KEY_IN_USE"); 36 | this.TEST_SECRET_KEY = keyObject.getString("TEST_SECRET_KEY"); 37 | this.TEST_PUBLIC_KEY = keyObject.getString("TEST_PUBLIC_KEY"); 38 | this.LIVE_SECRET_KEY = keyObject.getString("LIVE_SECRET_KEY"); 39 | this.LIVE_PUBLIC_KEY = keyObject.getString("LIVE_PUBLIC_KEY"); 40 | 41 | } 42 | 43 | /** 44 | * Used to set test secret key 45 | * 46 | * @param key 47 | */ 48 | protected void setTest_SECRET_KEY(String key) { 49 | this.TEST_SECRET_KEY = key; 50 | } 51 | 52 | /** 53 | * Used to get test secret key 54 | * 55 | * @return 56 | */ 57 | protected String getTEST_SECRET_KEY() { 58 | return this.TEST_SECRET_KEY; 59 | } 60 | 61 | /** 62 | * Used to set test public key 63 | * 64 | * @param key 65 | */ 66 | protected void setTEST_PUBLIC_KEY(String key) { 67 | this.TEST_PUBLIC_KEY = key; 68 | } 69 | 70 | /** 71 | * Used to get test public key 72 | * 73 | * @return 74 | */ 75 | protected String getTEST_PUBLIC_KEY() { 76 | return this.TEST_PUBLIC_KEY; 77 | } 78 | 79 | /** 80 | * Used to set live secret key 81 | * 82 | * @param key 83 | */ 84 | protected void setLIVE_SECRET_KEY(String key) { 85 | this.LIVE_SECRET_KEY = key; 86 | } 87 | 88 | /** 89 | * Used to get live secret key 90 | * 91 | * @return 92 | */ 93 | protected String getLIVE_SECRET_KEY() { 94 | return this.LIVE_SECRET_KEY; 95 | } 96 | 97 | /** 98 | * Used to set live public key 99 | * 100 | * @param key 101 | */ 102 | protected void setLIVE_PUBLIC_KEY(String key) { 103 | this.LIVE_PUBLIC_KEY = key; 104 | } 105 | 106 | /** 107 | * Used to get live public key 108 | * 109 | * @return 110 | */ 111 | protected String getLIVE_PUBLIC_KEY() { 112 | return this.LIVE_PUBLIC_KEY; 113 | } 114 | 115 | } 116 | -------------------------------------------------------------------------------- /src/me/iyanuadelekan/paystackjava/core/Pages.java: -------------------------------------------------------------------------------- 1 | package me.iyanuadelekan.paystackjava.core; 2 | 3 | import me.iyanuadelekan.paystackjava.constants.Definitions; 4 | 5 | import org.json.JSONObject; 6 | import java.util.HashMap; 7 | 8 | /** 9 | * @author Iyanu Adelekan on 17/07/2016. 10 | */ 11 | public class Pages { 12 | 13 | private ApiConnection apiConnection; 14 | private ApiQuery apiQuery; 15 | 16 | /** 17 | * Used to create a new page 18 | * 19 | * @param queryMap 20 | * @return 21 | */ 22 | public JSONObject createPage(HashMap queryMap) { 23 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PAGES_CREATE_PAGE); 24 | return this.apiConnection.connectAndQuery(queryMap); 25 | } 26 | 27 | /** 28 | * Used to create a new page 29 | * 30 | * @param query 31 | * @return 32 | */ 33 | public JSONObject createPage(ApiQuery query) { 34 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PAGES_CREATE_PAGE); 35 | return this.apiConnection.connectAndQuery(query); 36 | } 37 | 38 | /** 39 | * Used to create a new page 40 | * 41 | * @param name 42 | * @param description 43 | * @param amount 44 | * @return 45 | */ 46 | public JSONObject createPage(String name, String description, String amount) { 47 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PAGES_CREATE_PAGE); 48 | this.apiQuery = new ApiQuery(); 49 | this.apiQuery.putParams("name", name); 50 | this.apiQuery.putParams("description", description); 51 | this.apiQuery.putParams("amount", amount); 52 | 53 | return this.apiConnection.connectAndQuery(this.apiQuery); 54 | } 55 | 56 | /** 57 | * Used to list created pages 58 | * 59 | * @param queryMap 60 | * @return 61 | */ 62 | public JSONObject listPages(HashMap queryMap) { 63 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PAGES_LIST_PAGES); 64 | return this.apiConnection.connectAndQueryWithGet(queryMap); 65 | } 66 | 67 | /** 68 | * Used to list created pages 69 | * 70 | * @param query 71 | * @return 72 | */ 73 | public JSONObject listPages(ApiQuery query) { 74 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PAGES_LIST_PAGES); 75 | return this.apiConnection.connectAndQueryWithGet(query); 76 | } 77 | 78 | /** 79 | * Used to list created pages 80 | * 81 | * @param perPage 82 | * @param page 83 | * @return 84 | */ 85 | public JSONObject listPages(int perPage, int page) { 86 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PAGES_LIST_PAGES); 87 | this.apiQuery = new ApiQuery(); 88 | this.apiQuery.putParams("perPage", perPage); 89 | this.apiQuery.putParams("page", page); 90 | 91 | return this.apiConnection.connectAndQueryWithGet(this.apiQuery); 92 | } 93 | 94 | /** 95 | * Used to fetch a page 96 | * 97 | * @param idOrSlug 98 | * @return 99 | */ 100 | public JSONObject fetchPage(String idOrSlug) { 101 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PAGES_FETCH_PAGE + idOrSlug); 102 | return this.apiConnection.connectAndQueryWithGet(); 103 | } 104 | 105 | /** 106 | * Used to update a page 107 | * 108 | * @param idOrSlug 109 | * @param queryMap 110 | * @return 111 | */ 112 | public JSONObject updatePage(String idOrSlug, HashMap queryMap) { 113 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PAGES_UPDATE_PAGE + idOrSlug); 114 | return this.apiConnection.connectAndQueryWithPut(queryMap); 115 | } 116 | 117 | /** 118 | * Used to update a page 119 | * 120 | * @param idOrSlug 121 | * @param query 122 | * @return 123 | */ 124 | public JSONObject updatePage(String idOrSlug, ApiQuery query) { 125 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PAGES_UPDATE_PAGE + idOrSlug); 126 | return this.apiConnection.connectAndQueryWithPut(query); 127 | } 128 | 129 | /** 130 | * Used to update a page 131 | * 132 | * @param idOrSlug 133 | * @param name 134 | * @param description 135 | * @param amount 136 | * @param active 137 | * @return 138 | */ 139 | public JSONObject updatePage(String idOrSlug, String name, String description, String amount, boolean active) { 140 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PAGES_UPDATE_PAGE + idOrSlug); 141 | this.apiQuery = new ApiQuery(); 142 | this.apiQuery.putParams("name", name); 143 | this.apiQuery.putParams("description", description); 144 | this.apiQuery.putParams("amount", amount); 145 | this.apiQuery.putParams("active", active); 146 | 147 | return this.apiConnection.connectAndQueryWithPut(this.apiQuery); 148 | } 149 | 150 | } 151 | -------------------------------------------------------------------------------- /src/me/iyanuadelekan/paystackjava/core/PaystackInline.java: -------------------------------------------------------------------------------- 1 | package me.iyanuadelekan.paystackjava.core; 2 | 3 | import me.iyanuadelekan.paystackjava.constants.Definitions; 4 | 5 | import org.json.JSONObject; 6 | import java.util.HashMap; 7 | 8 | /** 9 | * @author Iyanu Adelekan on 19/07/2016. 10 | */ 11 | public class PaystackInline { 12 | 13 | private ApiConnection apiConnection; 14 | 15 | /** 16 | * 17 | * @param queryMap 18 | * @return 19 | */ 20 | public JSONObject paystackStandard(HashMap queryMap) { 21 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_INLINE_PAYSTACK_STANDARD); 22 | return this.apiConnection.connectAndQuery(queryMap); 23 | } 24 | 25 | /** 26 | * 27 | * @param query 28 | * @return 29 | */ 30 | public JSONObject paystackStandard(ApiQuery query) { 31 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_INLINE_PAYSTACK_STANDARD); 32 | return this.apiConnection.connectAndQuery(query); 33 | } 34 | 35 | /** 36 | * 37 | * @param reference 38 | * @param amount 39 | * @param email 40 | * @param plan 41 | * @param callback_url 42 | * @return 43 | */ 44 | public JSONObject paystackStandard(String reference, int amount, String email, String plan, String callback_url) { 45 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_INLINE_PAYSTACK_STANDARD); 46 | ApiQuery apiQuery = new ApiQuery(); 47 | 48 | apiQuery.putParams("reference", reference); 49 | apiQuery.putParams("amount", amount); 50 | apiQuery.putParams("email", email); 51 | apiQuery.putParams("plan", plan); 52 | apiQuery.putParams("callback_url", callback_url); 53 | 54 | return apiConnection.connectAndQuery(apiQuery); 55 | } 56 | 57 | /** 58 | * 59 | * @param reference 60 | * @return 61 | */ 62 | public JSONObject verifyTransactions(String reference) { 63 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_INLINE_VERIFY_TRANSACTIONS.concat(reference)); 64 | return this.apiConnection.connectAndQueryWithGet(); 65 | } 66 | 67 | /** 68 | * 69 | * @param queryMap 70 | * @return 71 | */ 72 | public JSONObject chargeReturningCustomer(HashMap queryMap) { 73 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_INLINE_CHARGE_AUTHORIZATION); 74 | return this.apiConnection.connectAndQuery(queryMap); 75 | } 76 | 77 | /** 78 | * 79 | * @param query 80 | * @return 81 | */ 82 | public JSONObject chargeReturningCustomer(ApiQuery query) { 83 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_INLINE_CHARGE_AUTHORIZATION); 84 | return this.apiConnection.connectAndQuery(query); 85 | } 86 | 87 | /** 88 | * 89 | * @param authorization_code 90 | * @param email 91 | * @param amount 92 | * @param reference 93 | * @return 94 | */ 95 | public JSONObject chargeReturningCustomer(String authorization_code, String email, String amount, String reference) { 96 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_INLINE_CHARGE_AUTHORIZATION); 97 | ApiQuery apiQuery = new ApiQuery(); 98 | 99 | apiQuery.putParams("authorization_code", authorization_code); 100 | apiQuery.putParams("email", email); 101 | apiQuery.putParams("amount", amount); 102 | apiQuery.putParams("reference", reference); 103 | 104 | return this.apiConnection.connectAndQuery(apiQuery); 105 | } 106 | 107 | } 108 | -------------------------------------------------------------------------------- /src/me/iyanuadelekan/paystackjava/core/Plans.java: -------------------------------------------------------------------------------- 1 | package me.iyanuadelekan.paystackjava.core; 2 | 3 | import me.iyanuadelekan.paystackjava.constants.Definitions; 4 | 5 | import org.json.JSONObject; 6 | import java.util.HashMap; 7 | 8 | /** 9 | * @author Iyanu Adelekan on 17/07/2016. 10 | */ 11 | public class Plans { 12 | 13 | private static ApiConnection apiConnection; 14 | 15 | /** 16 | * Used to create a plan 17 | * 18 | * @param queryMap 19 | * @return 20 | */ 21 | public JSONObject createPlan(HashMap queryMap) { 22 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PLANS_CREATE_PLAN); 23 | return this.apiConnection.connectAndQuery(queryMap); 24 | } 25 | 26 | /** 27 | * Used to create a plan 28 | * 29 | * @param query 30 | * @return 31 | */ 32 | public JSONObject createPlan(ApiQuery query) { 33 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PLANS_CREATE_PLAN); 34 | return this.apiConnection.connectAndQuery(query); 35 | } 36 | 37 | /** 38 | * Used to create a plan 39 | * 40 | * @param name 41 | * @param description 42 | * @param amount 43 | * @param interval 44 | * @param send_invoices 45 | * @param send_sms 46 | * @param currency 47 | * @return 48 | */ 49 | public JSONObject createPlan(String name, String description, int amount, String interval, 50 | boolean send_invoices, boolean send_sms, String currency) { 51 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PLANS_CREATE_PLAN); 52 | ApiQuery apiQuery = new ApiQuery(); 53 | 54 | apiQuery.putParams("name", name); 55 | apiQuery.putParams("description", description); 56 | apiQuery.putParams("amount", amount); 57 | apiQuery.putParams("send_invoices", send_invoices); 58 | apiQuery.putParams("send_sms", send_sms); 59 | apiQuery.putParams("currency", currency); 60 | 61 | return this.apiConnection.connectAndQuery(apiQuery); 62 | } 63 | 64 | /** 65 | * Used to list plans 66 | * 67 | * @param queryMap 68 | * @return 69 | */ 70 | public JSONObject listPlans(HashMap queryMap) { 71 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PLANS_LIST_PLANS); 72 | return this.apiConnection.connectAndQueryWithGet(queryMap); 73 | } 74 | 75 | /** 76 | * Used to list plans 77 | * 78 | * @param query 79 | * @return 80 | */ 81 | public JSONObject listPlans(ApiQuery query) { 82 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PLANS_LIST_PLANS); 83 | return this.apiConnection.connectAndQueryWithGet(query); 84 | } 85 | 86 | /** 87 | * Used to list plans 88 | * 89 | * @param perPage 90 | * @param page 91 | * @return 92 | */ 93 | public JSONObject listPlans(String perPage, String page) { 94 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PLANS_LIST_PLANS); 95 | ApiQuery apiQuery = new ApiQuery(); 96 | 97 | apiQuery.putParams("perPage", perPage); 98 | apiQuery.putParams("page", page); 99 | 100 | return this.apiConnection.connectAndQueryWithGet(apiQuery); 101 | } 102 | 103 | /** 104 | * Used to fetch a plan 105 | * 106 | * @param idOrPlanCode 107 | * @return 108 | */ 109 | public JSONObject fetchPlan(String idOrPlanCode) { 110 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PLANS_FETCH_PLAN + idOrPlanCode); 111 | return this.apiConnection.connectAndQueryWithGet(); 112 | } 113 | 114 | /** 115 | * Used to update a plan 116 | * 117 | * @param idOrPlanCode 118 | * @param queryMap 119 | * @return 120 | */ 121 | public JSONObject updatePlan(String idOrPlanCode, HashMap queryMap) { 122 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PLANS_UPDATE_PLAN + idOrPlanCode); 123 | return this.apiConnection.connectAndQueryWithPut(queryMap); 124 | } 125 | 126 | /** 127 | * Used to update a plan 128 | * 129 | * @param idOrPlanCode 130 | * @param query 131 | * @return 132 | */ 133 | public JSONObject updatePlan(String idOrPlanCode, ApiQuery query) { 134 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PLANS_UPDATE_PLAN.concat(idOrPlanCode)); 135 | return this.apiConnection.connectAndQueryWithPut(query); 136 | } 137 | 138 | /** 139 | * Used to update a plan 140 | * 141 | * @param idOrPlanCode 142 | * @param name 143 | * @param description 144 | * @param amount 145 | * @param interval 146 | * @param send_invoices 147 | * @param send_sms 148 | * @param currency 149 | * @return 150 | */ 151 | public JSONObject updatePlan(String idOrPlanCode, String name, String description, int amount, 152 | String interval, boolean send_invoices, String send_sms, String currency) { 153 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_PLANS_UPDATE_PLAN.concat(idOrPlanCode)); 154 | ApiQuery apiQuery = new ApiQuery(); 155 | 156 | apiQuery.putParams("name", name); 157 | apiQuery.putParams("description", description); 158 | apiQuery.putParams("amount", amount); 159 | apiQuery.putParams("interval", interval); 160 | apiQuery.putParams("send_invoices", send_invoices); 161 | apiQuery.putParams("send_sms", send_sms); 162 | apiQuery.putParams("currency", currency); 163 | 164 | return this.apiConnection.connectAndQueryWithPut(apiQuery); 165 | } 166 | 167 | } 168 | -------------------------------------------------------------------------------- /src/me/iyanuadelekan/paystackjava/core/Subscriptions.java: -------------------------------------------------------------------------------- 1 | package me.iyanuadelekan.paystackjava.core; 2 | 3 | import me.iyanuadelekan.paystackjava.constants.Definitions; 4 | 5 | import org.json.JSONObject; 6 | import java.util.HashMap; 7 | 8 | /** 9 | * @author Iyanu Adelekan on 17/07/2016. 10 | */ 11 | public class Subscriptions { 12 | 13 | private ApiConnection apiConnection; 14 | private ApiQuery apiQuery; 15 | 16 | /** 17 | * Used to create a subscription 18 | * 19 | * @param queryMap 20 | * @return 21 | */ 22 | public JSONObject createSubscription(HashMap queryMap) { 23 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_CREATE_SUBSCRIPTION); 24 | return this.apiConnection.connectAndQuery(queryMap); 25 | } 26 | 27 | /** 28 | * Used to create a subscription 29 | * 30 | * @param query 31 | * @return 32 | */ 33 | public JSONObject createSubscription(ApiQuery query) { 34 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_CREATE_SUBSCRIPTION); 35 | return this.apiConnection.connectAndQuery(query); 36 | } 37 | 38 | /** 39 | * Used to create a subscription 40 | * 41 | * @param customer 42 | * @param plan 43 | * @param authorization 44 | * @return 45 | */ 46 | public JSONObject createSubscription(String customer, String plan, String authorization) { 47 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_CREATE_SUBSCRIPTION); 48 | this.apiQuery = new ApiQuery(); 49 | 50 | this.apiQuery.putParams("customer", customer); 51 | this.apiQuery.putParams("plan", plan); 52 | this.apiQuery.putParams("authorization", authorization); 53 | 54 | return this.apiConnection.connectAndQuery(this.apiQuery); 55 | } 56 | 57 | /** 58 | * Used to disable a subscription 59 | * 60 | * @param queryMap 61 | * @return 62 | */ 63 | public JSONObject disableSubscription(HashMap queryMap) { 64 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_DISABLE_SUBSCRIPTION); 65 | return this.apiConnection.connectAndQuery(queryMap); 66 | } 67 | 68 | /** 69 | * Used to disable a subscription 70 | * 71 | * @param query 72 | * @return 73 | */ 74 | public JSONObject disableSubscription(ApiQuery query) { 75 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_DISABLE_SUBSCRIPTION); 76 | return this.apiConnection.connectAndQuery(query); 77 | } 78 | 79 | /** 80 | * Used to disable a subscription 81 | * 82 | * @param code 83 | * @param token 84 | * @return 85 | */ 86 | public JSONObject disableSubscription(String code, String token) { 87 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_DISABLE_SUBSCRIPTION); 88 | this.apiQuery = new ApiQuery(); 89 | 90 | this.apiQuery.putParams("code", code); 91 | this.apiQuery.putParams("token", token); 92 | 93 | return this.apiConnection.connectAndQuery(this.apiQuery); 94 | } 95 | 96 | /** 97 | * Used to enable a subscription 98 | * 99 | * @param queryMap 100 | * @return 101 | */ 102 | public JSONObject enableSubscription(HashMap queryMap) { 103 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_ENABLE_SUBSCRIPTION); 104 | return this.apiConnection.connectAndQuery(queryMap); 105 | } 106 | 107 | /** 108 | * Used to enable a subscription 109 | * 110 | * @param query 111 | * @return 112 | */ 113 | public JSONObject enableSubscription(ApiQuery query) { 114 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_ENABLE_SUBSCRIPTION); 115 | return this.apiConnection.connectAndQuery(query); 116 | } 117 | 118 | /** 119 | * Used to enable a subscription 120 | * 121 | * @param code 122 | * @param token 123 | * @return 124 | */ 125 | public JSONObject enableSubscription(String code, String token) { 126 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_ENABLE_SUBSCRIPTION); 127 | this.apiQuery = new ApiQuery(); 128 | 129 | this.apiQuery.putParams("code", code); 130 | this.apiQuery.putParams("token", token); 131 | 132 | return this.apiConnection.connectAndQuery(this.apiQuery); 133 | } 134 | 135 | /** 136 | * Used to fetch a subscription 137 | * 138 | * @param idOrSubscriptionCode 139 | * @return 140 | */ 141 | public JSONObject fetchSubscription(String idOrSubscriptionCode) { 142 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_FETCH_SUBSCRIPTION); 143 | return this.apiConnection.connectAndQueryWithGet(); 144 | } 145 | 146 | } 147 | -------------------------------------------------------------------------------- /src/me/iyanuadelekan/paystackjava/core/Transactions.java: -------------------------------------------------------------------------------- 1 | package me.iyanuadelekan.paystackjava.core; 2 | 3 | import me.iyanuadelekan.paystackjava.constants.Definitions; 4 | 5 | import org.json.JSONObject; 6 | import java.time.LocalDateTime; 7 | import java.util.HashMap; 8 | 9 | /** 10 | * @author Iyanu Adelekan on 17/07/2016. 11 | */ 12 | public class Transactions { 13 | 14 | private ApiConnection apiConnection; 15 | 16 | /** 17 | * Used to initialize a transaction 18 | * 19 | * @param queryMap 20 | * @return 21 | */ 22 | public JSONObject initializeTransaction(HashMap queryMap) { 23 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_TRANSACTIONS_INITIALIZE_TRANSACTION); 24 | return this.apiConnection.connectAndQuery(queryMap); 25 | } 26 | 27 | /** 28 | * Used to initialize a transaction 29 | * 30 | * @param query 31 | * @return 32 | */ 33 | public JSONObject initializeTransaction(ApiQuery query) { 34 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_TRANSACTIONS_INITIALIZE_TRANSACTION); 35 | return this.apiConnection.connectAndQuery(query); 36 | } 37 | 38 | /** 39 | * Used to initialize a transaction 40 | * 41 | * @param reference 42 | * @param amount 43 | * @param email 44 | * @param plan 45 | * @param callback_url 46 | * @return 47 | */ 48 | public JSONObject initializeTransaction(String reference, String amount, String email, 49 | String plan, String callback_url) { 50 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_TRANSACTIONS_INITIALIZE_TRANSACTION); 51 | ApiQuery apiQuery = new ApiQuery(); 52 | apiQuery.putParams("reference", reference); 53 | apiQuery.putParams("amount", amount); 54 | apiQuery.putParams("email", email); 55 | apiQuery.putParams("plan", plan); 56 | apiQuery.putParams("callback_url", callback_url); 57 | return this.apiConnection.connectAndQuery(apiQuery); 58 | } 59 | 60 | /** 61 | * Used to verify a transaction 62 | * 63 | * @param reference 64 | * @return 65 | */ 66 | public JSONObject verifyTransaction(String reference) { 67 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_TRANSACTIONS_VERIFY_TRANSACTION + reference); 68 | return this.apiConnection.connectAndQueryWithGet(); 69 | } 70 | 71 | /** 72 | * Used to list transactions 73 | * 74 | * @param queryMap 75 | * @return 76 | */ 77 | public JSONObject listTransactions(HashMap queryMap) { 78 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_TRANSACTIONS_LIST_TRANSACTIONS); 79 | return this.apiConnection.connectAndQueryWithGet(queryMap); 80 | } 81 | 82 | /** 83 | * Used to list transactions 84 | * 85 | * @param query 86 | * @return 87 | */ 88 | public JSONObject listTransactions(ApiQuery query) { 89 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_TRANSACTIONS_LIST_TRANSACTIONS); 90 | return this.apiConnection.connectAndQueryWithGet(query); 91 | } 92 | 93 | /** 94 | * Used to list transactions 95 | * 96 | * @param perPage 97 | * @param page 98 | * @return 99 | */ 100 | public JSONObject listTransactions(String perPage, String page) { 101 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_TRANSACTIONS_LIST_TRANSACTIONS); 102 | ApiQuery apiQuery = new ApiQuery(); 103 | apiQuery.putParams("perPage", perPage); 104 | apiQuery.putParams("page", page); 105 | return this.apiConnection.connectAndQueryWithGet(apiQuery); 106 | } 107 | 108 | /** 109 | * Used to fetch transactions 110 | * 111 | * @param id 112 | * @return 113 | */ 114 | public JSONObject fetchTransaction(String id) { 115 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_TRANSACTIONS_FETCH_TRANSACTION + id); 116 | return this.apiConnection.connectAndQueryWithGet(); 117 | } 118 | 119 | /** 120 | * Used for charge authorization 121 | * 122 | * @param queryMap 123 | * @return 124 | */ 125 | public JSONObject chargeAuthorization(HashMap queryMap) { 126 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_TRANSACTIONS_CHARGE_AUTHORIZATION); 127 | return this.apiConnection.connectAndQuery(queryMap); 128 | } 129 | 130 | /** 131 | * Used for charge authorization 132 | * 133 | * @param query 134 | * @return 135 | */ 136 | public JSONObject chargeAuthorization(ApiQuery query) { 137 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_TRANSACTIONS_CHARGE_AUTHORIZATION); 138 | return this.apiConnection.connectAndQuery(query); 139 | } 140 | 141 | /** 142 | * Used for charge authorization 143 | * 144 | * @param reference 145 | * @param authorization_code 146 | * @param amount 147 | * @param email 148 | * @param callback_url 149 | * @return 150 | */ 151 | public JSONObject chargeAuthorization(String reference, String authorization_code, String amount, 152 | String email, String callback_url) { 153 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_TRANSACTIONS_CHARGE_AUTHORIZATION); 154 | ApiQuery apiQuery = new ApiQuery(); 155 | 156 | apiQuery.putParams("reference", reference); 157 | apiQuery.putParams("authorization_code", authorization_code); 158 | apiQuery.putParams("amount", amount); 159 | apiQuery.putParams("email", email); 160 | apiQuery.putParams("callback_url", callback_url); 161 | 162 | return this.apiConnection.connectAndQuery(apiQuery); 163 | } 164 | 165 | /** 166 | * Used for charge token 167 | * 168 | * @param queryMap 169 | * @return 170 | */ 171 | public JSONObject chargeToken(HashMap queryMap) { 172 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_TRANSACTIONS_CHARGE_TOKEN); 173 | return this.apiConnection.connectAndQuery(queryMap); 174 | } 175 | 176 | /** 177 | * Used for charge token 178 | * 179 | * @param query 180 | * @return 181 | */ 182 | public JSONObject chargeToken(ApiQuery query) { 183 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_TRANSACTIONS_CHARGE_TOKEN); 184 | return this.apiConnection.connectAndQuery(query); 185 | } 186 | 187 | /** 188 | * Used for charge token 189 | * 190 | * @param reference 191 | * @param token 192 | * @param amount 193 | * @param email 194 | * @return 195 | */ 196 | public JSONObject chargeToken(String reference, String token, String amount, String email) { 197 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_TRANSACTIONS_CHARGE_TOKEN); 198 | ApiQuery apiQuery = new ApiQuery(); 199 | 200 | apiQuery.putParams("reference", reference); 201 | apiQuery.putParams("authorization_code", token); 202 | apiQuery.putParams("amount", amount); 203 | apiQuery.putParams("email", email); 204 | 205 | return this.apiConnection.connectAndQuery(apiQuery); 206 | } 207 | 208 | /** 209 | * Used to export transactions 210 | * 211 | * @param queryMap 212 | * @return 213 | */ 214 | public JSONObject exportTransactions(HashMap queryMap) { 215 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_TRANSACTIONS_EXPORT_TRANSACTIONS); 216 | return this.apiConnection.connectAndQueryWithGet(queryMap); 217 | } 218 | 219 | /** 220 | * Used to export transactions 221 | * 222 | * @param query 223 | * @return 224 | */ 225 | public JSONObject exportTransactions(ApiQuery query) { 226 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_TRANSACTIONS_EXPORT_TRANSACTIONS); 227 | return this.apiConnection.connectAndQueryWithGet(query); 228 | } 229 | 230 | /** 231 | * Used to export transactions 232 | * 233 | * @param from 234 | * @param to 235 | * @param settled 236 | * @param payment_page 237 | * @return 238 | */ 239 | public JSONObject exportTransactions(LocalDateTime from, LocalDateTime to, boolean settled, String payment_page) { 240 | this.apiConnection = new ApiConnection(Definitions.PAYSTACK_TRANSACTIONS_EXPORT_TRANSACTIONS); 241 | ApiQuery apiQuery = new ApiQuery(); 242 | 243 | apiQuery.putParams("from", from); 244 | apiQuery.putParams("to", to); 245 | apiQuery.putParams("settled", settled); 246 | apiQuery.putParams("payment_page", payment_page); 247 | 248 | return this.apiConnection.connectAndQueryWithGet(apiQuery); 249 | } 250 | 251 | } 252 | -------------------------------------------------------------------------------- /src/test/java/Test.java: -------------------------------------------------------------------------------- 1 | package test.java; 2 | 3 | /** 4 | * @author Iyanu Adelekan on 16/04/2017. 5 | * @// TODO: 16/04/2017 Create library tests 6 | */ 7 | public class Test { 8 | } 9 | -------------------------------------------------------------------------------- /target/classes/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeunAdelekan/PaystackJava/6ae740a63d0861d9fd0a66a4dda034e441d8b4bd/target/classes/Main.class -------------------------------------------------------------------------------- /target/classes/me/iyanuadelekan/paystackjava/constants/Definitions.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeunAdelekan/PaystackJava/6ae740a63d0861d9fd0a66a4dda034e441d8b4bd/target/classes/me/iyanuadelekan/paystackjava/constants/Definitions.class -------------------------------------------------------------------------------- /target/classes/me/iyanuadelekan/paystackjava/core/ApiConnection.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeunAdelekan/PaystackJava/6ae740a63d0861d9fd0a66a4dda034e441d8b4bd/target/classes/me/iyanuadelekan/paystackjava/core/ApiConnection.class -------------------------------------------------------------------------------- /target/classes/me/iyanuadelekan/paystackjava/core/ApiQuery.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeunAdelekan/PaystackJava/6ae740a63d0861d9fd0a66a4dda034e441d8b4bd/target/classes/me/iyanuadelekan/paystackjava/core/ApiQuery.class -------------------------------------------------------------------------------- /target/classes/me/iyanuadelekan/paystackjava/core/Customers.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeunAdelekan/PaystackJava/6ae740a63d0861d9fd0a66a4dda034e441d8b4bd/target/classes/me/iyanuadelekan/paystackjava/core/Customers.class -------------------------------------------------------------------------------- /target/classes/me/iyanuadelekan/paystackjava/core/Keys.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeunAdelekan/PaystackJava/6ae740a63d0861d9fd0a66a4dda034e441d8b4bd/target/classes/me/iyanuadelekan/paystackjava/core/Keys.class -------------------------------------------------------------------------------- /target/classes/me/iyanuadelekan/paystackjava/core/Pages.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeunAdelekan/PaystackJava/6ae740a63d0861d9fd0a66a4dda034e441d8b4bd/target/classes/me/iyanuadelekan/paystackjava/core/Pages.class -------------------------------------------------------------------------------- /target/classes/me/iyanuadelekan/paystackjava/core/PaystackInline.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeunAdelekan/PaystackJava/6ae740a63d0861d9fd0a66a4dda034e441d8b4bd/target/classes/me/iyanuadelekan/paystackjava/core/PaystackInline.class -------------------------------------------------------------------------------- /target/classes/me/iyanuadelekan/paystackjava/core/Plans.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeunAdelekan/PaystackJava/6ae740a63d0861d9fd0a66a4dda034e441d8b4bd/target/classes/me/iyanuadelekan/paystackjava/core/Plans.class -------------------------------------------------------------------------------- /target/classes/me/iyanuadelekan/paystackjava/core/Subscriptions.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeunAdelekan/PaystackJava/6ae740a63d0861d9fd0a66a4dda034e441d8b4bd/target/classes/me/iyanuadelekan/paystackjava/core/Subscriptions.class -------------------------------------------------------------------------------- /target/classes/me/iyanuadelekan/paystackjava/core/Transactions.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeunAdelekan/PaystackJava/6ae740a63d0861d9fd0a66a4dda034e441d8b4bd/target/classes/me/iyanuadelekan/paystackjava/core/Transactions.class -------------------------------------------------------------------------------- /target/maven-archiver/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven 2 | #Sun Apr 16 21:46:42 WAT 2017 3 | version=1.1.0 4 | groupId=me.iyanuadelekan 5 | artifactId=paystackjava 6 | -------------------------------------------------------------------------------- /target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst: -------------------------------------------------------------------------------- 1 | me/iyanuadelekan/paystackjava/core/Keys.class 2 | me/iyanuadelekan/paystackjava/core/Transactions.class 3 | me/iyanuadelekan/paystackjava/core/ApiConnection.class 4 | me/iyanuadelekan/paystackjava/core/Pages.class 5 | me/iyanuadelekan/paystackjava/core/Plans.class 6 | me/iyanuadelekan/paystackjava/constants/Definitions.class 7 | me/iyanuadelekan/paystackjava/core/Customers.class 8 | me/iyanuadelekan/paystackjava/core/Subscriptions.class 9 | me/iyanuadelekan/paystackjava/core/ApiQuery.class 10 | me/iyanuadelekan/paystackjava/core/PaystackInline.class 11 | -------------------------------------------------------------------------------- /target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst: -------------------------------------------------------------------------------- 1 | /Users/Iyanu/Repositories/GitHub/PaystackJava/src/main/java/paystackjava/core/Pages.java 2 | /Users/Iyanu/Repositories/GitHub/PaystackJava/src/main/java/paystackjava/core/Transactions.java 3 | /Users/Iyanu/Repositories/GitHub/PaystackJava/src/main/java/paystackjava/core/ApiConnection.java 4 | /Users/Iyanu/Repositories/GitHub/PaystackJava/src/main/java/paystackjava/constants/Definitions.java 5 | /Users/Iyanu/Repositories/GitHub/PaystackJava/src/main/java/paystackjava/core/PaystackInline.java 6 | /Users/Iyanu/Repositories/GitHub/PaystackJava/src/main/java/paystackjava/core/Plans.java 7 | /Users/Iyanu/Repositories/GitHub/PaystackJava/src/main/java/paystackjava/core/Subscriptions.java 8 | /Users/Iyanu/Repositories/GitHub/PaystackJava/src/main/java/paystackjava/core/Customers.java 9 | /Users/Iyanu/Repositories/GitHub/PaystackJava/src/main/java/paystackjava/core/ApiQuery.java 10 | /Users/Iyanu/Repositories/GitHub/PaystackJava/src/main/java/paystackjava/core/Keys.java 11 | -------------------------------------------------------------------------------- /target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst: -------------------------------------------------------------------------------- 1 | test/java/Tests.class 2 | -------------------------------------------------------------------------------- /target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst: -------------------------------------------------------------------------------- 1 | /Users/Iyanu/Repositories/GitHub/PaystackJava/src/test/java/Tests.java 2 | -------------------------------------------------------------------------------- /target/paystackjava-1.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeunAdelekan/PaystackJava/6ae740a63d0861d9fd0a66a4dda034e441d8b4bd/target/paystackjava-1.1.0.jar -------------------------------------------------------------------------------- /target/surefire-reports/TEST-test.java.Tests.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /target/surefire-reports/test.java.Tests.txt: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------- 2 | Test set: test.java.Tests 3 | ------------------------------------------------------------------------------- 4 | Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec 5 | -------------------------------------------------------------------------------- /target/test-classes/test/java/Test.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SeunAdelekan/PaystackJava/6ae740a63d0861d9fd0a66a4dda034e441d8b4bd/target/test-classes/test/java/Test.class --------------------------------------------------------------------------------