beam-community / stripity-stripe

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

`Stripe.Account.retrieve` does not allow for account id #822

Closed d3mcfadden closed 8 months ago

d3mcfadden commented 8 months ago

Package Version

3.1.1

Are you using the latest version?

Steps to Reproduce

Our app makes use of Stripe.Account.retrieve("acct_abc123") to fetch a connect account under our main account. Prior to the 3.x release this call worked and would return the details of a connected account based on the passed id.

It looks like since 3.x the code is being auto-generated based off the OpenAPI spec and this function no longer works. The function signature now accepts a map of params, not a binary account id.

Happy to fix this with some guidance on the code generation. Thanks for taking a look!

Expected Result

What is expected is to be able to get an account by a id.

Stripe.Account.retrieve("acct_abc123")

{:ok,
 %Stripe.Account{
   business_profile: nil,
   business_type: nil,
   capabilities: %{
     acss_debit_payments: "active",
     affirm_payments: "active",
 ...
}}

Actual Result

Stripe.Account.retrieve("account_foo")
** (BadMapError) expected a map, got: "account_foo"
yordis commented 8 months ago

I believe this is related to https://github.com/beam-community/stripity-stripe/pull/786 I can support you if you continue the work here!

d3mcfadden commented 8 months ago

Thanks for the response @yordis. This definitely looks related. Sorry for the dip, I checked the open issue list and didn't see anything.

yordis commented 8 months ago

Good catch! Let me update the template!

yordis commented 8 months ago

Gonna close it in favor of #786 Reopen it if you feel I made a mistake! I encourage you to take the PR to the finish line. Let me know if I can help you with it!