Method: ProcessOut::Webhook#to_json

Defined in:
lib/processout/webhook.rb

#to_json(options) ⇒ Object

Overrides the JSON marshaller to only send the fields we want



138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/processout/webhook.rb', line 138

def to_json(options)
  {
      "id": self.id,
      "project": self.project,
      "project_id": self.project_id,
      "event": self.event,
      "event_id": self.event_id,
      "request_url": self.request_url,
      "request_method": self.request_method,
      "response_body": self.response_body,
      "response_code": self.response_code,
      "response_headers": self.response_headers,
      "response_time_ms": self.response_time_ms,
      "status": self.status,
      "created_at": self.created_at,
      "release_at": self.release_at,
  }.to_json
end