Module: Stripe::Customer

Defined in:
lib/multistripe/customer.rb

Class Method Summary collapse

Class Method Details

.create(data, apiKey) ⇒ Object



4
5
6
7
8
# File 'lib/multistripe/customer.rb', line 4

def self.create(data, apiKey)
  url = "https://#{apiKey}:@api.stripe.com/v1/customers"
  json =  RestClient.post url, data, :content_type=> :json, :accept => :json
  return JSON.parse(json)
end

.retrieve(id, apiKey) ⇒ Object



10
11
12
13
14
# File 'lib/multistripe/customer.rb', line 10

def self.retrieve(id, apiKey)
  url = "https://#{apiKey}:@api.stripe.com/v1/customers/#{id}"
  json =  RestClient.get url, :accept => :json
  return JSON.parse(json)
end

.subscription(data, id, apiKey) ⇒ Object



22
23
24
25
26
# File 'lib/multistripe/customer.rb', line 22

def self.subscription(data, id, apiKey)
  url = "https://#{apiKey}:@api.stripe.com/v1/customers/#{id}/subscription"
  json =  RestClient.post url, data, :content_type=> :json, :accept => :json
  return JSON.parse(json)
end

.update(data, id, apiKey) ⇒ Object



16
17
18
19
20
# File 'lib/multistripe/customer.rb', line 16

def self.update(data, id, apiKey)
  url = "https://#{apiKey}:@api.stripe.com/v1/customers/#{id}"
  json =  RestClient.post url, data, :content_type=> :json, :accept => :json
  return JSON.parse(json)
end