Sha256: 6dc6fa4f9a8fa5df48d3ee3988fe264e54f1481ce0d2f5248084babd30e4a60f

Contents?: true

Size: 1.39 KB

Versions: 46

Compression:

Stored size: 1.39 KB

Contents

module Braintree
  class Transaction
    class VisaCheckoutCardDetails # :nodoc:
      include BaseModule

      attr_reader :bin
      attr_reader :call_id
      attr_reader :card_type
      attr_reader :cardholder_name
      attr_reader :commercial
      attr_reader :country_of_issuance
      attr_reader :customer_location
      attr_reader :debit
      attr_reader :durbin_regulated
      attr_reader :expiration_month
      attr_reader :expiration_year
      attr_reader :healthcare
      attr_reader :image_url
      attr_reader :issuing_bank
      attr_reader :last_4
      attr_reader :payroll
      attr_reader :prepaid
      attr_reader :product_id
      attr_reader :token

      def initialize(attributes)
        set_instance_variables_from_hash attributes unless attributes.nil?
      end

      def expiration_date
        "#{expiration_month}/#{expiration_year}"
      end

      def inspect
        attr_order = [:token, :bin, :last_4, :card_type, :expiration_date, :cardholder_name, :customer_location, :prepaid,
        :healthcare, :durbin_regulated, :debit, :commercial, :payroll, :product_id, :country_of_issuance, :issuing_bank, :image_url, :call_id]
        formatted_attrs = attr_order.map do |attr|
          "#{attr}: #{send(attr).inspect}"
        end
        "#<#{formatted_attrs.join(", ")}>"
      end

      def masked_number
        "#{bin}******#{last_4}"
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
braintree-3.0.1 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.104.1 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.104.0 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.103.0 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.102.0 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.101.0 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.100.0 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.99.0 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.98.0 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.97.0 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.96.0 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.95.0 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.94.0 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.93.0 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.92.0 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.91.0 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.90.0 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.89.0 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.88.0 lib/braintree/transaction/visa_checkout_card_details.rb
braintree-2.87.0 lib/braintree/transaction/visa_checkout_card_details.rb