lib/helpers/controller_helpers.rb in wepay-rails-0.1.26 vs lib/helpers/controller_helpers.rb in wepay-rails-0.1.27

- old
+ new

@@ -77,19 +77,25 @@ # &code=[the code you got in step one] # # Response # {"user_id":"123456","access_token":"1337h4x0rzabcd12345","token_type":"BEARER"} Example def initialize_wepay_access_token(auth_code) - puts "WepayRails::Helpers::ControllerHelpers#initialize_wepay_access_token - receiving #{auth_code}" + logger.debug "WepayRails::Helpers::ControllerHelpers#initialize_wepay_access_token - receiving #{auth_code}" + File.open('/tmp/fugaze.log','a') {|f| f.write("WepayRails::Helpers::ControllerHelpers#initialize_wepay_access_token - receiving #{auth_code}")} response = gateway.get("/v2/oauth2/token", config_params("http://www.example.com").merge(:code => auth_code)) - puts "WepayRails::Helpers::ControllerHelpers#initialize_wepay_access_token - after call to wepay - response #{response.inspect}" + logger.debug "WepayRails::Helpers::ControllerHelpers#initialize_wepay_access_token - after call to wepay - response #{response.inspect}" + File.open('/tmp/fugaze.log','a') {|f| f.write("WepayRails::Helpers::ControllerHelpers#initialize_wepay_access_token - after call to wepay - response #{response.inspect}")} raise unless response.present? - puts "WepayRails::Helpers::ControllerHelpers#initialize_wepay_access_token - after call to wepay - response is present" - puts response.inspect + logger.debug "WepayRails::Helpers::ControllerHelpers#initialize_wepay_access_token - after call to wepay - response is present" + File.open('/tmp/fugaze.log','a') {|f| f.write("WepayRails::Helpers::ControllerHelpers#initialize_wepay_access_token - after call to wepay - response is present")} + logger.debug response.inspect + File.open('/tmp/fugaze.log','a') {|f| f.write(response.inspect)} json = JSON.parse(response.body) - puts "WepayRails::Helpers::ControllerHelpers#initialize_wepay_access_token - after call to wepay - json is #{json.inspect}" + logger.debug "WepayRails::Helpers::ControllerHelpers#initialize_wepay_access_token - after call to wepay - json is #{json.inspect}" + File.open('/tmp/fugaze.log','a') {|f| f.write("WepayRails::Helpers::ControllerHelpers#initialize_wepay_access_token - after call to wepay - json is #{json.inspect}")} wepay_access_token = json["access_token"] - puts "WepayRails::Helpers::ControllerHelpers#initialize_wepay_access_token - after call to wepay - wepay_access_token is #{wepay_access_token.inspect}" + logger.debug "WepayRails::Helpers::ControllerHelpers#initialize_wepay_access_token - after call to wepay - wepay_access_token is #{wepay_access_token.inspect}" + File.open('/tmp/fugaze.log','a') {|f| f.write("WepayRails::Helpers::ControllerHelpers#initialize_wepay_access_token - after call to wepay - wepay_access_token is #{wepay_access_token.inspect}")} raise unless wepay_access_token.present? end # Since we are saving the access token in the session, # ensure key uniqueness. Might be a good idea to have this \ No newline at end of file