#neha-mahajan_unexpected
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1346464957973270590
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, let me help you with this.
below is the params of creating subsciption for customer with existing card
var backDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1, 7, 0, 0);
// Automatically save the payment method to the subscription
// when the first payment is successful.
var paymentSettings = new SubscriptionPaymentSettingsOptions
{
SaveDefaultPaymentMethod = "on_subscription",
};
// Create the subscription. Note we're expanding the Subscription's
// latest invoice and that invoice's payment_intent
// so we can pass it to the front end to confirm the payment
var subscriptionOptions = new SubscriptionCreateOptions
{
Customer = stripeCutomerId,
Items = new List<SubscriptionItemOptions>
{
new SubscriptionItemOptions
{
Price = priceId,
},
},
BackdateStartDate = backDate,
BillingCycleAnchor = backDate.AddMonths(1),
PaymentSettings = paymentSettings
};
if (!string.IsNullOrWhiteSpace(paymentMethod))
{
subscriptionOptions.DefaultPaymentMethod = paymentMethod;
}
else
{
subscriptionOptions.PaymentBehavior = "default_incomplete";
}
You need to provide proration_behavior=none: https://docs.stripe.com/api/subscriptions/create#create_subscription-proration_behavior
This is due to the fact that backdate_start_date parameter still only counts the current period from the time the Subscription was created, so it's not exactly 100% of the month.
when i provided none, it was not creating invoice and not taking payment at all
req_ylvmzIvxRNsB3u
requestid
in this request id i passed proration_behavior=none along with above parameters
Hey! Taking over for my colleague. Let me catch up.
that's expected
the first invoice will be created
on the billing cycle
Which is 2025-04-01 11:00:00UTC in your case
the first invoice will be generated then..
what i want is that whenever user subscribes irrespective of date, the full amount should be deducted before subsciption becomes active and subscription should be valid till end of month and renewal date should be 1st of next month
Unfortunately, that's not supported natively...
what i can do to achieve this? its requirement from our client. billing cycle should be monthly. renewal date should be 1st of every month and if user subscribe any date, charge them full amount