beam-community / stripity-stripe

An Elixir Library for Stripe
Other
966 stars 346 forks source link

Fix type spec for creating Checkout Session #752

Closed alexpls closed 1 year ago

alexpls commented 1 year ago

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 commented 1 year ago

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

alexpls commented 1 year ago

Hey @aj-foster - done ✅

zetaron commented 1 year ago

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