Sha256: 64529cb690a68ddd1c5e0d95d14eac80ff8441e6b764f97403adfdce2813baa7

Contents?: true

Size: 970 Bytes

Versions: 10

Compression:

Stored size: 970 Bytes

Contents

module Braintree
  class PaymentMethodNonceDetails # :nodoc:
    include BaseModule

    attr_reader :bin
    attr_reader :card_type
    attr_reader :expiration_month
    attr_reader :expiration_year
    attr_reader :is_network_tokenized
    attr_reader :last_two
    attr_reader :payer_info

    alias_method :is_network_tokenized?, :is_network_tokenized

    def initialize(attributes)
      set_instance_variables_from_hash attributes unless attributes.nil?
      @payer_info = PaymentMethodNonceDetailsPayerInfo.new(attributes[:payer_info]) if attributes[:payer_info]
    end

    def inspect
      attr_order = [
        :bin,
        :card_type,
        :expiration_month,
        :expiration_year,
        :is_network_tokenized,
        :last_two,
        :payer_info,
      ]

      formatted_attrs = attr_order.map do |attr|
        "#{attr}: #{send(attr).inspect}"
      end
      "#<PaymentMethodNonceDetails #{formatted_attrs.join(", ")}>"
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
braintree-4.9.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.8.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.7.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.6.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.5.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.4.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.3.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.2.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.1.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.0.0 lib/braintree/payment_method_nonce_details.rb