public function reactivate($id)
    {
        $service = $this->getService();

        // this PUT request accepts a query string of 'include_trial'
        $params = array();
        $includeTrial = $this->getParam('include_trial');
        if (is_int($includeTrial)) {
            $params['include_trial'] = $includeTrial;
        }

        $response = $service->request('subscriptions/' . (int)$id . '/reactivate', 'PUT', '', $params);
        $responseArray = $this->getResponseArray($response);

        $code = $response->getStatusCode();

        /**
         * add some more errors for a bad response code. errors will be in the body of the response
         *
         * @todo Plead with Chargify for more consistent error throwing. Sometimes errors
         * are keyed by 'errors' in the response body. Sometimes (as in this case) you just get a
         * zero indexed array. Would be nice if keying was consistent and if errors had unique codes.
         */
        if ('200' != $code) {
            $this->_errors[] = $responseArray;
        }

        if (!$this->isError()) {
            $this->_data = $responseArray['subscription'];
        } else {
            $this->_data = array();
        }

        return $this;
    }
public function reactivate($id)
    {
        $service = $this->getService();

        // this PUT request accepts a query string of 'include_trial'
        $params = array();
        $includeTrial = $this->getParam('include_trial');
        if (is_int($includeTrial)) {
            $params['include_trial'] = $includeTrial;
        }

        $response = $service->request('subscriptions/' . (int)$id . '/reactivate', 'PUT', '', $params);
        $responseArray = $this->getResponseArray($response);

        $code = $response->getStatusCode();

        /**
         * add some more errors for a bad response code. errors will be in the body of the response
         *
         * @todo Plead with Chargify for more consistent error throwing. Sometimes errors
         * are keyed by 'errors' in the response body. Sometimes (as in this case) you just get a
         * zero indexed array. Would be nice if keying was consistent and if errors had unique codes.
         */
        if ('200' != $code) {
            $this->_errors[] = $responseArray;
        }

        if (!$this->isError()) {
            $this->_data = $responseArray['subscription'];
        } else {
            $this->_data = array();
        }

        return $this;
    }
public function reactivate ( $ id ) { $ service = $ this -> getService ( ) ; // this PUT request accepts a query string of 'include_trial' $ params = array ( ) ; $ includeTrial = $ this -> getParam ( 'include_trial' ) ; if ( is_int ( $ includeTrial ) ) { $ params [ 'include_trial' ] = $ includeTrial ; } $ response = $ service -> request ( 'subscriptions/' . ( int ) $ id . '/reactivate' , 'PUT' , '' , $ params ) ; $ responseArray = $ this -> getResponseArray ( $ response ) ; $ code = $ response -> getStatusCode ( ) ; /**
         * add some more errors for a bad response code. errors will be in the body of the response
         *
         * @todo Plead with Chargify for more consistent error throwing. Sometimes errors
         * are keyed by 'errors' in the response body. Sometimes (as in this case) you just get a
         * zero indexed array. Would be nice if keying was consistent and if errors had unique codes.
         */ if ( '200' != $ code ) { $ this -> _errors [ ] = $ responseArray ; } if ( ! $ this -> isError ( ) ) { $ this -> _data = $ responseArray [ 'subscription' ] ; } else { $ this -> _data = array ( ) ; } return $ this ; }
Reactivate the given subscription ID

@param int $id

@return Subscription
@see Subscription::setIncludeTrial()
Reactivate the given subscription ID