jcberquist/stripe-cfml

stripe.refund.create() - error: Received unknown parameter: currency

Closed this issue · 3 comments

as the title states. the refund.create() endpoint is passing a 'currency' parameter that the API doesn't like.

Thanks! I've fixed this in v3.5.1.

cool.
out of curiosity, is there anything more to the fix than removing the param from lib/resources/Refund.cfc?

In this case, that is all that was needed. Back when I first created this library, I added the ability for it to pass in the desired currency to methods that required it: https://github.com/jcberquist/stripe-cfml?tab=readme-ov-file#configuration - since currency was set in the metadata of refunds.cfc, the method was auto adding it to the request, and as you note, that is invalid for a create refund request.

I am actually generating the resource files automatically from the stripe node library in combination with the stripe openapi spec, and the spec file has the the currency parameter for this method (incorrectly it seems). So I will have to add overrides to my generation code to remove this when I next update the resources. I just wanted to get this fixed quickly now.

I have come to think that auto adding a parameter like this was probably not the best idea (similarly with the automatic conversion to dollars from cents), and I do think when I next do a major version update, I will remove it.