public function cancelDelayed($id)
    {
        $this->setCancelAtEndOfPeriod(true);

        $service = $this->getService();
        $rawData = $this->getRawData(array('subscription' => $this->_params));
        $response = $service->request('subscriptions/' . (int)$id, 'PUT', $rawData);
        $responseArray = $this->getResponseArray($response);

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

        return $this;
    }
public function cancelDelayed($id)
    {
        $this->setCancelAtEndOfPeriod(true);

        $service = $this->getService();
        $rawData = $this->getRawData(array('subscription' => $this->_params));
        $response = $service->request('subscriptions/' . (int)$id, 'PUT', $rawData);
        $responseArray = $this->getResponseArray($response);

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

        return $this;
    }
public function cancelDelayed ( $ id ) { $ this -> setCancelAtEndOfPeriod ( true ) ; $ service = $ this -> getService ( ) ; $ rawData = $ this -> getRawData ( array ( 'subscription' => $ this -> _params ) ) ; $ response = $ service -> request ( 'subscriptions/' . ( int ) $ id , 'PUT' , $ rawData ) ; $ responseArray = $ this -> getResponseArray ( $ response ) ; if ( ! $ this -> isError ( ) ) { $ this -> _data = $ responseArray [ 'subscription' ] ; } else { $ this -> _data = array ( ) ; } return $ this ; }
Set the subscription to be canceled at the end of the current billing period.

@param int $id

@return Subscription
@see Subscription::setCancelAtEndOfPeriod()
@see Subscription::setCancellationMessage()
Set the subscription to be canceled at the end of the current billing period .