Permalink
Browse files

Added more logging

  • Loading branch information...
1 parent 909892b commit e7c7ec9e63491d0d7c427cef2f30250d9bdf034e Daniel Tenner committed Mar 26, 2009
Showing with 24 additions and 0 deletions.
  1. +24 −0 lib/peeves_gateway.rb
View
@@ -56,6 +56,8 @@ def debug?
# => security_key
# => next_url
def payment(money, options)
+ log "payment", options
+
add_common TRANSACTIONS[:payment]
add_registration(money, options)
add_customer(options)
@@ -82,6 +84,8 @@ def payment(money, options)
# => security_key
# => next_url
def authenticate(money, options)
+ log "authenticate", options
+
add_common(TRANSACTIONS[:authenticate])
add_registration(money, options)
add_customer(options)
@@ -109,6 +113,8 @@ def authenticate(money, options)
# => security_key
# => next_url
def deferred(money, options)
+ log "deferred", options
+
add_common TRANSACTIONS[:deferred]
add_registration(money, options)
add_customer(options)
@@ -132,6 +138,8 @@ def deferred(money, options)
# => transaction_authorisation_number
# => security_key
def repeat(money, options)
+ log "repeat", options
+
add_common(TRANSACTIONS[:repeat])
add_related(options)
add_registration(money, options)
@@ -157,6 +165,8 @@ def repeat(money, options)
# => post_code_result
# => cv2_result
def authorise(money, options)
+ log "authorise", options
+
add_common TRANSACTIONS[:authorise]
add_related(options)
add_registration(money, options)
@@ -173,6 +183,8 @@ def authorise(money, options)
# => status
# => status_detail
def cancel(options)
+ log "cancel", options
+
add_common TRANSACTIONS[:cancel]
add_post_processing(options)
@@ -189,6 +201,8 @@ def cancel(options)
# => status
# => status_detail
def release(money, options)
+ log "release", options
+
add_common TRANSACTIONS[:release]
add_post_processing(options)
@post["ReleaseAmount"] = "%.2f" % money.amount
@@ -206,6 +220,8 @@ def release(money, options)
# => status
# => status_detail
def void(options)
+ log "void", options
+
add_common(TRANSACTIONS[:void])
add_post_processing(options)
@@ -223,6 +239,8 @@ def void(options)
# => status
# => status_detail
def abort(options)
+ log "abort", options
+
add_common(TRANSACTIONS[:abort])
add_post_processing(options)
@@ -243,6 +261,8 @@ def abort(options)
# => vps_transaction_id
# => transaction_authorisation_number
def refund(money, options)
+ log "refund", options
+
add_common(TRANSACTIONS[:refund])
add_related(options)
add_registration(money, options)
@@ -341,6 +361,10 @@ def add_basket(options)
@post["Basket"] = options[:basket].to_post_data
end
end
+
+ def log(method, options)
+ RAILS_DEFAULT_LOGGER.debug "Called #{method} with options #{options.inspect}"
+ end
def requires!(hash, *params)
params.each do |param|

0 comments on commit e7c7ec9

Please sign in to comment.