Class: Paystack::Resources::Subscription

Inherits:
BaseResource show all
Defined in:
lib/paystack/resources/subscription.rb

Instance Method Summary collapse

Methods inherited from BaseResource

new

Instance Method Details

#create(body = {}) ⇒ Object

Create Subscription POST /subscription



10
11
12
# File 'lib/paystack/resources/subscription.rb', line 10

def create(body = {})
  @transport.post("/subscription", body: body)
end

#disable(body = {}) ⇒ Object

Disable Subscription POST /subscription/disable



17
18
19
# File 'lib/paystack/resources/subscription.rb', line 17

def disable(body = {})
  @transport.post("/subscription/disable", body: body)
end

#enable(body = {}) ⇒ Object

Enable Subscription POST /subscription/enable



24
25
26
# File 'lib/paystack/resources/subscription.rb', line 24

def enable(body = {})
  @transport.post("/subscription/enable", body: body)
end

#fetch(code) ⇒ Object

Fetch Subscription GET /subscription/code



31
32
33
# File 'lib/paystack/resources/subscription.rb', line 31

def fetch(code)
  @transport.get("/subscription/#{code}")
end

#list(query = {}) ⇒ Object

List Subscriptions GET /subscription



38
39
40
# File 'lib/paystack/resources/subscription.rb', line 38

def list(query = {})
  @transport.get("/subscription", query: query)
end

#manage_email(code) ⇒ Object

Send Update Subscription Link POST /subscription/code/manage/email



45
46
47
# File 'lib/paystack/resources/subscription.rb', line 45

def manage_email(code)
  @transport.post("/subscription/#{code}/manage/email")
end

Generate Update Subscription Link GET /subscription/code/manage/link



52
53
54
# File 'lib/paystack/resources/subscription.rb', line 52

def manage_link(code)
  @transport.get("/subscription/#{code}/manage/link")
end