Sha256: bea1ad1a777becbfcbfff7ae12ab9d484754b5fc57268f54c178b14e203f992b

Contents?: true

Size: 1.15 KB

Versions: 8

Compression:

Stored size: 1.15 KB

Contents

module Braintree
  class PaymentMethodNonceDetails
    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
    attr_reader :sepa_direct_debit_account_nonce_details

    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]
      @sepa_direct_debit_account_nonce_details = ::Braintree::SepaDirectDebitAccountNonceDetails.new(attributes)
    end

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

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
braintree-4.23.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.22.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.21.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.20.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.19.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.18.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.17.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.16.0 lib/braintree/payment_method_nonce_details.rb