【问题标题】:Ruby stripe api not firing eventsRuby stripe api没有触发事件
【发布时间】:2013-12-02 18:40:48
【问题描述】:

我已成功将 stripe.com 付款与我的网站集成。

但是我不确定为什么它不会在 localhost 中触发事件。

这是我的条带初始化器:

StripeEvent.setup do
  subscribe 'charge.succeeded' do |event|
    ap 'weeeeeeeeeeeeeee'
  end

  subscribe do |event|
    # Handle all event types - logging, etc.
    ap "!got events"
    ap "#{event.inspect}"
    ap "#{event.type}"
  end
end

当我支付测试费用时,这些都没有触发。我正在使用stripe-event gem

有人遇到类似问题吗?

更新

我正在使用 Ultrahook 将请求转发到 localhost

【问题讨论】:

  • 你是如何针对 localhost 触发事件的?
  • @dwhalen 请看我的更新
  • 你能从 localhost 发布服务器日志 (rails s) 以获取 webhook 请求吗?这将有助于调试。
  • 还有问题吗?
  • nop 现在一切都很好,这不是脱衣舞问题我的坏事

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


【解决方案1】:

我的实际问题不是条纹事件 gem,而是超钩子将请求转发到错误的目的地。

我转发到localhost:5000,而不是localhost:5000/stripe,所以我使用ultrahook stripe 5000代替ultrahook stripe 5000/stripe

【讨论】:

    猜你喜欢
    • 2021-01-03
    • 2018-07-02
    • 2020-01-21
    • 2013-02-12
    • 2019-09-16
    • 1970-01-01
    • 1970-01-01
    • 2017-03-12
    • 1970-01-01
    相关资源
    最近更新 更多