Cancels the Subscription

@param bool $atPeriodEnd
@return $this|bool
762454
public function cancel($atPeriodEnd = false)
    {
        if ($this->exists() && $cancelled = $this->service->cancel($this->getId(), $atPeriodEnd)) {
            $this->setAttributes(
                $cancelled->toArray()
            );
            return true;
        }
        return false;
    }
221548
def cancel_subscription(self, sid):
        
        url = urljoin(self._url_base, self._event_sub_url)
        headers = dict(
            HOST=urlparse(url).netloc,
            SID=sid
        )
        resp = requests.request('UNSUBSCRIBE', url, headers=headers, auth=self.device.http_auth)
        resp.raise_for_status()
915483
public function exclude($iElementID = null)
    {
        if (empty($iElementID) || $this->isEmpty()) {
            return $this->returnThis();
        }

        $iElementIDKey = array_search($iElementID, $this->arElementIDList);
        if ($iElementIDKey === false) {
            return $this->returnThis();
        }

        unset($this->arElementIDList[$iElementIDKey]);

        return $this->returnThis();
    }
1350413
public function cancelRefund($refundID, $paymentID)
    {
        $obj = new stdClass();

        // Must be in specific order for checksum --
        $obj->Secret = $this->getSecretCode();
        $obj->MerchantID = $this->getMerchantID();
        $obj->Timestamp = $this->getTimeStamp();
        $obj->RefundID = $refundID;
        $obj->PaymentID = $paymentID;
        // -----------------------------------------  
        // Generate Checksum
        $obj->Checksum = $this->generateChecksum($obj);

        // Ask for cancelRefunt and get response
        $result = $this->client->CancelRefund($obj);
        $result = $result->CancelRefundResult;

        $obj->Timestamp = $result->Timestamp;
        $obj->Success = $result->Success;

        // Unset properties for new Checksum
        unset($obj->RefundID, $obj->PaymentID, $obj->Checksum);

        // Verify response data by making a new Checksum
        $Checksum = $this->generateChecksum($obj);

        // Compare Checksums
        if ($result->Checksum != $Checksum)
            throw new Exception('Data could not be verified');

        return (array) $result;
    }
394579
public void terminateSubscription(final Subscription subscription, final RefundOption refund) {
        doPUT(Subscription.SUBSCRIPTION_RESOURCE + "/" + subscription.getUuid() + "/terminate?refund=" + refund,
              subscription, Subscription.class);
    }
1293434
public static function cancel( ScopedCallback &$sc = null ) {
		if ( $sc ) {
			$sc->callback = null;
		}
		$sc = null;
	}
89201
protected function cancelSubscription($subscriptionId)
    {
        $subscription = $this->getSubscriptionById($subscriptionId);

        if ($subscription && (! $subscription->cancelled() || $subscription->onGracePeriod())) {
            $subscription->markAsCancelled();
        }

        return new Response('Webhook Handled', 200);
    }
1206855
public function cancelPreApproval($preApprovalCode)
    {
        return $this->sendTransaction([
            'email' => $this->email,
            'token' => $this->token,
        ], $this->url['preApprovalCancel'].$preApprovalCode, false);
    }
937477
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));
    }
10944
public function cancel($params = array())
    {
        $arr = array( "id" => $params["id"]);
        $rawResponse = $this->client->request('delete', 'api/exchange/orders' . '/' . $arr['id'] , $arr);
        return $rawResponse;
    }
792192
public function setDistinct()
    {
        $this->removeSelectModifier(self::ALL);
        $this->addSelectModifier(self::DISTINCT);

        return $this;
    }
444229
public function cancel()
    {
        if (!$this->status && !$this->attemped && $cancelled = $this->service->cancel($this->getId())) {
            $this->setAttributes(
                $cancelled->toArray()
            );
            return true;
        }
        return false;
    }
50605
public function cancel($consumerTag, $nowait = false)
    {
        return $this->getClient()->cancel($this->getChannelId(), $consumerTag, $nowait);
    }
230074
public static ApruveResponse<SubscriptionCancelResponse> cancel(
			String subscriptionId) {
		return ApruveClient.getInstance().post(getCancelPath(subscriptionId),
				"", SubscriptionCancelResponse.class);
	}
1159403
public function unsubscribe($destination, $subscriptionId = null, array $header = [])
    {
        return $this->client->sendFrame(
            $this->getProtocol()->getUnsubscribeFrame($destination, $subscriptionId)->addHeaders($header)
        );
    }
288576
public function cancelOrderReference()
    {
        $cancelOrderReferenceRequest 
            = new OffAmazonPaymentsService_Model_CancelOrderReferenceRequest();
        $cancelOrderReferenceRequest->setSellerId($this->_sellerId);
        $cancelOrderReferenceRequest
            ->setAmazonOrderReferenceId($this->_amazonOrderReferenceId);
        
        return $this->_service->cancelOrderReference($cancelOrderReferenceRequest);
    }
862086
public function skip($callback)
    {
        $this->rejects[] = is_callable($callback) ? $callback : function () use ($callback) {
            return $callback;
        };

        return $this;
    }