Sha256: 9fc5e4e0edb836ff61b9f6982e7e9fc1cf9d22b2fbcae7bc3b4b25f56de3f266

Contents?: true

Size: 958 Bytes

Versions: 29

Compression:

Stored size: 958 Bytes

Contents

module Braintree
  class ApplePayCard
    include BaseModule # :nodoc:

    module CardType
      AmEx = "Apple Pay - American Express"
      Visa = "Apple Pay - Visa"
      MasterCard = "Apple Pay - MasterCard"

      All = constants.map { |c| const_get(c) }
    end

    attr_reader :card_type, :created_at, :customer_id, :default, :expiration_month,
      :expiration_year, :expired, :image_url, :last_4, :payment_instrument_name,
      :source_description, :subscriptions, :token, :updated_at

    def initialize(gateway, attributes) # :nodoc:
      @gateway = gateway
      set_instance_variables_from_hash(attributes)
      @subscriptions = (@subscriptions || []).map { |subscription_hash| Subscription._new(@gateway, subscription_hash) }
    end

    def default?
      @default
    end

    def expired?
      @expired
    end

    class << self
      protected :new
    end

    def self._new(*args) # :nodoc:
      self.new *args
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
braintree-2.76.0 lib/braintree/apple_pay_card.rb
braintree-2.75.0 lib/braintree/apple_pay_card.rb
braintree-2.74.0 lib/braintree/apple_pay_card.rb
braintree-2.73.0 lib/braintree/apple_pay_card.rb
braintree-2.72.0 lib/braintree/apple_pay_card.rb
braintree-2.71.0 lib/braintree/apple_pay_card.rb
braintree-2.70.0 lib/braintree/apple_pay_card.rb
braintree-2.69.1 lib/braintree/apple_pay_card.rb
braintree-2.69.0 lib/braintree/apple_pay_card.rb
braintree-2.68.2 lib/braintree/apple_pay_card.rb
braintree-2.68.1 lib/braintree/apple_pay_card.rb
braintree-2.68.0 lib/braintree/apple_pay_card.rb
braintree-2.67.0 lib/braintree/apple_pay_card.rb
braintree-2.66.0 lib/braintree/apple_pay_card.rb
braintree-2.65.0 lib/braintree/apple_pay_card.rb
braintree-2.64.0 lib/braintree/apple_pay_card.rb
braintree-2.63.0 lib/braintree/apple_pay_card.rb
braintree-2.62.0 lib/braintree/apple_pay_card.rb
braintree-2.61.1 lib/braintree/apple_pay_card.rb
braintree-2.61.0 lib/braintree/apple_pay_card.rb