Class: Paystackapi::PaystackSubscription
- Inherits:
-
Object
- Object
- Paystackapi::PaystackSubscription
- Defined in:
- lib/paystackapi.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
82 83 84 85 86 87 |
# File 'lib/paystackapi.rb', line 82 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
98 99 100 101 102 103 |
# File 'lib/paystackapi.rb', line 98 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
104 105 106 107 108 109 |
# File 'lib/paystackapi.rb', line 104 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
93 94 95 96 97 |
# File 'lib/paystackapi.rb', line 93 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
88 89 90 91 92 |
# File 'lib/paystackapi.rb', line 88 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 |