Class: Paystackapi::PaystackSubscription

Inherits:
Object
  • Object
show all
Defined in:
lib/paystackapi.rb

Class Method Summary collapse

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_subscriptionObject



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_subscriptionObject



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_subscriptionObject



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