You are here

public function LicenseSubscription::onSubscriptionActivate in Commerce License 8.2

Acts on a subscription after it has been activated.

If a trial just ended, $subscription->getTrialEndTime() will be non-empty and $subscription->getOrders() will have a single order (the trial order).

Called before the subscription and recurring order are saved.

Parameters

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

\Drupal\commerce_order\Entity\OrderInterface $order: The recurring order.

Overrides SubscriptionTypeBase::onSubscriptionActivate

File

src/Plugin/Commerce/SubscriptionType/LicenseSubscription.php, line 72

Class

LicenseSubscription
Provides a Commerce Recurring subscription type for use with licenses.

Namespace

Drupal\commerce_license\Plugin\Commerce\SubscriptionType

Code

public function onSubscriptionActivate(SubscriptionInterface $subscription, OrderInterface $order) {

  // We don't need to do anything here, as LicenseOrderSyncSubscriber takes
  // care of activating the license in an initial order with a subscription.
}