いつもお世話になっております。
Stripeの invoice.payment_succeed
のWebhookをアプリケーションで受け取りたいと考えています。
ローカルでテストする際には、 ngrok
を立ち上げて情報を受け取るようにしていて、エラー構文が出ているので受信自体できているのですが、しっかりとしたevent内容が確認できません。
InvoicePaymentSucceed has been removed from the module tree but is still active!
ソースコード
services/events/invoice_payment_succeed.rb
Ruby
1class Events::InvoicePaymentSucceed 2 def call(event) 3 source = event.data.object 4 subscription = source.lines.data[0] 5 6 binding.pry 7 end 8end
config/stripe.rb
Ruby
1StripeEvent.configure do |events| 2 # The case invoice payment succeed 3 events.subscribe( 4 'invoice.payment_succeed', 5 Events::InvoicePaymentSucceed.new 6 ) 7end
config/routes.rb
Ruby
1Rails.application.routes.draw do 2 mount StripeEvent::Engine, at: '/webhooks/stripe' 3end
あなたの回答
tips
プレビュー