#tonidigital_code
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/1306889409123323914
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- tonidigital_webhooks, 6 days ago, 9 messages
- tonidigital_webhooks, 6 days ago, 8 messages
Not fully code example added, so sending again:
var options = new SubscriptionCreateOptions()
{
TrialPeriodDays = trialPeriodDays,
PaymentBehavior = "error_if_incomplete", //"default_incomplete", // subscription status will stay incomplete if payment fails
PaymentSettings = new SubscriptionPaymentSettingsOptions { SaveDefaultPaymentMethod = "on_subscription" },
Currency =xxx,
Customer = customer.Id,
DefaultPaymentMethod = xxx,
Items = new List<SubscriptionItemOptions> { new SubscriptionItemOptions { Price = pricing.Id, Quantity = 1 }},
CollectionMethod = "charge_automatically",
Metadata = xxx,
BillingCycleAnchor = DateTime.UtcNow.AddDays(22) //make it configurable
};
hello! Why are you using BillingCycleAnchor to try charging 7 days before the end of the current billing cycle? The billing cycle anchor is meant to change the billing cycle e.g. now you're charging on the 2 day of the month, but want to switch to charging it on the 7 day of the month
Because for our business flow we need to have enough time for corrections in case payment failed. That's why billing_cycle is moved 7 days before "regular/defaul" monthly charging. Example, payment cannot be processed because there isn't enought funds on card, we need to have enought time to notify customer so customer can change card and try another payment attempt. Is that possible or we should use only this default billing configuration?
this isn't what you would use the billing_cycle_anchor for. There are a couple of options here for what you want to achieve, gimme a while to list them out
- You can create a separate invoice for the customer prior to the subscription renewal. Once the invoice has been paid, you add the paid funds to the customer's credit balance. The balance will automatically be applied to the next invoice. I'd like to specifically point out that you can't control which invoice the balance is applied to. So if there's another invoice generated for the customer (prior to the invoice renewal), the funds will be applied to it.
- if you don't want to use the customer balance, there are other options here such as applying a 100% one-time discount to the generated subscription invoice. However, using a discount has implications on proration i.e. we won't prorate a 100% discounted amount
- alternatively, you use one-time invoices, and manage the subscription lifecycle yourself i.e. you have to build out your own logic as to when to charge the customer, whether their subscription is still active, etc
Thanks for answer but seems it will introduce a lot of additional effort but not too much benefits, correct?
I was wondering why Stripe accelerate team confirmed us that we can use this option "billing_cycle_anchor" for our purpose, after we present them our business requirements?
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
Your use case is not trivial that's why you will need to implement what my colleague suggested to fully realise it.
Are you sure you need to charge the customer 7 days before the renewal?
Yes, because to start 7 days before and if that attempt failed, we should try 3 days later and the last attemp should happen one day before renewal. In order to make sure payment will be sucessfull before renewal happened
In this case I suggest you follow what my colleague suggested above âď¸
Ok, thanks for answering
Happy to help.