ngrok错误:无法从Stripe发送测试webhook

时间:2019-10-01 07:55:43

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

我正在尝试使用invoice.pyament_succeed将条纹Webhook测试ngrok发送到本地服务器。尽管ngrok可以工作,但是当从条带发送webhook时,会发生错误:

POST /webhooks/stripe 500 Internal Server Error                                                                                

我已经设置了ngrokstripe webhook,如下所示:
1.在本地服务器

上设置ngrok
 $ ngrok http 3000

那行得通。

 Session Status                online                                                                                                                                                                        
 Account                       xxxxx (Plan: Free)                                                                                                                                                       
 Update                        update available (version 2.3.34, Ctrl-U to update)                                                                                                                           
 Version                       2.2.8                                                                                                                                                                         
 Region                        United States (us)                                                                                                                                                            
 Web Interface                 http://127.0.0.1:4040                                                                                                                                                         
 Forwarding                    http://xxxx.ngrok.io -> localhost:3000                                                                                                                                    
 Forwarding                    https://xxxx.ngrok.io -> localhost:3000 
  1. 设置条纹webhook

输入终点

 https://xxxxx.ngrok.io/webhooks/stripe

config / routes.rb

 Rails.application.routes.draw do  
   mount StripeEvent::Engine, at: '/webhooks/stripe'
 end

config / stripe.rb

 StripeEvent.configure do |events|
   # The case invoice payment succeed
   events.subscribe(
     'invoice.payment_succeed',
     Events::InvoicePaymentSucceed.new
   )
 end

0 个答案:

没有答案