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

Stripe.Refund.list requires a charge #848

Open
2 tasks done
sb8244 opened this issue Jul 30, 2024 · 4 comments
Open
2 tasks done

Stripe.Refund.list requires a charge #848

sb8244 opened this issue Jul 30, 2024 · 4 comments

Comments

@sb8244
Copy link
Contributor

sb8244 commented Jul 30, 2024

Existing Issue or Pull Request Verification

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

Package Version

2.17.1

Are you using the latest version?

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

Steps to Reproduce

Invoke Stripe.Refund.list() and get error about function not existing.

Try to invoke it with Stripe.Refund.list(%{}) and get String replacement functions

Expected Result

Stripe's API supports listing all refunds without passing the charge parameter

Actual Result

The generated code requires charge to be passed in, possibly due to documentation bug on Stripe side?

Stripes docs show it's possible to request refunds without the charge ID:
image

@sb8244
Copy link
Contributor Author

sb8244 commented Jul 30, 2024

There is a workaround to define my own list_refunds function like so:

  def list_refunds(params \\ %{}, opts \\ []) do
    path = "/v1/refunds"

    Stripe.Request.new_request(opts)
    |> Stripe.Request.put_endpoint(path)
    |> Stripe.Request.put_params(params)
    |> Stripe.Request.put_method(:get)
    |> Stripe.Request.make_request()
  end

So this is probably a low priority issue

@dmitry-loves-elixir-not

I've also stumbled upon this issue while trying to upgrade from stripity_stripe v"2.17.3" to "3.2.0".
%Stripe.PaymentIntent structure no longer contains the list of charges, so I need to pull them from https://docs.stripe.com/api/refunds/list API, which takes either charge or payment_intent ID as a parameter and stripity-stripe only supports charge ID for this API

@yordis
Copy link
Member

yordis commented Aug 19, 2024

I have a lot of work to do at #843

Primarily, I need to readjust what I am doing and add another indirection that allows manual mapping of endpoints so that I can avoid breaking changes, for now.

Copy link

This issue has been automatically marked as "stale:discard". We are sorry that we haven't been able to prioritize it yet.
If this issue still relevant, please leave any comment if you have any new additional information that helps to solve this issue. We encourage you to create a pull request, if you can. We are happy to help you with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants