Sha256: 73390e837eadf32d5cea639c2757132dab90ae9f52aa31c9724542ae929ee73c

Contents?: true

Size: 1.38 KB

Versions: 5

Compression:

Stored size: 1.38 KB

Contents

# == Schema Information
#
# Endpoint:
#  - /v1/credit_cards
#  - /v1/organizations/:organization_id/credit_card
#
#  id               :integer         not null, primary key
#  title            :string(255)
#  first_name       :string(255)
#  last_name        :string(255)
#  country          :string(255)
#  masked_number    :string(255)
#  month            :integer
#  year             :integer
#  user_id          :integer
#  token            :string(255)
#  created_at       :datetime        not null
#  updated_at       :datetime        not null
#  owner_id         :integer
#  owner_type       :string(255)
#  billing_address  :text
#  billing_city     :string(255)
#  billing_postcode :string(255)
#  billing_country  :string(255)
#  duplicated       :boolean         default(FALSE)
#

module MnoEnterprise
  class CreditCard < BaseResource

    attributes :id, :created_at, :updated_at, :title, :first_name, :last_name, :country, :masked_number, :number,
    :month, :year, :billing_address, :billing_city, :billing_postcode, :billing_country, :verification_value, :organization_id

    #==============================================================
    # Associations
    #==============================================================
    belongs_to :organization, class_name: 'MnoEnterprise::Organization'

    def expiry_date
      year && month && Date.new(year, month).end_of_month
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mno-enterprise-core-3.4.0 app/models/mno_enterprise/credit_card.rb
mno-enterprise-core-3.3.3 app/models/mno_enterprise/credit_card.rb
mno-enterprise-core-3.3.2 app/models/mno_enterprise/credit_card.rb
mno-enterprise-core-3.3.1 app/models/mno_enterprise/credit_card.rb
mno-enterprise-core-3.3.0 app/models/mno_enterprise/credit_card.rb