【问题标题】:Filter chain halted in stripe_event gem on development过滤器链在开发中的 stripe_event gem 中停止
【发布时间】:2015-12-24 07:15:22
【问题描述】:

我正在开发一个使用 stripe_event gem 的 Rails 应用程序 (4.2.x)。我在开发模式下处理 webhook 时遇到了困难。我正在使用 Ultrahook,实际上我得到了这个事件,但是我得到了一个:

Processing by StripeEvent::WebhookController#event as XML
Parameters: {.... pending_webhooks"=>2, "request"=>"req_73S67hYD35c8K9", "api_version"=>"2015-09-08"}}

Filter chain halted as #<Proc:0x007ffc73990350@/Users/mrl/.rvm/gems/ruby-2.2.2@.../app/controllers/stripe_event/webhook_controller.rb:3> rendered or redirected
Completed 401 Unauthorized in 7ms (ActiveRecord: 0.0ms)

stripe_event webhook_controller 中的第 3 行是:

before_filter do

我的条带初始化器如下:

Rails.configuration.stripe = {
  publishable_key: ENV['STRIPE_PUBLISHABLE_KEY'],
  secret_key:      ENV['STRIPE_SECRET_KEY'],
}
Stripe.api_key = Rails.configuration.stripe[:secret_key]

StripeEvent.authentication_secret = ENV['STRIPE_WEBHOOK_SECRET']

StripeEvent.configure do |events|

  events.all do |event|
    puts "\n\n\nStripe Event please: #{event}\n\n\n"
  end

end

代码在我们的登台服务器上运行:

Processing by StripeEvent::WebhookController#event as XML
I, [2015-09-26T10:20:18.909875 #28955]  INFO -- :   Parameters: {..... "request"=>nil, "api_version"=>"2015-09-08"}}
I, [2015-09-26T10:20:19.395064 #28955]  INFO -- :

Stripe Event please: {
  "id": "...""
  "created": 1443262813,
  "livemode": false,
  "type": "balance.available",
  "data": {"object":{"pending":[{"amount":5460,"currency":"usd"}],"available":[{"amount":29707,"currency":"usd"}],"livemode":false,"object":"balance"}},
  "object": "event",
  "pending_webhooks": 1,
  "request": null,
  "api_version": "2015-09-08"
}

我已经为此苦苦挣扎了几天,我很困惑。有没有人有任何的想法可以解决这个问题?

【问题讨论】:

    标签: ruby-on-rails ruby stripe-payments


    【解决方案1】:

    我猜这与开发模式下错误配置的环境变量有关,但很难说,因为stripe_event 的当前版本掩盖了WebhookController 中的底层异常。

    但是,刚刚添加了一个提交来解决此问题并记录完整的错误以帮助调试此类情况。请参阅Issue 56

    【讨论】:

      猜你喜欢
      • 2014-03-19
      • 1970-01-01
      • 1970-01-01
      • 2016-03-14
      • 1970-01-01
      • 2012-10-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多