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

Unable to retrieve test clocks from Stripe due to invalid struct name #825

Closed
2 tasks done
clandry94 opened this issue Jan 22, 2024 · 4 comments
Closed
2 tasks done

Comments

@clandry94
Copy link
Contributor

Existing Issue or Pull Request Verification

  • Confirmed, no existing Issues or Pull Requests found related to my submission.

Package Version

3.1.1

Are you using the latest version?

  • Yes, I verified the issue is still present in the latest version.

Steps to Reproduce

  1. Update to 3.1.1
  2. Make a call to Stripe.TestHelpers.TestClock.retrieve(...)
  3. The following error will be shown
[error] ** (UndefinedFunctionError) function Stripe.TestClock.__struct__/0 is undefined (module Stripe.TestClock is not available)
    Stripe.TestClock.__struct__()
    (stripity_stripe 3.1.1) lib/stripe/converter.ex:41: Stripe.Converter.convert_stripe_object/1
    (stripity_stripe 3.1.1) lib/stripe/request.ex:204: Stripe.Request.make_request/1

Expected Result

This should be parsed into the Stripe.TestHelpers.TestClock struct instead of Stripe.TestClock

Actual Result

[error] ** (UndefinedFunctionError) function Stripe.TestClock.__struct__/0 is undefined (module Stripe.TestClock is not available)
    Stripe.TestClock.__struct__()
    (stripity_stripe 3.1.1) lib/stripe/converter.ex:41: Stripe.Converter.convert_stripe_object/1
    (stripity_stripe 3.1.1) lib/stripe/request.ex:204: Stripe.Request.make_request/1

I believe this issue is related to #792 which made a change to how object_name_to_module parses test clocks. Line 54 added in that PR does

def object_name_to_module("test_helpers.test_clock"), do: Stripe.TestClock

instead of

def object_name_to_module("test_helpers.test_clock"), do: Stripe.TestHelpers.TestClock
@Cervajz
Copy link

Cervajz commented Jan 24, 2024

We have the same issue

@yordis
Copy link
Member

yordis commented Jan 24, 2024

Are you able to contribute?

@clandry94
Copy link
Contributor Author

@yordis yeah I can put up a PR

@maartenvanvliet
Copy link
Member

Thx for the PR, gonna close this now

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

4 participants