Sha256: 62009b1a975a14a66c811c05a63f948752c6d8eaa819b0da1b7f0725defacd1c

Contents?: true

Size: 1.39 KB

Versions: 37

Compression:

Stored size: 1.39 KB

Contents

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

      attr_reader :bin
      attr_reader :cardholder_name
      attr_reader :card_type
      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 :source_card_last_4
      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, :source_card_last_4, :customer_location, :prepaid,
        :healthcare, :durbin_regulated, :debit, :commercial, :payroll, :product_id, :country_of_issuance, :issuing_bank, :image_url]
        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

37 entries across 37 versions & 1 rubygems

Version Path
braintree-4.15.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-4.14.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-4.13.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-4.12.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-4.11.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-4.10.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-4.9.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-4.8.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-4.7.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-4.6.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-4.5.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-4.4.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-4.3.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-4.2.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-4.1.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-4.0.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-3.4.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-3.3.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-3.2.0 lib/braintree/transaction/samsung_pay_card_details.rb
braintree-3.1.0 lib/braintree/transaction/samsung_pay_card_details.rb