Sha256: 9c7f49b3c77cc356e8c3d2caa270c0819f914423331c955e017a801cc0feaa00

Contents?: true

Size: 1.19 KB

Versions: 9

Compression:

Stored size: 1.19 KB

Contents

module Braintree
  class PaymentMethodNonce
    include BaseModule # :nodoc:

    def self.create(*args)
      Configuration.gateway.payment_method_nonce.create(*args)
    end

    def self.create!(*args)
      Configuration.gateway.payment_method_nonce.create!(*args)
    end

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

    attr_reader :bin_data
    attr_reader :details
    attr_reader :nonce
    attr_reader :three_d_secure_info
    attr_reader :type
    attr_reader :authentication_insight

    def initialize(gateway, attributes) # :nodoc:
      @gateway = gateway
      @nonce = attributes.fetch(:nonce)
      @type = attributes.fetch(:type)
      @details = attributes.fetch(:details)
      @authentication_insight = attributes.fetch(:authentication_insight, nil)
      @three_d_secure_info = ThreeDSecureInfo.new(attributes[:three_d_secure_info]) if attributes[:three_d_secure_info]
      @bin_data = BinData.new(attributes[:bin_data]) if attributes[:bin_data]
    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

9 entries across 9 versions & 1 rubygems

Version Path
braintree-3.4.0 lib/braintree/payment_method_nonce.rb
braintree-3.3.0 lib/braintree/payment_method_nonce.rb
braintree-3.2.0 lib/braintree/payment_method_nonce.rb
braintree-3.1.0 lib/braintree/payment_method_nonce.rb
braintree-3.0.1 lib/braintree/payment_method_nonce.rb
braintree-2.104.1 lib/braintree/payment_method_nonce.rb
braintree-2.104.0 lib/braintree/payment_method_nonce.rb
braintree-2.103.0 lib/braintree/payment_method_nonce.rb
braintree-2.102.0 lib/braintree/payment_method_nonce.rb