Class: Sink::Resources::Cards

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Cards

Returns a new instance of Cards.

Parameters:



7
8
9
# File 'lib/sink/resources/cards.rb', line 7

def initialize(client:)
  @client = client
end

Instance Method Details

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

Create a new virtual or physical card. Parameters ‘pin`, `shippingAddress`, and

`product_id` only apply to physical cards.

Parameters:

  • params (Hash{Symbol => Object}) (defaults to: {})

    Attributes to send in this request. @option params [Symbol, Type] :type

    Card types:
    
    - `MERCHANT_LOCKED` - Card is locked to first merchant that successfully
      authorizes the card.
    - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label
      branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality.
      Reach out at [lithic.com/contact](https://lithic.com/contact) for more
      information.
    - `SINGLE_USE` - Card will close shortly after the first transaction.
    - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital
      wallet like Apple Pay or Google Pay (if the card program is digital
      wallet-enabled).
    

    @option params [String, nil] :account_token Only required for multi-account users. Token identifying the account the card

    will be associated with. Only applicable if using account holder enrollment. See
    [Managing Your Program](https://docs.lithic.com/docs/managing-your-program) for
    more information.
    

    @option params [String, nil] :card_program_token Identifies the card program under which to create the card. Different card

    programs may have their own configurations (e.g., digital wallet card art, BIN
    type). This must be configured with Lithic before use.
    

    @option params [String, nil] :exp_month Two digit (MM) expiry month. If neither ‘exp_month` nor `exp_year` is provided,

    an expiration date will be generated.
    

    @option params [String, nil] :exp_year Four digit (yyyy) expiry year. If neither ‘exp_month` nor `exp_year` is

    provided, an expiration date will be generated.
    

    @option params [String, nil] :funding_token The token for the desired ‘FundingAccount` to use when making transactions with

    this card.
    

    @option params [String, nil] :memo Friendly name to identify the card. @option params [String, nil] :not_ Used to test the PythonSDKs ability to handle reserved keywords as parameters @option params [String, nil] :pin Encrypted PIN block (in base64). Only applies to cards of type ‘PHYSICAL` and

    `VIRTUAL`. See
    [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block-enterprise).
    

    @option params [String, nil] :product_id Specifies the configuration (e.g., physical card art) that the card should be

    manufactured with, and only applies to cards of type `PHYSICAL` [beta]. This
    must be configured with Lithic before use.
    

    @option params [Symbol, ShippingMethod, nil] :shipping_method Shipping method for the card. Only applies to cards of type PHYSICAL [beta]. Use

    of options besides `STANDARD` require additional permissions.
    
    - `STANDARD` - USPS regular mail or similar international option, with no
      tracking
    - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option,
      with tracking
    - `EXPEDITED` - FedEx Standard Overnight or similar international option, with
      tracking
    

    @option params [Sink::Models::ShippingAddress, nil] :shipping_address @option params [Integer, nil] :spend_limit Amount (in cents) to limit approved authorizations. Transaction requests above

    the spend limit will be declined.
    

    @option params [Symbol, SpendLimitDuration, nil] :spend_limit_duration

    Spend limit duration values:
    
    - `ANNUALLY` - Card will authorize transactions up to spend limit in a calendar
      year.
    - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime
      of the card.
    - `MONTHLY` - Card will authorize transactions up to spend limit for the
      trailing month. Month is calculated as this calendar date one month prior.
    - `TRANSACTION` - Card will authorizate multiple transactions if each individual
      transaction is under the spend limit.
    

    @option params [Symbol, State, nil] :state

    Card state values:
    
    - `OPEN` - Card will approve authorizations (if they match card and account
      parameters).
    - `PAUSED` - Card will decline authorizations, but can be resumed at a later
      time.
    
  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



83
84
85
86
87
88
89
90
91
92
# File 'lib/sink/resources/cards.rb', line 83

def create(params = {}, opts = {})
  req = {
    method: :post,
    path: "/cards",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::Card
  }
  @client.request(req, opts)
end

#create_aliased(params = {}, opts = {}) ⇒ Sink::Models::Card

Create a new virtual or physical card. Parameters ‘pin`, `shippingAddress`, and

`product_id` only apply to physical cards.

Parameters:

  • params (Hash{Symbol => Object}) (defaults to: {})

    Attributes to send in this request. @option params [Symbol, Type] :type

    Card types:
    
    - `MERCHANT_LOCKED` - Card is locked to first merchant that successfully
      authorizes the card.
    - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label
      branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality.
      Reach out at [lithic.com/contact](https://lithic.com/contact) for more
      information.
    - `SINGLE_USE` - Card will close shortly after the first transaction.
    - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital
      wallet like Apple Pay or Google Pay (if the card program is digital
      wallet-enabled).
    

    @option params [String, nil] :account_token Only required for multi-account users. Token identifying the account the card

    will be associated with. Only applicable if using account holder enrollment. See
    [Managing Your Program](https://docs.lithic.com/docs/managing-your-program) for
    more information.
    

    @option params [String, nil] :card_program_token Identifies the card program under which to create the card. Different card

    programs may have their own configurations (e.g., digital wallet card art, BIN
    type). This must be configured with Lithic before use.
    

    @option params [String, nil] :exp_month Two digit (MM) expiry month. If neither ‘exp_month` nor `exp_year` is provided,

    an expiration date will be generated.
    

    @option params [String, nil] :exp_year Four digit (yyyy) expiry year. If neither ‘exp_month` nor `exp_year` is

    provided, an expiration date will be generated.
    

    @option params [String, nil] :funding_token The token for the desired ‘FundingAccount` to use when making transactions with

    this card.
    

    @option params [String, nil] :memo Friendly name to identify the card. @option params [String, nil] :not_ Used to test the PythonSDKs ability to handle reserved keywords as parameters @option params [String, nil] :pin Encrypted PIN block (in base64). Only applies to cards of type ‘PHYSICAL` and

    `VIRTUAL`. See
    [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block-enterprise).
    

    @option params [String, nil] :product_id Specifies the configuration (e.g., physical card art) that the card should be

    manufactured with, and only applies to cards of type `PHYSICAL` [beta]. This
    must be configured with Lithic before use.
    

    @option params [Symbol, ShippingMethod, nil] :shipping_method Shipping method for the card. Only applies to cards of type PHYSICAL [beta]. Use

    of options besides `STANDARD` require additional permissions.
    
    - `STANDARD` - USPS regular mail or similar international option, with no
      tracking
    - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option,
      with tracking
    - `EXPEDITED` - FedEx Standard Overnight or similar international option, with
      tracking
    

    @option params [Sink::Models::ShippingAddress, nil] :shipping_address @option params [Integer, nil] :spend_limit Amount (in cents) to limit approved authorizations. Transaction requests above

    the spend limit will be declined.
    

    @option params [Symbol, SpendLimitDuration, nil] :spend_limit_duration

    Spend limit duration values:
    
    - `ANNUALLY` - Card will authorize transactions up to spend limit in a calendar
      year.
    - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime
      of the card.
    - `MONTHLY` - Card will authorize transactions up to spend limit for the
      trailing month. Month is calculated as this calendar date one month prior.
    - `TRANSACTION` - Card will authorizate multiple transactions if each individual
      transaction is under the spend limit.
    

    @option params [Symbol, State, nil] :state

    Card state values:
    
    - `OPEN` - Card will approve authorizations (if they match card and account
      parameters).
    - `PAUSED` - Card will decline authorizations, but can be resumed at a later
      time.
    
  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



266
267
268
269
270
271
272
273
274
275
# File 'lib/sink/resources/cards.rb', line 266

def create_aliased(params = {}, opts = {})
  req = {
    method: :post,
    path: "/cards",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::Card
  }
  @client.request(req, opts)
end

#create_aliased_deprecated(params = {}, opts = {}) ⇒ Sink::Models::Card

Create a new virtual or physical card. Parameters ‘pin`, `shippingAddress`, and

`product_id` only apply to physical cards.

Parameters:

  • params (Hash{Symbol => Object}) (defaults to: {})

    Attributes to send in this request. @option params [Symbol, Type] :type

    Card types:
    
    - `MERCHANT_LOCKED` - Card is locked to first merchant that successfully
      authorizes the card.
    - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label
      branding, credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality.
      Reach out at [lithic.com/contact](https://lithic.com/contact) for more
      information.
    - `SINGLE_USE` - Card will close shortly after the first transaction.
    - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital
      wallet like Apple Pay or Google Pay (if the card program is digital
      wallet-enabled).
    

    @option params [String, nil] :account_token Only required for multi-account users. Token identifying the account the card

    will be associated with. Only applicable if using account holder enrollment. See
    [Managing Your Program](https://docs.lithic.com/docs/managing-your-program) for
    more information.
    

    @option params [String, nil] :card_program_token Identifies the card program under which to create the card. Different card

    programs may have their own configurations (e.g., digital wallet card art, BIN
    type). This must be configured with Lithic before use.
    

    @option params [String, nil] :exp_month Two digit (MM) expiry month. If neither ‘exp_month` nor `exp_year` is provided,

    an expiration date will be generated.
    

    @option params [String, nil] :exp_year Four digit (yyyy) expiry year. If neither ‘exp_month` nor `exp_year` is

    provided, an expiration date will be generated.
    

    @option params [String, nil] :funding_token The token for the desired ‘FundingAccount` to use when making transactions with

    this card.
    

    @option params [String, nil] :memo Friendly name to identify the card. @option params [String, nil] :not_ Used to test the PythonSDKs ability to handle reserved keywords as parameters @option params [String, nil] :pin Encrypted PIN block (in base64). Only applies to cards of type ‘PHYSICAL` and

    `VIRTUAL`. See
    [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block-enterprise).
    

    @option params [String, nil] :product_id Specifies the configuration (e.g., physical card art) that the card should be

    manufactured with, and only applies to cards of type `PHYSICAL` [beta]. This
    must be configured with Lithic before use.
    

    @option params [Symbol, ShippingMethod, nil] :shipping_method Shipping method for the card. Only applies to cards of type PHYSICAL [beta]. Use

    of options besides `STANDARD` require additional permissions.
    
    - `STANDARD` - USPS regular mail or similar international option, with no
      tracking
    - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option,
      with tracking
    - `EXPEDITED` - FedEx Standard Overnight or similar international option, with
      tracking
    

    @option params [Sink::Models::ShippingAddress, nil] :shipping_address @option params [Integer, nil] :spend_limit Amount (in cents) to limit approved authorizations. Transaction requests above

    the spend limit will be declined.
    

    @option params [Symbol, SpendLimitDuration, nil] :spend_limit_duration

    Spend limit duration values:
    
    - `ANNUALLY` - Card will authorize transactions up to spend limit in a calendar
      year.
    - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime
      of the card.
    - `MONTHLY` - Card will authorize transactions up to spend limit for the
      trailing month. Month is calculated as this calendar date one month prior.
    - `TRANSACTION` - Card will authorizate multiple transactions if each individual
      transaction is under the spend limit.
    

    @option params [Symbol, State, nil] :state

    Card state values:
    
    - `OPEN` - Card will approve authorizations (if they match card and account
      parameters).
    - `PAUSED` - Card will decline authorizations, but can be resumed at a later
      time.
    
  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



349
350
351
352
353
354
355
356
357
358
# File 'lib/sink/resources/cards.rb', line 349

def create_aliased_deprecated(params = {}, opts = {})
  req = {
    method: :post,
    path: "/cards",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::Card
  }
  @client.request(req, opts)
end

#deprecated_all_but_go_diff_message(opts = {}) ⇒ nil

Endpoint that represents a method that has been marked as deprecated in the

stainless config for all languages, but with a different method in go.

Parameters:

  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


366
367
368
369
370
371
372
373
# File 'lib/sink/resources/cards.rb', line 366

def deprecated_all_but_go_diff_message(opts = {})
  req = {
    method: :post,
    path: "/deprecations/method_all_but_go_diff_message",
    model: NilClass
  }
  @client.request(req, opts)
end

#deprecated_all_diff_message(opts = {}) ⇒ nil

Endpoint that represents a method that has been marked as deprecated in the

stainless config for all languages, but with a different method in go.

Parameters:

  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


381
382
383
384
385
386
387
388
# File 'lib/sink/resources/cards.rb', line 381

def deprecated_all_diff_message(opts = {})
  req = {
    method: :post,
    path: "/deprecations/method_all_but_go_diff_message",
    model: NilClass
  }
  @client.request(req, opts)
end

#deprecated_method(opts = {}) ⇒ nil

Endpoint that represents a method that has been marked as deprecated in the

stainless config.

Parameters:

  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


396
397
398
399
400
401
402
403
# File 'lib/sink/resources/cards.rb', line 396

def deprecated_method(opts = {})
  req = {
    method: :post,
    path: "/deprecations/method",
    model: NilClass
  }
  @client.request(req, opts)
end

#deprecated_only_go(opts = {}) ⇒ nil

Endpoint that represents a method that has been marked as deprecated in the

stainless config for go only.

Parameters:

  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:

  • (nil)


411
412
413
414
415
416
417
418
# File 'lib/sink/resources/cards.rb', line 411

def deprecated_only_go(opts = {})
  req = {
    method: :post,
    path: "/deprecations/method_only_go",
    model: NilClass
  }
  @client.request(req, opts)
end

#list(params = {}, opts = {}) ⇒ Sink::Models::CardListResponse

List cards.

Parameters:

  • params (Hash{Symbol => Object}) (defaults to: {})

    Attributes to send in this request. @option params [Time] :begin_ Date string in 8601 format. Only entries created after the specified date will

    be included. UTC time zone.
    

    @option params [Time] :end_ Date string in 8601 format. Only entries created before the specified date will

    be included. UTC time zone.
    

    @option params [String, nil] :account_token Only required for multi-account users. Returns cards associated with this

    account. Only applicable if using account holder enrollment. See
    [Managing Your Program](https://docs.lithic.com/docs/managing-your-program) for
    more information.
    

    @option params [Integer, nil] :page Page (for pagination). @option params [Integer, nil] :page_size Page size (for pagination).

  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



184
185
186
187
188
189
190
191
192
# File 'lib/sink/resources/cards.rb', line 184

def list(params = {}, opts = {})
  req = {
    method: :get,
    path: "/cards",
    query: params,
    model: Sink::Models::CardListResponse
  }
  @client.request(req, opts)
end

#list_not_paginated(card_token, opts = {}) ⇒ Sink::Models::Card

Get card configuration such as spend limit and state.

Parameters:

  • card_token (String)
  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



426
427
428
429
430
431
432
433
# File 'lib/sink/resources/cards.rb', line 426

def list_not_paginated(card_token, opts = {})
  req = {
    method: :get,
    path: "/cards/#{card_token}",
    model: Sink::Models::Card
  }
  @client.request(req, opts)
end

#provision_foo(card_token, params = {}, opts = {}) ⇒ Sink::Models::CardProvisionFooResponse

Allow your cardholders to directly add payment cards to the device’s digital

wallet (e.g. Apple Pay) with one touch from your app.

This requires some additional setup and configuration. Please
[Contact Us](https://lithic.com/contact) or your Customer Success representative
for more information.

Parameters:

  • card_token (String)

    The unique token of the card to add to the device’s digital wallet.

  • params (Hash{Symbol => Object}) (defaults to: {})

    Attributes to send in this request. @option params [String, nil] :account_token Only required for multi-account users. Token identifying the account the card

    will be associated with. Only applicable if using account holder enrollment. See
    [Managing Your Program](https://docs.lithic.com/docs/managing-your-program) for
    more information.
    

    @option params [String, nil] :certificate Required for ‘APPLE_PAY`. Apple’s public leaf certificate. Base64 encoded in PEM

    format with headers `(-----BEGIN CERTIFICATE-----)` and trailers omitted.
    Provided by the device's wallet.
    

    @option params [Symbol, DigitalWallet, nil] :digital_wallet Name of digital wallet provider. @option params [String, nil] :nonce Required for ‘APPLE_PAY`. Base64 cryptographic nonce provided by the device’s

    wallet.
    

    @option params [String, nil] :nonce_signature Required for ‘APPLE_PAY`. Base64 cryptographic nonce provided by the device’s

    wallet.
    
  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



461
462
463
464
465
466
467
468
469
470
# File 'lib/sink/resources/cards.rb', line 461

def provision_foo(card_token, params = {}, opts = {})
  req = {
    method: :post,
    path: "/cards/#{card_token}/provision",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::CardProvisionFooResponse
  }
  @client.request(req, opts)
end

#reissue(card_token, params = {}, opts = {}) ⇒ Sink::Models::Card

Initiate print and shipment of a duplicate card.

Only applies to cards of type `PHYSICAL` [beta].

Parameters:

  • card_token (String)
  • params (Hash{Symbol => Object}) (defaults to: {})

    Attributes to send in this request. @option params [String, nil] :product_id Specifies the configuration (e.g. physical card art) that the card should be

    manufactured with, and only applies to cards of type `PHYSICAL` [beta]. This
    must be configured with Lithic before use.
    

    @option params [Symbol, ShippingMethod, nil] :shipping_method Shipping method for the card. Use of options besides ‘STANDARD` require

    additional permissions.
    
    - `STANDARD` - USPS regular mail or similar international option, with no
      tracking
    - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option,
      with tracking
    - `EXPEDITED` - FedEx Standard Overnight or similar international option, with
      tracking
    

    @option params [Sink::Models::ShippingAddress, nil] :shipping_address If omitted, the previous shipping address will be used.

  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



496
497
498
499
500
501
502
503
504
505
# File 'lib/sink/resources/cards.rb', line 496

def reissue(card_token, params = {}, opts = {})
  req = {
    method: :post,
    path: "/cards/#{card_token}/reissue",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::Card
  }
  @client.request(req, opts)
end

#retrieve(card_token, opts = {}) ⇒ Sink::Models::Card

Get card configuration such as spend limit and state.

Parameters:

  • card_token (String)
  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



100
101
102
103
104
105
106
107
# File 'lib/sink/resources/cards.rb', line 100

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

#update(card_token, params = {}, opts = {}) ⇒ Sink::Models::Card

Update the specified properties of the card. Unsupplied properties will remain

unchanged. `pin` parameter only applies to physical cards.

_Note: setting a card to a `CLOSED` state is a final action that cannot be
undone._

Parameters:

  • card_token (String)
  • params (Hash{Symbol => Object}) (defaults to: {})

    Attributes to send in this request. @option params [String, nil] :account_token Only required for multi-account users. Token identifying the account the card

    will be associated with. Only applicable if using account holder enrollment. See
    [Managing Your Program](https://docs.lithic.com/docs/managing-your-program) for
    more information.
    

    @option params [String, nil] :auth_rule_token Identifier for any Auth Rules that will be applied to transactions taking place

    with the card.
    

    @option params [String, nil] :funding_token The token for the desired ‘FundingAccount` to use when making transactions with

    this card.
    

    @option params [String, nil] :memo Friendly name to identify the card. @option params [String, nil] :pin Encrypted PIN block (in base64). Only applies to cards of type ‘PHYSICAL` and

    `VIRTUAL`. See
    [Encrypted PIN Block](https://docs.lithic.com/docs/cards#encrypted-pin-block-enterprise).
    

    @option params [Integer, nil] :spend_limit Amount (in cents) to limit approved authorizations. Transaction requests above

    the spend limit will be declined.
    

    @option params [Symbol, SpendLimitDuration, nil] :spend_limit_duration

    Spend limit duration values:
    
    - `ANNUALLY` - Card will authorize transactions up to spend limit in a calendar
      year.
    - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime
      of the card.
    - `MONTHLY` - Card will authorize transactions up to spend limit for the
      trailing month. Month is calculated as this calendar date one month prior.
    - `TRANSACTION` - Card will authorizate multiple transactions if each individual
      transaction is under the spend limit.
    

    @option params [Symbol, State, nil] :state

    Card state values:
    
    - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot
      be undone.
    - `OPEN` - Card will approve authorizations (if they match card and account
      parameters).
    - `PAUSED` - Card will decline authorizations, but can be resumed at a later
      time.
    
  • opts (Hash, Sink::RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



156
157
158
159
160
161
162
163
164
165
# File 'lib/sink/resources/cards.rb', line 156

def update(card_token, params = {}, opts = {})
  req = {
    method: :patch,
    path: "/cards/#{card_token}",
    body: params,
    headers: {"Content-Type" => "application/json"},
    model: Sink::Models::Card
  }
  @client.request(req, opts)
end