Module: Plan
- Defined in:
- lib/paystackapi/core/plan.rb
Class Method Summary collapse
- .create_plan(body) ⇒ Object
- .list_plans ⇒ Object
- .list_single_plan(body) ⇒ Object
- .update_plan(body) ⇒ Object
Class Method Details
.create_plan(body) ⇒ Object
2 3 4 5 6 7 |
# 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 ⇒ Object
8 9 10 11 12 |
# 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) ⇒ Object
13 14 15 16 17 |
# 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) ⇒ Object
18 19 20 21 22 23 |
# 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 |