Money.Subscription.cancel_pending_plan

You're seeing just the function cancel_pending_plan, go back to Money.Subscription module for more information.
Link to this function

cancel_pending_plan(subscription, options \\ [])

View Source

Specs

cancel_pending_plan(t(), Keyword.t()) :: t()

Cancel a subscription's pending plan.

A pending plan arise when a a Subscription.change_plan/3 has been executed but the effective date is in the future. Only one plan may be pending at any one time so that if Subscription.change_plan/3 is attemtped a second time an error tuple will be returned.

Subscription.cancel_pending_plan/2 can be used to roll back the pending plan change.

Arguments

  • :subscription is any Money.Subscription.t

  • :options is a Keyword.t

Options

  • :today is a Date.t that represents today. The default is Date.utc_today

Returns

  • An updated Money.Subscription.t which may or may not have had a pending plan. If it did have a pending plan that plan is deleted. If there was no pending plan then the subscription is returned unchanged.