我已经成功地将 stripe.com 支付与我的网站集成。
但是我不确定为什么它不在本地主机中触发事件。
这是我的 Stripe 初始值设定项:
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 将请求转发到本地主机
最佳答案
我的实际问题不是 stripe-event gem,而是 ultrahook 将请求转发到错误的目的地。
我转发到 localhost:5000
,而不是 localhost:5000/stripe
所以我使用了 ultrahook stripe 5000
超钩 Stripe 5000/Stripe
关于ruby-on-rails - Ruby stripe api 不触发事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20275344/