-
-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot specify billing_cycle_anchor attribute for a Subscription #814
Comments
I've got it working in my branch. import datetime
from dateutil.relativedelta import relativedelta
next_month = datetime.date.today() + relativedelta(months=1, day=1)
ts = int(next_first.strftime("%s"))
subscription = customer.subscribe(plan, billing_cycle_anchor=ts) I've submitted two PRs, for master and stable-1.2 |
Thanks, that looks reasonable, I'll take a closer look later. |
Be sure to note two things when leaning on the anchor like this:
Only reason I point this out is because the billing_cycle_anchor isn't meant to be a subscription trial period fix, so if and when a side-effect creeps up and bites anyone in the ass when using it, look in that direction first. |
According to the documentation the
billing_cycle_anchor
attribute can be used when creating and updating a subscription.This is particularly useful for the use case of Combining trials with billing cycle anchor.
As I understand, djstripe supports this option:
https://github.com/dj-stripe/dj-stripe/blob/master/djstripe/models/billing.py#L939
However when using
customer.subscribe()
you cannot specify this parameterhttps://github.com/dj-stripe/dj-stripe/blob/master/djstripe/models/core.py#L512
I am willing to contribute but need some guidance. Is adding it as a parameter to that function and then when calling
Subscription._api_create
enough?The text was updated successfully, but these errors were encountered: