I am attempting to change from a paid subscription to a $0 subscription and immediately issue the pro-rated refund.
I was able to get the pro-rated amount using this Q/A: How do you preview a proration using Stripe.NET?. And when I actually update the subscription with the new plan id, the upcoming invoice shows the pro-rated amount but no actual refund is issued. And that makes sense for paid subscriptions, but I need to refund.
Is there a way to execute the refund as part of the Stripe subscription update request? Or do I need to make a separate request to do the refund?
Here's the code I use to update the subscription:
var items = new List<SubscriptionItemOptions> {
new SubscriptionItemOptions {
Id = subscription.Items.Data[0].Id,
Plan = request.NewPlanId,
Deleted = false
}
};
var options = new SubscriptionUpdateOptions
{
Items = items,
ProrationDate = request.ProrationDate,
ProrationBehavior = "create_prorations" // none, create_prorations
};
var updatedSubscription = await subscriptionService.UpdateAsync(subscription.Id, options);