Explicitly require ostruct gem in webhook model #1081
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request
Summary:
Running into
Error: NameError: uninitialized constant Pay::Webhook::OpenStruct
error whenPay::Webhooks::ProcessJob
is running forpaddle_billing
Description:
I'm integrating paddle with pay gem into my application, and have configured multiple webhooks for syncing subscriptions.
However, I'm running into the following error in
Pay::Webhooks::ProcessJob
:To fix the issue, I have explicitly added
require "ostruct"
to thePay::Webhook
model, and added a test case forpaddle_billing
for the same model.Additionally, added the
require "ostruct"
line toPay::Braintree::Subscription
model (the only other place where OpenStruct is used) as well proactively.Testing:
Tested the fixes in this PR on my staging server, the webhook job passes now.
Screenshots (if applicable):
The first (failed) run in above screenshot is with pay-8.0.0, while the second successful run is with the fixes in this PR.
Additional Notes:
My setup is: