#cdubs-dotnet-unsetting

1 messages · Page 1 of 1 (latest)

silver zodiacBOT
minor pasture
#

Do you get errors when trying that? Setting them to null is how I thought that us supposed to work

sacred turret
#

it doesn't look like I'm getting any errors, no

#
var options = new SubscriptionUpdateOptions
{
    CancelAt = null,
    CancellationDetails = null
};
var service = new SubscriptionService();
service.Update(subId, options);
minor pasture
#

Does the subscription return unchanged?

sacred turret
#

yeah, with the same CancelAt date and cancellation details

minor pasture
sacred turret
#

req_hnmgrnSUyYGg7e

#

I believe thats it.

minor pasture
#

Can you try setting it to an empty string? ""

sacred turret
#

yeah, let me try

#

In C# I'm seeing

Cannot implicitly convert type 'string' to 'System.DateTime?' [Service]csharp(CS0029)

#

Another weird thing is that I do get a notification that the subscription was updated through my webhooks but it doesn't change anything

minor pasture
#

Thanks for the request ID. Checking in to this

sacred turret
#

In stripes UI dashboard I can tell it to not cancel subscription as well, but want to be able to do it from an API

minor pasture
#

Would you mind clicking that on a test subscription and then sending me the ID of the subscription? Apologies, jumping between a couple threads so I haven't gotten a change to repro this yet

sacred turret
#

you're good

#

yeah I can do that

#

I figured it out

#

For some reason I also had to include

CancelAtPeriodEnd = false

#

Not sure why but that seems to do it

minor pasture
#

Interesting, I am surprised that that is the way to unset this. Good catch on finding that yourself. Is that what the dashboard was sending to undo the cancel?

#

I'll flag that we should call that out in our docs because that is not obvious at all

sacred turret
#

No, I was really just trying it as a last resort haha

minor pasture
#

Gotcha, I'll see how the dashboard does it to see if it does it another, more direct way and will make sure we document this better somewhere.

sacred turret
#

for sure. Appreciate your help! Have a great holiday

minor pasture
#

You too!