Sha256: 4c518724a29eed3fae5fa68778d77afe3bd3e709e6a5bdab5a085cf8b61bef92

Contents?: true

Size: 943 Bytes

Versions: 1

Compression:

Stored size: 943 Bytes

Contents

module Braintree
  class UsBankAccount
    include BaseModule

    attr_reader :routing_number, :last_4, :account_type, :account_description, :account_holder_name, :token, :image_url, :bank_name

    def initialize(gateway, attributes) # :nodoc:
      @gateway = gateway
      set_instance_variables_from_hash(attributes)
    end

    class << self
      protected :new
    end

    def self._new(*args) # :nodoc:
      self.new *args
    end

    def self.find(token)
      Configuration.gateway.us_bank_account.find(token)
    end

    def self.sale(token, transaction_attributes)
      Configuration.gateway.transaction.sale(transaction_attributes.merge(
            :payment_method_token => token,
            :options => { :submit_for_settlement => true }
          )
        )
    end

    def self.sale!(token, transaction_attributes)
      return_object_or_raise(:transaction) { sale(token, transaction_attributes) }
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
braintree-2.68.2 lib/braintree/us_bank_account.rb