Class: Subscriptions

Inherits:
Base
  • Object
show all
Defined in:
lib/flutterwave_sdk/flutterwave_objects/subscriptions.rb

Instance Attribute Summary

Attributes inherited from Base

#flutterwave_object

Instance Method Summary collapse

Methods inherited from Base

#check_passed_parameters, #delete_request, #get_request, #initialize, #post_request, #put_request

Constructor Details

This class inherits a constructor from Base

Instance Method Details

#activate_subscription(id) ⇒ Object



19
20
21
22
23
24
# File 'lib/flutterwave_sdk/flutterwave_objects/subscriptions.rb', line 19

def activate_subscription(id)
    base_url = flutterwave_object.base_url
    payload = {}
    payload = payload.to_json
    response = put_request("#{base_url}/subscriptions/#{id}/activate", payload) 
end

#cancel_subscription(id) ⇒ Object



12
13
14
15
16
17
# File 'lib/flutterwave_sdk/flutterwave_objects/subscriptions.rb', line 12

def cancel_subscription(id)
    base_url = flutterwave_object.base_url
    payload = {}
    payload = payload.to_json
    response = put_request("#{base_url}/subscriptions/#{id}/cancel", payload) 
end

#get_all_subscriptionsObject



6
7
8
9
10
# File 'lib/flutterwave_sdk/flutterwave_objects/subscriptions.rb', line 6

def get_all_subscriptions
    base_url = flutterwave_object.base_url 
    response = get_request("#{base_url}/subscriptions")
    return response
end