Skip to content

Commit

Permalink
Allow billing_cycle_anchor argument when creating a subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
PabloCastellano committed Feb 4, 2019
1 parent 03a39db commit 017cfda
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion djstripe/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ def pending_charges(self):
def subscribe(
self, plan, charge_immediately=True, application_fee_percent=None, coupon=None,
quantity=None, metadata=None, tax_percent=None, trial_end=None, trial_from_plan=None,
trial_period_days=None
trial_period_days=None, billing_cycle_anchor=None
):
"""
Subscribes this customer to a plan.
Expand All @@ -935,6 +935,10 @@ def subscribe(
application fee percentage.
:type application_fee_percent: Decimal. Precision is 2; anything more will be ignored. A positive
decimal between 1 and 100.
:param billing_cycle_anchor: A future timestamp to anchor the subscription’s billing cycle.
This is used to determine the date of the first full invoice, and, for plans
with months or year intervals, the day of the month for subsequent invoices.
:type billing_cycle_anchor: integer
:param coupon: The code of the coupon to apply to this subscription. A coupon applied to a subscription
will only affect invoices created for that particular subscription.
:type coupon: string
Expand Down Expand Up @@ -977,6 +981,7 @@ def subscribe(
plan=plan,
customer=self.stripe_id,
application_fee_percent=application_fee_percent,
billing_cycle_anchor=billing_cycle_anchor,
coupon=coupon,
quantity=quantity,
metadata=metadata,
Expand Down

0 comments on commit 017cfda

Please sign in to comment.