Class: Payjp::Card

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

Methods included from APIOperations::Create

included

Methods inherited from APIResource

class_name, #refresh, url

Methods included from APIOperations::Request

included

Methods inherited from PayjpObject

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

Constructor Details

This class inherits a constructor from Payjp::PayjpObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Payjp::PayjpObject

Class Method Details

.retrieve(_id, _opts = nil) ⇒ Object

Raises:

  • (NotImplementedError)


14
15
16
# File 'lib/payjp/card.rb', line 14

def self.retrieve(_id, _opts = 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



8
9
10
11
12
# File 'lib/payjp/card.rb', line 8

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