Sha256: 30a976b9f5eec2e33736b8bf429691724754bf80cf592ce9c3a9aaeaba134fbb

Contents?: true

Size: 1.19 KB

Versions: 13

Compression:

Stored size: 1.19 KB

Contents

module VaultedBilling
  class CreditCard
    attr_accessor :vault_id
    attr_accessor :currency
    attr_accessor :card_number
    attr_accessor :cvv_number
    attr_accessor :expires_on
    attr_accessor :first_name
    attr_accessor :last_name
    attr_accessor :street_address
    attr_accessor :locality
    attr_accessor :region
    attr_accessor :postal_code
    attr_accessor :country
    attr_accessor :phone

    def initialize(attributes = {})
      attributes = HashWithIndifferentAccess.new(attributes)
      attributes.each_pair do |key, value|
        send("#{key}=", value) if respond_to?("#{key}=")
      end
    end

    def to_vaulted_billing; self; end

    def ==(o)
      self.attributes == o.attributes
    end

    def attributes
      {
        :vault_id => vault_id,
        :currency => currency,
        :card_number => card_number,
        :cvv_number => cvv_number,
        :expires_on => expires_on,
        :first_name => first_name,
        :last_name => last_name,
        :street_address => street_address,
        :locality => locality,
        :region => region,
        :postal_code => postal_code,
        :country => country,
        :phone => phone
      }
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
vaulted_billing-0.0.14 lib/vaulted_billing/credit_card.rb
vaulted_billing-0.0.13 lib/vaulted_billing/credit_card.rb
vaulted_billing-0.0.12 lib/vaulted_billing/credit_card.rb
vaulted_billing-0.0.11 lib/vaulted_billing/credit_card.rb
vaulted_billing-0.0.10 lib/vaulted_billing/credit_card.rb
vaulted_billing-0.0.9 lib/vaulted_billing/credit_card.rb
vaulted_billing-0.0.8 lib/vaulted_billing/credit_card.rb
vaulted_billing-0.0.7 lib/vaulted_billing/credit_card.rb
vaulted_billing-0.0.6 lib/vaulted_billing/credit_card.rb
vaulted_billing-0.0.5 lib/vaulted_billing/credit_card.rb
vaulted_billing-0.0.4 lib/vaulted_billing/credit_card.rb
vaulted_billing-0.0.3 lib/vaulted_billing/credit_card.rb
vaulted_billing-0.0.2 lib/vaulted_billing/credit_card.rb