mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-09 01:14:23 -05:00
Webhooks
This commit is contained in:
@@ -64,12 +64,15 @@ class QboController < ApplicationController
|
|||||||
# Quickbooks Webhook Callback
|
# Quickbooks Webhook Callback
|
||||||
def qbo_webhook
|
def qbo_webhook
|
||||||
|
|
||||||
# If the body contains the event notifications parameter...
|
if request.headers['Content-Type'] == 'application/json'
|
||||||
if params[:eventNotifications].present?
|
data = JSON.parse(request.body.read)
|
||||||
# Process the entities
|
else
|
||||||
#TODO stuff
|
# application/x-www-form-urlencoded
|
||||||
|
data = params.as_json
|
||||||
end
|
end
|
||||||
|
|
||||||
|
entities = data[0]['eventNotifications'][0]['dataChangeEvent']['entities']
|
||||||
|
|
||||||
# The webhook doesn't require a response but let's make sure
|
# The webhook doesn't require a response but let's make sure
|
||||||
# we don't send anything
|
# we don't send anything
|
||||||
render :nothing => true
|
render :nothing => true
|
||||||
|
|||||||
Reference in New Issue
Block a user