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

Fix type spec for creating Checkout Session #752

Merged
merged 3 commits into from
Sep 28, 2022

Conversation

alexpls
Copy link
Contributor

@alexpls alexpls commented Sep 22, 2022

Fixes #749.

The create_params type spec used on Session.create/2 incorrectly defines line_items as a list of:

%{
  optional(:object) => String.t(),
  optional(:data) => %{
     optional(:id) => Stripe.id(),
     optional(:object) => String.t(),
     optional(:quantity) => integer(),
     # ...
  },
  optional(:has_more) => boolean
}

Instead of:

%{
  optional(:id) => Stripe.id(),
  optional(:object) => String.t(),
  optional(:quantity) => integer(),
  # ...
}

Stripe docs for reference.

This PR fixes that! It also adjusts some indentation for consistency with the rest of the file.

@aj-foster
Copy link
Contributor

Hi @alexpls, there's a fix for the CI workflow currently on the master branch; would you mind rebasing your work over it?

@alexpls
Copy link
Contributor Author

alexpls commented Sep 27, 2022

Hey @aj-foster - done ✅

@snewcomer snewcomer merged commit 0bd7615 into beam-community:master Sep 28, 2022
@zetaron
Copy link

zetaron commented Sep 28, 2022

@snewcomer Could you also maybe create a patch release on hex.pm for this to go out? That would be awesome :)

@alexpls alexpls deleted the fix/749_type_params branch September 28, 2022 23:02
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

Successfully merging this pull request may close these issues.

Wrong type spec create_params in Stripe.Session
4 participants