Class: Paystackapi::PaystackPlans
- Inherits:
-
Object
- Object
- Paystackapi::PaystackPlans
- Defined in:
- lib/paystackapi.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
56 57 58 59 60 61 |
# File 'lib/paystackapi.rb', line 56 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
62 63 64 65 66 |
# File 'lib/paystackapi.rb', line 62 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
67 68 69 70 71 |
# File 'lib/paystackapi.rb', line 67 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
72 73 74 75 76 77 |
# File 'lib/paystackapi.rb', line 72 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 |