Module: PayTrace::Debug
- Defined in:
- lib/paytrace/debug.rb
Class Method Summary collapse
- .configure_test(un = "demo123", pw = "demo123", domain = "stage.paytrace.com") ⇒ Object
-
.dump_transaction ⇒ Object
Helper that loops through the response values and dumps them out.
- .log(msg) ⇒ Object
- .trace(&block) ⇒ Object
Class Method Details
.configure_test(un = "demo123", pw = "demo123", domain = "stage.paytrace.com") ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/paytrace/debug.rb', line 40 def self.configure_test(un = "demo123", pw = "demo123", domain = "stage.paytrace.com") PayTrace.configure do |config| config.user_name = un config.password = pw config.domain = domain end end |
.dump_transaction ⇒ Object
Helper that loops through the response values and dumps them out
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/paytrace/debug.rb', line 8 def self.dump_transaction puts "[REQUEST] #{PayTrace::API::Gateway.last_request}" response = PayTrace::API::Gateway.last_response_object if(response.has_errors?) response.errors.each do |key, value| puts "[RESPONSE] ERROR: #{key.ljust(20)}#{value}" end else response.values.each do |key, value| puts "[RESPONSE] #{key.ljust(20)}#{value}" end end end |
.log(msg) ⇒ Object
22 23 24 |
# File 'lib/paytrace/debug.rb', line 22 def self.log(msg) puts ">>>>>> #{msg}" end |