Sha256: 96beb8cd26a9d6124684ad705b6db1ea6a4fa3345fdc06349a65216805911f78

Contents?: true

Size: 802 Bytes

Versions: 11

Compression:

Stored size: 802 Bytes

Contents

require 'paysafe/result'

module Paysafe
  class Card < Result

    BRANDS = {
      'AM' => 'american_express',
      'DC' => 'diners_club',
      'DI' => 'discover',
      'JC' => 'jcb',
      'MC' => 'master',
      'MD' => 'maestro',
      'SF' => 'swiff',
      'SO' => 'solo',
      'VI' => 'visa',
      'VD' => 'visa_debit',
      'VE' => 'visa_electron',
    }

    attributes :id, :nick_name, :merchant_ref_num, :holder_name,
      :card_num, :card_bin, :last_digits, :card_type, :billing_address_id,
      :default_card_indicator, :payment_token, :single_use_token, :status,
      :cvv, :track1, :track2, :type

    object_attribute :CardExpiry, :card_expiry
    object_attribute :Address, :billing_address

    def brand
      @brand ||= BRANDS[card_type] || BRANDS[type]
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
paysafe-0.16.0 lib/paysafe/card.rb
paysafe-0.15.0 lib/paysafe/card.rb
paysafe-0.14.0 lib/paysafe/card.rb
paysafe-0.13.0 lib/paysafe/card.rb
paysafe-0.12.0 lib/paysafe/card.rb
paysafe-0.11.0 lib/paysafe/card.rb
paysafe-0.10.0 lib/paysafe/card.rb
paysafe-0.9.4 lib/paysafe/card.rb
paysafe-0.9.3 lib/paysafe/card.rb
paysafe-0.9.2 lib/paysafe/card.rb
paysafe-0.9.1 lib/paysafe/card.rb