Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stripe.Converter.convert_result not returning struct #793

Closed
sb8244 opened this issue Apr 9, 2023 · 0 comments
Closed

Stripe.Converter.convert_result not returning struct #793

sb8244 opened this issue Apr 9, 2023 · 0 comments

Comments

@sb8244
Copy link
Contributor

sb8244 commented Apr 9, 2023

I ran into an issue in my test suite where Stripe.WebhookHandler handle_event receives an object that isn't a struct. I tracked this down in the code to the check known_struct?/1

I believe the issue here is that in some envs (not sure how prod vs dev vs test works here), the build modules aren't preloaded. So if you check function_exported? before the module is loaded, it will always return false.

https://github.com/sb8244/stripity-stripe/blame/main/lib/stripe/converter.ex#L118

I may be wrong here, so I didn't PR a fix yet. My fix for now will be to manually ensure the necessary stripe files are loaded using Code.ensure_loaded!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants