Class: Spree::WebhooksController

Inherits:
Api::BaseController
  • Object
show all
Defined in:
app/controllers/spree/webhooks_controller.rb

Instance Method Summary collapse

Instance Method Details

#receiveObject



4
5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/spree/webhooks_controller.rb', line 4

def receive
  webhook = Spree::Webhook.find(params[:id])
  payload = request.request_parameters["webhook"]
  user = current_api_user

  authorize! :receive, webhook

  webhook.receive(payload, user)

  head :ok
end