@@ -0,0 +1,3502 @@
+import org.json.JSONObject;%0A%0Aimport java.util.HashMap;%0A%0A/**%0A * Created by Iyanu on 17/07/2016.%0A */%0Apublic class Subscriptions %7B%0A%0A    public Subscriptions()%7B%0A%0A    %7D%0A%0A    private ApiConnection apiConnection = null;%0A    private ApiQuery apiQuery = null;%0A%0A    /*%0A    The following set of methods aids the sending of API%0A    requests for the CREATION of subscriptions%0A     */%0A%0A    public JSONObject createSubscription(HashMap%3CString, Object%3E queryMap)  %7B%0A        apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_CREATE_SUBSCRIPTION);%0A        return apiConnection.connectAndQuery(queryMap);%0A    %7D%0A%0A    public JSONObject createSubscription(ApiQuery query)  %7B%0A        apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_CREATE_SUBSCRIPTION);%0A        return apiConnection.connectAndQuery(query);%0A    %7D%0A%0A    public JSONObject createSubscription(String customer, String plan, String authorization)  %7B%0A        apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_CREATE_SUBSCRIPTION);%0A        apiQuery = new ApiQuery();%0A        apiQuery.putParams(%22customer%22, customer);%0A        apiQuery.putParams(%22plan%22, plan);%0A        apiQuery.putParams(%22authorization%22, authorization);%0A        return apiConnection.connectAndQuery(apiQuery);%0A    %7D%0A%0A    /*%0A    The following set of methods aids the sending of API%0A    requests for the DISABLING of subscriptions%0A     */%0A%0A    public JSONObject disableSubscription(HashMap%3CString, Object%3E queryMap)  %7B%0A        apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_DISABLE_SUBSCRIPTION);%0A        return apiConnection.connectAndQuery(queryMap);%0A    %7D%0A%0A    public JSONObject disableSubscription(ApiQuery query)  %7B%0A        apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_DISABLE_SUBSCRIPTION);%0A        return apiConnection.connectAndQuery(query);%0A    %7D%0A%0A    public JSONObject disableSubscription(String code, String token)  %7B%0A        apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_DISABLE_SUBSCRIPTION);%0A        apiQuery = new ApiQuery();%0A        apiQuery.putParams(%22code%22, code);%0A        apiQuery.putParams(%22token%22, token);%0A        return apiConnection.connectAndQuery(apiQuery);%0A    %7D%0A%0A    /*%0A    The following set of methods aids the sending of API%0A    requests for the ENABLING of subscriptions%0A     */%0A%0A    public JSONObject enableSubscription(HashMap%3CString, Object%3E queryMap)  %7B%0A        apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_ENABLE_SUBSCRIPTION);%0A        return apiConnection.connectAndQuery(queryMap);%0A    %7D%0A%0A    public JSONObject enableSubscription(ApiQuery query)  %7B%0A        apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_ENABLE_SUBSCRIPTION);%0A        return apiConnection.connectAndQuery(query);%0A    %7D%0A%0A    public JSONObject enableSubscription(String code, String token)  %7B%0A        apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_ENABLE_SUBSCRIPTION);%0A        apiQuery = new ApiQuery();%0A        apiQuery.putParams(%22code%22, code);%0A        apiQuery.putParams(%22token%22, token);%0A        return apiConnection.connectAndQuery(apiQuery);%0A    %7D%0A%0A    /*%0A    The following set of methods aids the sending of API%0A    requests for the FETCHING of subscriptions%0A     */%0A%0A    public JSONObject fetchSubscription(String idOrSubscriptionCode)  %7B%0A        apiConnection = new ApiConnection(Definitions.PAYSTACK_SUBSCRIPTIONS_FETCH_SUBSCRIPTION);%0A        return apiConnection.connectAndQueryWithGet();%0A    %7D%0A%7D%0A

Create Subscriptions.java