【发布时间】:2025-11-25 07:05:03
【问题描述】:
我正在使用braintree gem 和braintree 沙箱并尝试设置网络挂钩。我有以下代码:
class PaymentsController < ApplicationController
def webhooks
challenge = request.params["bt_challenge"]
challenge_response = Braintree::WebhookNotification.verify(challenge)
return [200, challenge_response]
end
end
但由于某种原因,当我在 Braintree 的网站上按“创建网络挂钩”时,我被告知:
Destination could not be verified.
我检查了服务器日志,它正在接收请求,但由于某种原因返回 http 500 并显示以下内容:
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:
这表明控制器正在寻找视图但找不到。我不知道该怎么办。 web hooks action中的代码直接取自braintree的网站:https://www.braintreepayments.com/docs/ruby/guide/webhook_notifications
有谁知道如何解决这个问题?
【问题讨论】:
标签: ruby-on-rails ruby ruby-on-rails-4 webhooks braintree