public function cancel()
    {
        if (!isset($this->_links->self->href)) {
            return $this;
        }

        $body = null;
        if($this->client->usesOAuth()) {
            $body = json_encode([
                "testmode" => $this->mode === "test" ? true : false
            ]);
        }

        $result = $this->client->performHttpCallToFullUrl(
            MollieApiClient::HTTP_DELETE,
            $this->_links->self->href,
            $body
        );

        return ResourceFactory::createFromApiResult($result, new Subscription($this->client));
    }
public function cancel()
    {
        if (!isset($this->_links->self->href)) {
            return $this;
        }

        $body = null;
        if($this->client->usesOAuth()) {
            $body = json_encode([
                "testmode" => $this->mode === "test" ? true : false
            ]);
        }

        $result = $this->client->performHttpCallToFullUrl(
            MollieApiClient::HTTP_DELETE,
            $this->_links->self->href,
            $body
        );

        return ResourceFactory::createFromApiResult($result, new Subscription($this->client));
    }
public function cancel ( ) { if ( ! isset ( $ this -> _links -> self -> href ) ) { return $ this ; } $ body = null ; if ( $ this -> client -> usesOAuth ( ) ) { $ body = json_encode ( [ "testmode" => $ this -> mode === "test" ? true : false ] ) ; } $ result = $ this -> client -> performHttpCallToFullUrl ( MollieApiClient :: HTTP_DELETE , $ this -> _links -> self -> href , $ body ) ; return ResourceFactory :: createFromApiResult ( $ result , new Subscription ( $ this -> client ) ) ; }
Cancels this subscription

@return Subscription
Cancels this subscription