Sha256: 553743b71e9cc329603c52a642d0e732241862146526981d0f5a8857d3a7e276

Contents?: true

Size: 845 Bytes

Versions: 8

Compression:

Stored size: 845 Bytes

Contents

module Braintree
  class PaymentMethodNonce
    include BaseModule # :nodoc:

    def self.create(payment_method)
      Configuration.gateway.payment_method_nonce.create(payment_method)
    end

    def self.find(payment_method_nonce)
      Configuration.gateway.payment_method_nonce.find(payment_method_nonce)
    end

    attr_reader :nonce, :three_d_secure_info, :type

    def initialize(gateway, attributes) # :nodoc:
      @gateway = gateway
      @nonce = attributes.fetch(:nonce)
      @type = attributes.fetch(:type)
      @three_d_secure_info = ThreeDSecureInfo.new(attributes[:three_d_secure_info]) if attributes[:three_d_secure_info]
    end

    def to_s # :nodoc:
      nonce
    end

    class << self
      protected :new
    end

    def self._new(gateway, attributes) # :nodoc:
      new(gateway, attributes)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
braintree-2.49.0 lib/braintree/payment_method_nonce.rb
braintree-2.48.1 lib/braintree/payment_method_nonce.rb
braintree-2.48.0 lib/braintree/payment_method_nonce.rb
braintree-2.47.0 lib/braintree/payment_method_nonce.rb
braintree-2.46.0 lib/braintree/payment_method_nonce.rb
braintree-2.45.0 lib/braintree/payment_method_nonce.rb
braintree-2.44.0 lib/braintree/payment_method_nonce.rb
braintree-2.43.0 lib/braintree/payment_method_nonce.rb