Sha256: 7568920e2e1820b4ea0240882b308e2d9a3c84006b9674a7706364fa3bcd1371

Contents?: true

Size: 1.16 KB

Versions: 6

Compression:

Stored size: 1.16 KB

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
    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

6 entries across 6 versions & 1 rubygems

Version Path
braintree-4.15.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.14.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.13.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.12.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.11.0 lib/braintree/payment_method_nonce_details.rb
braintree-4.10.0 lib/braintree/payment_method_nonce_details.rb