Class: Stripe::Card

Inherits:
APIResource show all
Includes:
APIOperations::Delete, APIOperations::List, APIOperations::Update
Defined in:
lib/stripe/card.rb

Instance Attribute Summary

Attributes inherited from StripeObject

#api_key

Class Method Summary collapse

Instance Method Summary collapse

Methods included from APIOperations::List

included

Methods included from APIOperations::Delete

#delete

Methods included from APIOperations::Update

#save, #serialize_metadata, #serialize_params

Methods inherited from APIResource

class_name, #refresh, url

Methods inherited from StripeObject

#[], #[]=, #_dump, _load, #as_json, construct_from, #each, #initialize, #inspect, #keys, #refresh_from, #respond_to?, #to_hash, #to_json, #to_s, #values

Constructor Details

This class inherits a constructor from Stripe::StripeObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject

Class Method Details

.retrieve(id, api_key = nil) ⇒ Object

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/stripe/card.rb', line 15

def self.retrieve(id, api_key=nil)
  raise NotImplementedError.new("Cards cannot be retrieved without a customer ID. Retrieve a card using customer.cards.retrieve('card_id')")
end

Instance Method Details

#urlObject



7
8
9
10
11
12
13
# File 'lib/stripe/card.rb', line 7

def url
  if respond_to?(:recipient)
    "#{Recipient.url}/#{CGI.escape(recipient)}/cards/#{CGI.escape(id)}"
  elsif respond_to?(:customer)
    "#{Customer.url}/#{CGI.escape(customer)}/cards/#{CGI.escape(id)}"
  end
end