Sha256: f3deb1ae22861802312bd0146b81819f682b45f32e1b00d670598a51c9206b38

Contents?: true

Size: 911 Bytes

Versions: 12

Compression:

Stored size: 911 Bytes

Contents

module Braintree
  class PaymentMethodNonce
    include BaseModule # :nodoc:

    def self.create(payment_method_token)
      Configuration.gateway.payment_method_nonce.create(payment_method_token)
    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, :details

    def initialize(gateway, attributes) # :nodoc:
      @gateway = gateway
      @nonce = attributes.fetch(:nonce)
      @type = attributes.fetch(:type)
      @details = attributes.fetch(:details)
      @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

12 entries across 12 versions & 1 rubygems

Version Path
braintree-2.79.0 lib/braintree/payment_method_nonce.rb
braintree-2.78.0 lib/braintree/payment_method_nonce.rb
braintree-2.77.0 lib/braintree/payment_method_nonce.rb
braintree-2.76.0 lib/braintree/payment_method_nonce.rb
braintree-2.75.0 lib/braintree/payment_method_nonce.rb
braintree-2.74.0 lib/braintree/payment_method_nonce.rb
braintree-2.73.0 lib/braintree/payment_method_nonce.rb
braintree-2.72.0 lib/braintree/payment_method_nonce.rb
braintree-2.71.0 lib/braintree/payment_method_nonce.rb
braintree-2.70.0 lib/braintree/payment_method_nonce.rb
braintree-2.69.1 lib/braintree/payment_method_nonce.rb
braintree-2.69.0 lib/braintree/payment_method_nonce.rb