Class: Increase::Resources::Cards

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Cards

Returns a new instance of Cards.



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

def initialize(client:)
  @client = client
end

Instance Method Details

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

Create a 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):

  • :account_id (String)

    The Account the card should belong to.

  • :billing_address (BillingAddress)

    The card's billing address.

  • :description (String)

    The description you choose to give the card.

  • :digital_wallet (DigitalWallet)

    The contact information used in the two-factor steps for digital wallet card creation. To add the card to a digital wallet, you may supply an email or phone number with this request. Otherwise, subscribe and then action a Real Time Decision with the category digital_wallet_token_requested or digital_wallet_authentication_requested.

  • :entity_id (String)

    The Entity the card belongs to. You only need to supply this in rare situations when the card is not for the Account holder.

Returns:



27
28
29
30
31
32
33
34
# File 'lib/increase/resources/cards.rb', line 27

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

#details(card_id, opts = {}) ⇒ Increase::Models::CardDetails

Retrieve sensitive details for a Card

Parameters:

  • card_id (String)

    The identifier of the Card to retrieve details for.

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

    Options to specify HTTP behaviour for this request.

Returns:



108
109
110
111
112
113
114
# File 'lib/increase/resources/cards.rb', line 108

def details(card_id, opts = {})
  req = {}
  req[:method] = :get
  req[:path] = "/cards/#{card_id}/details"
  req[:model] = Increase::Models::CardDetails
  @client.request(req, opts)
end

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

List 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):

  • :account_id (String)

    Filter Cards to ones belonging to the specified Account.

  • :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:



92
93
94
95
96
97
98
99
100
# File 'lib/increase/resources/cards.rb', line 92

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

#retrieve(card_id, opts = {}) ⇒ Increase::Models::Card

Retrieve a Card

Parameters:

  • card_id (String)

    The identifier of the Card.

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

    Options to specify HTTP behaviour for this request.

Returns:



42
43
44
45
46
47
48
# File 'lib/increase/resources/cards.rb', line 42

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

#update(card_id, params = {}, opts = {}) ⇒ Increase::Models::Card

Update a Card

Parameters:

  • card_id (String)

    The 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):

  • :billing_address (BillingAddress)

    The card's updated billing address.

  • :description (String)

    The description you choose to give the card.

  • :digital_wallet (DigitalWallet)

    The contact information used in the two-factor steps for digital wallet card creation. At least one field must be present to complete the digital wallet steps.

  • :entity_id (String)

    The Entity the card belongs to. You only need to supply this in rare situations when the card is not for the Account holder.

  • :status (Symbol)

    The status to update the Card with.

Returns:



67
68
69
70
71
72
73
74
# File 'lib/increase/resources/cards.rb', line 67

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