Class: Sendara::Resources::Billing

Inherits:
Sendara::Resource show all
Defined in:
lib/sendara/resources/billing.rb

Instance Method Summary collapse

Methods inherited from Sendara::Resource

#initialize

Constructor Details

This class inherits a constructor from Sendara::Resource

Instance Method Details

#checkout(plan: nil, period: nil) ⇒ Object



10
11
12
13
14
# File 'lib/sendara/resources/billing.rb', line 10

def checkout(plan: nil, period: nil)
  body = compact_params("plan" => plan, "period" => period)
  response = request(:post, "/v1/billing/checkout", body: body) || {}
  response["url"].to_s
end

#getObject



6
7
8
# File 'lib/sendara/resources/billing.rb', line 6

def get
  request(:get, "/v1/billing") || {}
end

#portalObject



16
17
18
19
# File 'lib/sendara/resources/billing.rb', line 16

def portal
  response = request(:post, "/v1/billing/portal") || {}
  response["url"].to_s
end