You are here

public function RecurringOrderManagerInterface::startTrial in Commerce Recurring Framework 8

Starts the trial for the given subscription.

Creates a recurring order covering the trial period. The order will be closed once the trial period is over.

Since there can only be a single trial period, the trial order is one-off, never renewed. A new recurring order is created by startRecurring() once the subscription is activated.

Parameters

\Drupal\commerce_recurring\Entity\SubscriptionInterface $subscription: The trial subscription.

Return value

\Drupal\commerce_order\Entity\OrderInterface The trial recurring order.

Throws

\InvalidArgumentException Thrown if subscription state is not "trial".

1 method overrides RecurringOrderManagerInterface::startTrial()
RecurringOrderManager::startTrial in src/RecurringOrderManager.php
Starts the trial for the given subscription.

File

src/RecurringOrderManagerInterface.php, line 43

Class

RecurringOrderManagerInterface
Manages recurring orders.

Namespace

Drupal\commerce_recurring

Code

public function startTrial(SubscriptionInterface $subscription);