ActiveMerchant: dumping traffic between Your app and payment gateway

Just a quick note – if You need to dump all traffic between payment gateway and Your application using ActiveMerchant just add to Your development.rb:

ActiveMerchant::Billing::QuantumGateway.wiredump_device = File.open("/tmp/q.log", "a+")
ActiveMerchant::Billing::QuantumGateway.wiredump_device.sync = true

Just remember – it will work ONLY You have one application instance, since it uses simple file handle to write all traffic. And replace QunatumGateway with gateway used by You.

Join the Conversation

2 Comments

  1. You can also use the following to stream data direct to the console:
    ActiveMerchant::Billing::QuantumGateway.wiredump_device = $stdout

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.