adyen-ruby-api-library
adyen-ruby-api-library copied to clipboard
Support Adyen::Client.new(logger: Logger.new($stdout))
Faraday supports logging of responses but annoyingly this can only be configured at the time of constructing the Faraday.new instance, and Adyen::Client locks this initialization inside call_adyen_api method.
This PR adds new logger: argument and #logger= setter to Adyen::Client.
Example usage:
client = Adyen::Client.new
client.logger = Logger.new($stdout)
or
client = Adyen::Client.new(logger: Logger.new($stdout))
Output in logs might look like:
I, [2025-07-21T06:20:24.131342 #45006] INFO -- : request: POST https://checkout-test.adyen.com/v71/payments
I, [2025-07-21T06:20:24.131376 #45006] INFO -- : request: Content-Type: "application/json"
User-Agent: "adyen-ruby-api-library/10.3.0"
x-api-key: "l123AQEuhmfxL4..."
adyen-library-name: "adyen-ruby-api-library"
adyen-library-version: "10.3.0"
I, [2025-07-21T06:20:24.131403 #45006] INFO -- : request: {"reference":"xyz","paymentMethod":{"type":"scheme","checkoutAttemptId":"0849f4a5","encryptedCardNumber":"eyJhbGciOi...
I, [2025-07-21T06:20:25.564473 #45006] INFO -- : response: Status 200
I, [2025-07-21T06:20:25.564604 #45006] INFO -- : response: traceparent: "00-
...
transfer-encoding: "chunked"
date: "Mon, 21 Jul 2025 06:20:25 GMT"
strict-transport-security: "max-age=31536000; includeSubDomains"
I, [2025-07-21T06:20:25.564697 #45006] INFO -- : response: {"additionalData":{"cardSummary":"0008","isCardCommercial":"unknown","authorisationMid":"50","...