Class: VirtualMerchant::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/virtual_merchant/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Response

Returns a new instance of Response.



11
12
13
14
15
16
17
# File 'lib/virtual_merchant/response.rb', line 11

def initialize(data)
  if data[:type] == :invalid_credit_card
    bad_card_error(data[:errors])
  else
    read_xml(data[:xml_string])
  end
end

Instance Attribute Details

#approval_codeObject

Returns the value of attribute approval_code.



4
5
6
# File 'lib/virtual_merchant/response.rb', line 4

def approval_code
  @approval_code
end

#approvedObject Also known as: approved?

Returns the value of attribute approved.



4
5
6
# File 'lib/virtual_merchant/response.rb', line 4

def approved
  @approved
end

#billing_cycleObject

Returns the value of attribute billing_cycle.



4
5
6
# File 'lib/virtual_merchant/response.rb', line 4

def billing_cycle
  @billing_cycle
end

#blurred_card_numberObject

Returns the value of attribute blurred_card_number.



4
5
6
# File 'lib/virtual_merchant/response.rb', line 4

def blurred_card_number
  @blurred_card_number
end

#cvv2_responseObject

Returns the value of attribute cvv2_response.



4
5
6
# File 'lib/virtual_merchant/response.rb', line 4

def cvv2_response
  @cvv2_response
end

#errorObject

Returns the value of attribute error.



4
5
6
# File 'lib/virtual_merchant/response.rb', line 4

def error
  @error
end

#exp_dateObject

Returns the value of attribute exp_date.



4
5
6
# File 'lib/virtual_merchant/response.rb', line 4

def exp_date
  @exp_date
end

#next_payment_dateObject

Returns the value of attribute next_payment_date.



4
5
6
# File 'lib/virtual_merchant/response.rb', line 4

def next_payment_date
  @next_payment_date
end

#recurring_batch_countObject

Returns the value of attribute recurring_batch_count.



4
5
6
# File 'lib/virtual_merchant/response.rb', line 4

def recurring_batch_count
  @recurring_batch_count
end

#recurring_idObject

Returns the value of attribute recurring_id.



4
5
6
# File 'lib/virtual_merchant/response.rb', line 4

def recurring_id
  @recurring_id
end

#resultObject

Returns the value of attribute result.



4
5
6
# File 'lib/virtual_merchant/response.rb', line 4

def result
  @result
end

#result_messageObject

Returns the value of attribute result_message.



4
5
6
# File 'lib/virtual_merchant/response.rb', line 4

def result_message
  @result_message
end

#skip_paymentObject

Returns the value of attribute skip_payment.



4
5
6
# File 'lib/virtual_merchant/response.rb', line 4

def skip_payment
  @skip_payment
end

#start_payment_dateObject

Returns the value of attribute start_payment_date.



4
5
6
# File 'lib/virtual_merchant/response.rb', line 4

def start_payment_date
  @start_payment_date
end

#transaction_idObject

Returns the value of attribute transaction_id.



4
5
6
# File 'lib/virtual_merchant/response.rb', line 4

def transaction_id
  @transaction_id
end

#transaction_timeObject

Returns the value of attribute transaction_time.



4
5
6
# File 'lib/virtual_merchant/response.rb', line 4

def transaction_time
  @transaction_time
end

#transaction_typeObject

Returns the value of attribute transaction_type.



4
5
6
# File 'lib/virtual_merchant/response.rb', line 4

def transaction_type
  @transaction_type
end