src/gateways/Gateway.php
private function _handlePlanEvent(array $data)
    {
        $planService = Commerce::getInstance()->getPlans();

        if ($data['type'] == 'plan.deleted') {
            $plan = $planService->getPlanByReference($data['data']['object']['id']);

            if ($plan) {
                $planService->archivePlanById($plan->id);
                Craft::warning($plan->name . ' was archived because the corresponding plan was deleted on Stripe. (event "' . $data['id'] . '")', 'stripe');
            }
        }
    }
private function _handlePlanEvent(array $data)
    {
        $planService = Commerce::getInstance()->getPlans();

        if ($data['type'] == 'plan.deleted') {
            $plan = $planService->getPlanByReference($data['data']['object']['id']);

            if ($plan) {
                $planService->archivePlanById($plan->id);
                Craft::warning($plan->name . ' was archived because the corresponding plan was deleted on Stripe. (event "' . $data['id'] . '")', 'stripe');
            }
        }
    }
private function _handlePlanEvent ( array $ data ) { $ planService = Commerce :: getInstance ( ) -> getPlans ( ) ; if ( $ data [ 'type' ] == 'plan.deleted' ) { $ plan = $ planService -> getPlanByReference ( $ data [ 'data' ] [ 'object' ] [ 'id' ] ) ; if ( $ plan ) { $ planService -> archivePlanById ( $ plan -> id ) ; Craft :: warning ( $ plan -> name . ' was archived because the corresponding plan was deleted on Stripe. (event "' . $ data [ 'id' ] . '")' , 'stripe' ) ; } } }
Handle Plan events

@param array $data
@throws \yii\base\InvalidConfigException If plan not
Handle Plan events