class Brickwall::API::Subscription
Public Class Methods
cancel(subscription_id)
click to toggle source
# File lib/brickwall/api/subscription.rb, line 22 def self.cancel(subscription_id) response = RestClient.post API.url("subscription/#{subscription_id}/cancel"), {}, { 'X-ApiKey' => Brickwall.configuration.brick_private_key } JSON.parse response end
create(params = {})
click to toggle source
# File lib/brickwall/api/subscription.rb, line 5 def self.create(params = {}) response = RestClient.post API.url('subscription'), params, { 'X-ApiKey' => Brickwall.configuration.brick_private_key } JSON.parse response rescue RestClient::Exception => e err = JSON.parse e.response Error.new err['type'], err['error'], err['code'] end
get(subscription_id)
click to toggle source
# File lib/brickwall/api/subscription.rb, line 15 def self.get(subscription_id) response = RestClient.get API.url("subscription/#{subscription_id}"), { 'X-ApiKey' => Brickwall.configuration.brick_private_key } JSON.parse response end