Class: Sink::Models::Card

Inherits:
BaseModel show all
Defined in:
lib/sink/models/card.rb

Defined Under Namespace

Classes: SpendLimitDuration, State, Type

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#[], #deconstruct_keys, #inspect, #to_h, #to_s

Constructor Details

#initialize(data = {}) ⇒ Card

Create a new instance of Card from a Hash of raw data.

Parameters:

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

    . @option data [String] :token Globally unique identifier. @option data [String] :created An ISO 8601 timestamp for when the card was created. UTC time zone. @option data [Object] :funding @option data [String] :lastFour Last four digits of the card number. @option data [Integer] :spend_limit Amount (in cents) to limit approved authorizations. Transaction requests above the spend limit will be declined. @option data [String] :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 data [String] :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.
    - `PENDING_FULFILLMENT` - The initial state for cards of type `PHYSICAL`. The
    card is provisioned pending manufacturing and fulfillment. Cards in this state
    can accept authorizations for e-commerce purchases, but not for "Card Present"
    purchases where the physical card itself is present.
    - `PENDING_ACTIVATION` - Each business day at 2pm Eastern Time Zone (ET), cards
    of type `PHYSICAL` in state `PENDING_FULFILLMENT` are sent to the card
    production warehouse and updated to state `PENDING_ACTIVATION` . Similar to
    `PENDING_FULFILLMENT`, cards in this state can be used for e-commerce
    transactions. API clients should update the card's state to `OPEN` only after
    the cardholder confirms receipt of the card.
    
    In sandbox, the same daily batch fulfillment occurs, but no cards are actually
    manufactured.
    

    @option data [String] :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 data [Array, nil] :auth_rule_tokens List of identifiers for the Auth Rule(s) that are applied on the card. @option data [String, nil] :cvv Three digit cvv printed on the back of the card. @option data [String, nil] :exp_month Two digit (MM) expiry month. @option data [String, nil] :exp_year Four digit (yyyy) expiry year. @option data [String, nil] :hostname Hostname of card’s locked merchant (will be empty if not applicable). @option data [String, nil] :memo Friendly name to identify the card. @option data [String, nil] :pan Primary Account Number (PAN) (i.e. the card number). Customers must be PCI compliant to have PAN returned as a field in production. Please contact [email protected] for questions.



65
# File 'lib/sink/models/card.rb', line 65

def initialize(data = {}) = super

Instance Attribute Details

#auth_rule_tokens ⇒ Array<String>

List of identifiers for the Auth Rule(s) that are applied on the card.

Returns:

  • (Array<String>)


67
# File 'lib/sink/models/card.rb', line 67

optional :auth_rule_tokens, Sink::ArrayOf.new(String)

#created ⇒ Time

An ISO 8601 timestamp for when the card was created. UTC time zone.

Returns:

  • (Time)


14
# File 'lib/sink/models/card.rb', line 14

required :created, Time

#cvv ⇒ String

Three digit cvv printed on the back of the card.

Returns:

  • (String)


72
# File 'lib/sink/models/card.rb', line 72

optional :cvv, String

#exp_month ⇒ String

Two digit (MM) expiry month.

Returns:

  • (String)


77
# File 'lib/sink/models/card.rb', line 77

optional :exp_month, String

#exp_year ⇒ String

Four digit (yyyy) expiry year.

Returns:

  • (String)


82
# File 'lib/sink/models/card.rb', line 82

optional :exp_year, String

#funding ⇒ Sink::Models::FundingAccount



18
# File 'lib/sink/models/card.rb', line 18

required :funding, -> { Sink::Models::FundingAccount }

#hostname ⇒ String

Hostname of card’s locked merchant (will be empty if not applicable).

Returns:

  • (String)


87
# File 'lib/sink/models/card.rb', line 87

optional :hostname, String

#last_four ⇒ String

Last four digits of the card number.

Returns:

  • (String)


23
# File 'lib/sink/models/card.rb', line 23

required :last_four, String, api_name: :lastFour

#memo ⇒ String

Friendly name to identify the card.

Returns:

  • (String)


92
# File 'lib/sink/models/card.rb', line 92

optional :memo, String

#pan ⇒ String

Primary Account Number (PAN) (i.e. the card number). Customers must be PCI compliant to have PAN returned as a field in production. Please contact [email protected] for questions.

Returns:

  • (String)


98
# File 'lib/sink/models/card.rb', line 98

optional :pan, String

#spend_limit ⇒ Integer

Amount (in cents) to limit approved authorizations. Transaction requests above the spend limit will be declined.

Returns:

  • (Integer)


28
# File 'lib/sink/models/card.rb', line 28

required :spend_limit, Integer

#spend_limit_duration ⇒ Object

Spend limit duration values:



38
# File 'lib/sink/models/card.rb', line 38

required :spend_limit_duration, enum: -> { Sink::Models::Card::SpendLimitDuration }

#state ⇒ Object

Card state values:



51
# File 'lib/sink/models/card.rb', line 51

required :state, enum: -> { Sink::Models::Card::State }

#token ⇒ String

Globally unique identifier.

Returns:

  • (String)


9
# File 'lib/sink/models/card.rb', line 9

required :token, String

#type ⇒ Object

Card types:



61
# File 'lib/sink/models/card.rb', line 61

required :type, enum: -> { Sink::Models::Card::Type }