module Plan
Public Class Methods
create_plan(body)
click to toggle source
# File lib/paystackapi/core/plan.rb, line 2 def self.create_plan(body) api = HTTParty.post("#{API::BASE_URL}" + "#{API::PLAN_PATH}", :body => body.to_json, :headers => { "Authorization"=> ENV["PAYSTACK_SECRET_KEY"], "content-type" => "application/json"}) return api end
list_plans()
click to toggle source
# File lib/paystackapi/core/plan.rb, line 8 def self.list_plans api = HTTParty.get("#{API::BASE_URL}" + "#{API::PLAN_PATH}", :headers => { "Authorization"=> ENV["PAYSTACK_SECRET_KEY"], "content-type" => "application/json"}) return api end
list_single_plan(body)
click to toggle source
# File lib/paystackapi/core/plan.rb, line 13 def self.list_single_plan(body) api = HTTParty.get("#{API::BASE_URL}" + "#{API::PLAN_PATH}" + "#{body}", :headers => { "Authorization"=> ENV["PAYSTACK_SECRET_KEY"], "content-type" => "application/json"}) return api end
update_plan(body)
click to toggle source
# File lib/paystackapi/core/plan.rb, line 18 def self.update_plan(body) api = HTTParty.put("#{API::BASE_URL}" + "#{API::PLAN_PATH}" + "#{body}", :body => body.to_json, :headers => { "Authorization"=> ENV["PAYSTACK_SECRET_KEY"], "content-type" => "application/json"}) return api end