#forcewill

1 messages ยท Page 1 of 1 (latest)

frail streamBOT
stuck cradle
#

Yep that is what you should do

#

Recommend testing it out in test mode

frail streamBOT
lunar wigeon
#

@granite terrace Hello! Were you able to get this working?

granite terrace
#

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

#

But it seems an hack to me

lunar wigeon
#

Usually to unset a value in the API you set the value to an empty string, can you give that a try?

granite terrace
#

It cannot be set to an empty string because CancelAt in the stripe-go api is a pointer to a int64

lunar wigeon
#

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?

granite terrace
#

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 ๐Ÿ˜„

lunar wigeon
#

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).

granite terrace
#

Deal, I will leave it with a single call