#forcewill
1 messages ยท Page 1 of 1 (latest)
@granite terrace Hello! Were you able to get this working?
Not yet
nil does nothing and passing a go zero value 0 in this case returns me an error
Invalid timestamp: must be an integer
I found this anwser on SO https://stackoverflow.com/a/70148264
But it seems an hack to me
At least its not documented in https://stripe.com/docs/api/subscriptions/update#update_subscription-cancel_at_period_end
Usually to unset a value in the API you set the value to an empty string, can you give that a try?
It cannot be set to an empty string because CancelAt in the stripe-go api is a pointer to a int64
Oh, right, I always forget you can't do stuff like that in a statically typed language. So yeah, setting cancel_at_period_end to false sounds like the next best thing. Is that not working for you?
Yep, I just tested that, and it worked
I'm only a bit worried to rely on that since its undocumented ๐
I always forget you can't do stuff like that in a statically typed language.
Yeah, and we love statically typed languages, at least I do ๐
I don't think you need to worry about it just because it's undocumented, but if it makes you feel better you can update cancel_at_period_end to true first, then change it to false. The true should override the cancel_at value explicitly (but there's really no need to do this).
Deal, I will leave it with a single call
I see there's also an open issue related to clearing fields https://github.com/stripe/stripe-go/issues/1556