beam-community / stripity-stripe

An Elixir Library for Stripe
Other
965 stars 344 forks source link

function :"Elixir.Stripe.Tax.settings".__struct__/0 is undefined (module :"Elixir.Stripe.Tax.settings" is not available) #841

Closed jmSfernandes closed 2 months ago

jmSfernandes commented 2 months ago

Existing Issue or Pull Request Verification

Package Version

3.1.0

Are you using the latest version?

Steps to Reproduce

Just register to the tax.settings.updated event on Stripe and change your tax settings on the dashboard to trigger the webhook.

Expected Result

Stripe Webhook request body is handle with success and the callback function is called.

Actual Result

Application fails with the error: function :"Elixir.Stripe.Tax.settings".struct/0 is undefined (module :"Elixir.Stripe.Tax.settings" is not available)

Stacktrace:

UndefinedFunctionError: function :"Elixir.Stripe.Tax.settings".__struct__/0 is undefined (module :"Elixir.Stripe.Tax.settings" is not available)
  Module "Elixir.Stripe.Tax.settings", in :"Elixir.Stripe.Tax.settings".__struct__/0
  File "lib/stripe/converter.ex", line 41, in Stripe.Converter.convert_stripe_object/1
  File "lib/stripe/converter.ex", line 34, in anonymous fn/2 in Stripe.Converter.convert_map/1
  File "maps.erl", line 411, in :maps.fold_1/3
  File "lib/stripe/converter.ex", line 52, in anonymous fn/3 in Stripe.Converter.convert_stripe_object/1
  File "lib/enum.ex", line 2468, in Enum."-reduce/3-lists^foldl/2-0-"/3
  File "lib/stripe/converter.ex", line 46, in Stripe.Converter.convert_stripe_object/1
  File "lib/stripe/webhook.ex", line 45, in Stripe.Webhook.construct_event/4
yordis commented 2 months ago

Could you share a unit test case reproducing the situation?

jmSfernandes commented 2 months ago

Yes of course, here it is... Stipe.ConverterTest.exs.txt

Just remove the txt extension (github doesn't allow the upload of .exs files)

yordis commented 2 months ago

@jmSfernandes, are you capable of contributing a fix for this one?

yordis commented 2 months ago

I couldn't replicate your issue, as I have shown by adding the unit test