public function cancel(string $id, bool $atPeriodEnd)
    {
        // Log Debug
        $this->flow->getLogger()->debug("Cancelling Subscription $id" . ($atPeriodEnd ? ' at period end.' : '.'));

        return $this->make(
            $this->flow->send(
                'post',
                $this->endpoint . '/cancel',
                [
                    'subscriptionId' => $id,
                    'at_period_end' => (int) $atPeriodEnd,
                ]
            )
        );
    }
public function cancel(string $id, bool $atPeriodEnd)
    {
        // Log Debug
        $this->flow->getLogger()->debug("Cancelling Subscription $id" . ($atPeriodEnd ? ' at period end.' : '.'));

        return $this->make(
            $this->flow->send(
                'post',
                $this->endpoint . '/cancel',
                [
                    'subscriptionId' => $id,
                    'at_period_end' => (int) $atPeriodEnd,
                ]
            )
        );
    }
public function cancel ( string $ id , bool $ atPeriodEnd ) { // Log Debug $ this -> flow -> getLogger ( ) -> debug ( "Cancelling Subscription $id" . ( $ atPeriodEnd ? ' at period end.' : '.' ) ) ; return $ this -> make ( $ this -> flow -> send ( 'post' , $ this -> endpoint . '/cancel' , [ 'subscriptionId' => $ id , 'at_period_end' => ( int ) $ atPeriodEnd , ] ) ) ; }
Cancels a Subscription

@param string $id
@param bool $atPeriodEnd
@return \DarkGhostHunter\FlowSdk\Resources\BasicResource & SubscriptionResource
@throws \Exception
Cancels a Subscription