Module: Subscription
- Defined in:
- lib/paystackapi/core/subscription.rb
Class Method Summary collapse
- .create_subscription(body) ⇒ Object
- .disable_subscription ⇒ Object
- .enable_subscription ⇒ Object
- .list_single_subscription(body) ⇒ Object
- .list_subscription ⇒ Object
Class Method Details
.create_subscription(body) ⇒ Object
2 3 4 5 6 7 |
# File 'lib/paystackapi/core/subscription.rb', line 2 def self.create_subscription(body) api = HTTParty.post("#{API::BASE_URL}" + "#{API::SUBSCRIPTION_PATH}", :body => body.to_json, :headers => { "Authorization"=> ENV["PAYSTACK_SECRET_KEY"], "content-type" => "application/json"}) return api end |
.disable_subscription ⇒ Object
18 19 20 21 22 23 |
# File 'lib/paystackapi/core/subscription.rb', line 18 def self.disable_subscription api = HTTParty.post("#{API::BASE_URL}" + "#{API::SUBSCRIPTION_PATH}/" + "disable", :body => body.to_json, :headers => { "Authorization"=> ENV["PAYSTACK_SECRET_KEY"], "content-type" => "application/json"}) return api end |
.enable_subscription ⇒ Object
24 25 26 27 28 29 |
# File 'lib/paystackapi/core/subscription.rb', line 24 def self.enable_subscription api = HTTParty.post("#{API::BASE_URL}" + "#{API::SUBSCRIPTION_PATH}/" + "enable", :body => body.to_json, :headers => { "Authorization"=> ENV["PAYSTACK_SECRET_KEY"], "content-type" => "application/json"}) return api end |
.list_single_subscription(body) ⇒ Object
13 14 15 16 17 |
# File 'lib/paystackapi/core/subscription.rb', line 13 def self.list_single_subscription(body) api = HTTParty.get("#{API::BASE_URL}" + "#{API::SUBSCRIPTION_PATH}" + "#{body}", :headers => { "Authorization"=> ENV["PAYSTACK_SECRET_KEY"], "content-type" => "application/json"}) return api end |
.list_subscription ⇒ Object
8 9 10 11 12 |
# File 'lib/paystackapi/core/subscription.rb', line 8 def self.list_subscription api = HTTParty.get("#{API::BASE_URL}" + "#{API::SUBSCRIPTION_PATH}", :headers => { "Authorization"=> ENV["PAYSTACK_SECRET_KEY"], "content-type" => "application/json"}) return api end |