protected function _actionProcess($context)
    {
        try {
            $identifier = 'com:subscriptions.controller.subscription';
            $subscription = $this->getService($identifier)->setOrder($this->order->cloneEntity())->add();
        } catch (ComSubscriptionsDomainPaymentException $exception) {
            $this->setMessage('COM-SUBSCRIPTIONS-TRANSACTION-ERROR', 'error');
            throw new RuntimeException('Payment process error');
        }

        if ($subscription->persisted()) {

            AnRequest::set('session.signup', null);
            AnRequest::set('session.subscriber_id', $subscription->person->id);
            $url = route('option=com_subscriptions&view=signup&layout=processed&id='.$this->getItem()->id);

            if (get_viewer()->guest()) {
                $return = base64UrlEncode($url);
                $token = $subscription->person->activationCode;
                $url = route('option=com_people&view=session&token='.$token.'&return='.$return);
            }

            $context->response->setRedirect($url);

        } else {
            throw new RuntimeException("Couldn't subscribe");
        }

        return true;
    }
protected function _actionProcess($context)
    {
        try {
            $identifier = 'com:subscriptions.controller.subscription';
            $subscription = $this->getService($identifier)->setOrder($this->order->cloneEntity())->add();
        } catch (ComSubscriptionsDomainPaymentException $exception) {
            $this->setMessage('COM-SUBSCRIPTIONS-TRANSACTION-ERROR', 'error');
            throw new RuntimeException('Payment process error');
        }

        if ($subscription->persisted()) {

            AnRequest::set('session.signup', null);
            AnRequest::set('session.subscriber_id', $subscription->person->id);
            $url = route('option=com_subscriptions&view=signup&layout=processed&id='.$this->getItem()->id);

            if (get_viewer()->guest()) {
                $return = base64UrlEncode($url);
                $token = $subscription->person->activationCode;
                $url = route('option=com_people&view=session&token='.$token.'&return='.$return);
            }

            $context->response->setRedirect($url);

        } else {
            throw new RuntimeException("Couldn't subscribe");
        }

        return true;
    }
protected function _actionProcess ( $ context ) { try { $ identifier = 'com:subscriptions.controller.subscription' ; $ subscription = $ this -> getService ( $ identifier ) -> setOrder ( $ this -> order -> cloneEntity ( ) ) -> add ( ) ; } catch ( ComSubscriptionsDomainPaymentException $ exception ) { $ this -> setMessage ( 'COM-SUBSCRIPTIONS-TRANSACTION-ERROR' , 'error' ) ; throw new RuntimeException ( 'Payment process error' ) ; } if ( $ subscription -> persisted ( ) ) { AnRequest :: set ( 'session.signup' , null ) ; AnRequest :: set ( 'session.subscriber_id' , $ subscription -> person -> id ) ; $ url = route ( 'option=com_subscriptions&view=signup&layout=processed&id=' . $ this -> getItem ( ) -> id ) ; if ( get_viewer ( ) -> guest ( ) ) { $ return = base64UrlEncode ( $ url ) ; $ token = $ subscription -> person -> activationCode ; $ url = route ( 'option=com_people&view=session&token=' . $ token . '&return=' . $ return ) ; } $ context -> response -> setRedirect ( $ url ) ; } else { throw new RuntimeException ( "Couldn't subscribe" ) ; } return true ; }
Process Action.

@param AnCommandContext $context

@return boolean
Process Action .