Sha256: 8e4b64ddfae92b908e06a1858fc6543e1a63cbb414d664d439f3f2e90a068be7

Contents?: true

Size: 1.37 KB

Versions: 15

Compression:

Stored size: 1.37 KB

Contents

module VaultedBilling
  ##
  # This class encapsulates the data returned by the gateway / payment
  # processor for transaction requests.  An instance of this class will
  # be returned from all transaction requests (authorize, capture, 
  # refund, void, etc.) performed against a gateway.
  #
  class Transaction
    # The transaction identifier from the processor
    attr_accessor :id

    # The authorization code for the transaction
    attr_accessor :authcode

    # The address verification service response
    attr_accessor :avs_response

    # The card verification number response
    attr_accessor :cvv_response

    # The response code from the processor
    attr_accessor :code

    # The message from the processor
    attr_accessor :message

    # The masked card number used in the transaction, if available
    attr_accessor :masked_card_number

    def initialize(attributes = {})
      attributes.each_pair do |key, value|
        send("#{key}=", value) if respond_to?("#{key}=")
      end
    end

    def to_vaulted_billing; self; end

    def ==(o)
      attributes == o.attributes
    end

    def attributes
      {
        :id => id,
        :authcode => authcode,
        :avs_response => avs_response,
        :cvv_response => cvv_response,
        :code => code,
        :message => message,
        :masked_card_number => masked_card_number
      }
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
vaulted_billing-1.4.0 lib/vaulted_billing/transaction.rb
vaulted_billing-1.3.1 lib/vaulted_billing/transaction.rb
vaulted_billing-1.3.0 lib/vaulted_billing/transaction.rb
vaulted_billing-1.2.1 lib/vaulted_billing/transaction.rb
vaulted_billing-1.2.0 lib/vaulted_billing/transaction.rb
vaulted_billing-1.1.6 lib/vaulted_billing/transaction.rb
vaulted_billing-1.1.5 lib/vaulted_billing/transaction.rb
vaulted_billing-1.1.4 lib/vaulted_billing/transaction.rb
vaulted_billing-1.1.3 lib/vaulted_billing/transaction.rb
vaulted_billing-1.1.2 lib/vaulted_billing/transaction.rb
vaulted_billing-1.1.0 lib/vaulted_billing/transaction.rb
vaulted_billing-1.0.2 lib/vaulted_billing/transaction.rb
vaulted_billing-1.0.1 lib/vaulted_billing/transaction.rb
vaulted_billing-1.0.0 lib/vaulted_billing/transaction.rb
vaulted_billing-0.0.15 lib/vaulted_billing/transaction.rb