franckverrot / terraform-provider-stripe

A Terraform Provider for Stripe
https://registry.terraform.io/providers/franckverrot/stripe/latest
Mozilla Public License 2.0
242 stars 51 forks source link

Adapt connect account handling in webhooks #27

Closed mdreem closed 4 years ago

mdreem commented 4 years ago

According to https://stripe.com/docs/api/webhook_endpoints/ cannot be set or read directly, even though the stripe-go library seems to suggest otherwise. Trying to update it leads to the following error: Error: {"code":"parameter_unknown","status":400,"message":"Received unknown parameter: connect","param":"connect","request_id":"...","type":"invalid_request_error"} Therefore I added the ForceNew

As the connect field is not in the response it has been always set to false. It seems reasonable to deduce the current status from the field application.

franckverrot commented 4 years ago

I actually now wonder what it was meant to represent in the first place 🤔

Should we just remove it?

franckverrot commented 4 years ago

Thanks for sending this PR btw, now I'm just questioning the rationale behind tracking it entirely :-)

franckverrot commented 4 years ago

@clintonb-stripe If you see this and happen to have a minute, do you mind chiming in? Would be greatly appreciated 🙏

mdreem commented 4 years ago

It looks like the field existed too in the java-library a while ago. It may have been some API change that hasn't been propagated to all the clients. Getting clarification may be good though :)

Because "connect" as an input field is necessary (they behave differently) it should be tracked in my opinion. Without it being in the response I just do not see a direct way to fetch the value, this is why I mapped the application field. This is actually set in one case and not in the other.

franckverrot commented 4 years ago

Cool, thanks, I'll merge but only release asap! thanks folks!