Skip to content

Stripe webhooks – uninitialized constant FulfillCheckout error on Pay::Webhooks.delegator.subscribe #944

Answered by rameerez
rameerez asked this question in Q&A
Discussion options

You must be logged in to vote

I found out what I was doing wrong: the Pay::Webhooks.delegator.subscribe lines need to go inside an ActiveSupport.on_load(:pay) block, like this:

# config/initializers/pay.rb

ActiveSupport.on_load(:pay) do
  Pay::Webhooks.delegator.subscribe "stripe.checkout.session.completed", FulfillCheckout.new
end

Doing this, there's no need to manually require any files.

Turns out this was not mentioned in the pay docs for Stripe Checkout (docs/stripe/8_stripe_checkout.md) – but it was mentioned in the regular webhooks docs (docs/7_webhooks.md)

Looks like this change was introduced in version 6.4.0 and the Stripe docs were not updated. I'm submitting a PR to fix the Stripe Checkout docs.

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@rameerez
Comment options

Comment options

You must be logged in to vote
2 replies
@deanpcmad
Comment options

@deanpcmad
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by rameerez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants