Class: VaultedBilling::Transaction
- Inherits:
-
Object
- Object
- VaultedBilling::Transaction
- Defined in:
- lib/vaulted_billing/transaction.rb
Overview
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.
Instance Attribute Summary collapse
-
#authcode ⇒ Object
The authorization code for the transaction.
-
#avs_response ⇒ Object
The address verification service response.
-
#code ⇒ Object
The response code from the processor.
-
#cvv_response ⇒ Object
The card verification number response.
-
#id ⇒ Object
The transaction identifier from the processor.
-
#masked_card_number ⇒ Object
The masked card number used in the transaction, if available.
-
#message ⇒ Object
The message from the processor.
Instance Method Summary collapse
- #==(o) ⇒ Object
- #attributes ⇒ Object
-
#initialize(attributes = {}) ⇒ Transaction
constructor
A new instance of Transaction.
- #to_vaulted_billing ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Transaction
Returns a new instance of Transaction.
30 31 32 33 34 |
# File 'lib/vaulted_billing/transaction.rb', line 30 def initialize(attributes = {}) attributes.each_pair do |key, value| send("#{key}=", value) if respond_to?("#{key}=") end end |
Instance Attribute Details
#authcode ⇒ Object
The authorization code for the transaction
13 14 15 |
# File 'lib/vaulted_billing/transaction.rb', line 13 def authcode @authcode end |
#avs_response ⇒ Object
The address verification service response
16 17 18 |
# File 'lib/vaulted_billing/transaction.rb', line 16 def avs_response @avs_response end |
#code ⇒ Object
The response code from the processor
22 23 24 |
# File 'lib/vaulted_billing/transaction.rb', line 22 def code @code end |
#cvv_response ⇒ Object
The card verification number response
19 20 21 |
# File 'lib/vaulted_billing/transaction.rb', line 19 def cvv_response @cvv_response end |
#id ⇒ Object
The transaction identifier from the processor
10 11 12 |
# File 'lib/vaulted_billing/transaction.rb', line 10 def id @id end |
#masked_card_number ⇒ Object
The masked card number used in the transaction, if available
28 29 30 |
# File 'lib/vaulted_billing/transaction.rb', line 28 def masked_card_number @masked_card_number end |
#message ⇒ Object
The message from the processor
25 26 27 |
# File 'lib/vaulted_billing/transaction.rb', line 25 def @message end |
Instance Method Details
#==(o) ⇒ Object
38 39 40 |
# File 'lib/vaulted_billing/transaction.rb', line 38 def ==(o) attributes == o.attributes end |
#attributes ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/vaulted_billing/transaction.rb', line 42 def attributes { :id => id, :authcode => authcode, :avs_response => avs_response, :cvv_response => cvv_response, :code => code, :message => , :masked_card_number => masked_card_number } end |
#to_vaulted_billing ⇒ Object
36 |
# File 'lib/vaulted_billing/transaction.rb', line 36 def to_vaulted_billing; self; end |