Class: Increase::Resources::PhysicalCards

Inherits:
Object
  • Object
show all
Defined in:
lib/increase/resources/physical_cards.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ PhysicalCards

Returns a new instance of PhysicalCards.



6
7
8
# File 'lib/increase/resources/physical_cards.rb', line 6

def initialize(client:)
  @client = client
end

Instance Method Details

#create(params = {}, opts = {}) ⇒ Increase::Models::PhysicalCard

Create a Physical Card

Parameters:

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :card_id (String)

    The underlying card representing this physical card.

  • :cardholder (Cardholder)

    Details about the cardholder, as it will appear on the physical card.

  • :shipment (Shipment)

    The details used to ship this physical card.

  • :physical_card_profile_id (String)

    The physical card profile to use for this physical card. The latest default physical card profile will be used if not provided.

Returns:



22
23
24
25
26
27
28
29
# File 'lib/increase/resources/physical_cards.rb', line 22

def create(params = {}, opts = {})
  req = {}
  req[:method] = :post
  req[:path] = "/physical_cards"
  req[:body] = params
  req[:model] = Increase::Models::PhysicalCard
  @client.request(req, opts)
end

#list(params = {}, opts = {}) ⇒ Increase::Page<Increase::Models::PhysicalCard>

List Physical Cards

Parameters:

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :card_id (String)

    Filter Physical Cards to ones belonging to the specified Card.

  • :created_at (CreatedAt)
  • :cursor (String)

    Return the page of entries after this one.

  • :idempotency_key (String)

    Filter records to the one with the specified idempotency_key you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about idempotency.

  • :limit (Integer)

    Limit the size of the list that is returned. The default (and maximum) is 100 objects.

Returns:



80
81
82
83
84
85
86
87
88
# File 'lib/increase/resources/physical_cards.rb', line 80

def list(params = {}, opts = {})
  req = {}
  req[:method] = :get
  req[:path] = "/physical_cards"
  req[:query] = params
  req[:page] = Increase::Page
  req[:model] = Increase::Models::PhysicalCard
  @client.request(req, opts)
end

#retrieve(physical_card_id, opts = {}) ⇒ Increase::Models::PhysicalCard

Retrieve a Physical Card

Parameters:

  • physical_card_id (String)

    The identifier of the Physical Card.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



37
38
39
40
41
42
43
# File 'lib/increase/resources/physical_cards.rb', line 37

def retrieve(physical_card_id, opts = {})
  req = {}
  req[:method] = :get
  req[:path] = "/physical_cards/#{physical_card_id}"
  req[:model] = Increase::Models::PhysicalCard
  @client.request(req, opts)
end

#update(physical_card_id, params = {}, opts = {}) ⇒ Increase::Models::PhysicalCard

Update a Physical Card

Parameters:

  • physical_card_id (String)

    The Physical Card identifier.

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :status (Symbol)

    The status to update the Physical Card to.

Returns:



55
56
57
58
59
60
61
62
# File 'lib/increase/resources/physical_cards.rb', line 55

def update(physical_card_id, params = {}, opts = {})
  req = {}
  req[:method] = :patch
  req[:path] = "/physical_cards/#{physical_card_id}"
  req[:body] = params
  req[:model] = Increase::Models::PhysicalCard
  @client.request(req, opts)
end