Sha256: 8662fd1a7a26c631eb8b8c133c791fba76ad6b98c41b56ba7f024ead64377f50

Contents?: true

Size: 911 Bytes

Versions: 2

Compression:

Stored size: 911 Bytes

Contents

module Braintree
  # See https://developers.braintreepayments.com/ios+ruby/sdk/server
  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 :token, :card_type, :last_4, :default, :image_url,
      :created_at, :updated_at, :subscriptions, :expiration_month,
      :expiration_year, :expired, :payment_instrument_name


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

    class << self
      protected :new
    end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
braintree-2.40.0 lib/braintree/apple_pay_card.rb
braintree-2.39.0 lib/braintree/apple_pay_card.rb