Sha256: ef2516df51d49e1edc28e7895353cfbc95b88ad4daf8d66455e280766af5aa40

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

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 :bin_data
    attr_reader :details
    attr_reader :nonce
    attr_reader :three_d_secure_info
    attr_reader :type

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

3 entries across 3 versions & 1 rubygems

Version Path
braintree-2.83.0 lib/braintree/payment_method_nonce.rb
braintree-2.82.0 lib/braintree/payment_method_nonce.rb
braintree-2.81.0 lib/braintree/payment_method_nonce.rb