I am using the braintree gem with braintree sandbox and trying to set up web hooks. I have the following code:
class PaymentsController < ApplicationController
def webhooks
challenge = request.params["bt_challenge"]
challenge_response = Braintree::WebhookNotification.verify(challenge)
return [200, challenge_response]
end
end
but for some reason when i press 'create web hook' on braintree's website, i am told:
Destination could not be verified.
I checked the server logs and it is receiving the request, but it is for some reason returning an http 500 and says the following:
2014-04-09T23:39:19.937280+00:00 app[web.1]: Completed 500 Internal Server Error in 71ms
2014-04-09T23:39:19.941486+00:00 app[web.1]: ActionView::MissingTemplate (Missing template payments/webhooks, application/webhooks with {:locale=>[:en], :formats=>[:xml, :html, :text, :js, :css, :ics, :csv, :png, :jpeg, :gif, :bmp, :tiff, :mpeg, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json, :pdf, :zip], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :arb, :jbuilder, :haml]}. Searched in:
This suggests that the controller is looking for a view and can't find it. Im not sure what to do. The code in the web hooks action is taken directly from braintree's website: https://www.braintreepayments.com/docs/ruby/guide/webhook_notifications
Does anyone know how to fix this?