public function cancel($atPeriodEnd = false)
    {
        if ($this->exists() && $cancelled = $this->service->cancel($this->getId(), $atPeriodEnd)) {
            $this->setAttributes(
                $cancelled->toArray()
            );
            return true;
        }
        return false;
    }
public function cancel($atPeriodEnd = false)
    {
        if ($this->exists() && $cancelled = $this->service->cancel($this->getId(), $atPeriodEnd)) {
            $this->setAttributes(
                $cancelled->toArray()
            );
            return true;
        }
        return false;
    }
public function cancel ( $ atPeriodEnd = false ) { if ( $ this -> exists ( ) && $ cancelled = $ this -> service -> cancel ( $ this -> getId ( ) , $ atPeriodEnd ) ) { $ this -> setAttributes ( $ cancelled -> toArray ( ) ) ; return true ; } return false ; }
Cancels the Subscription

@param bool $atPeriodEnd
@return $this|bool
Cancels the Subscription