Search code examples
ruby-on-rails-3paymill

How to capture the response object from a webhook call


I am creating a Rails 3.2 app and I am using Paymill as the payment gateway. I am trying to setup a webhook on my system (Already setup on Paymill side). This webhook should respond to callbacks when a transaction was successful.

How can I "capture" the response object in my code? Using params?

Thankful for all help!


Solution

  • A webhook call from Paymill includes a JSON in the request. This JSON includes some meta data about the event that was triggered and the objects affected. So, you'd have to take the request body and parse the JSON to extract the information you are looking for. You can see a sample JSON file here:

    https://www.paymill.com/de-de/dokumentation/referenz/api-referenz/#events