Skip to content

added a new method Subscription::clearPendingCancellation#32

Open
esokullu wants to merge 6 commits intocrucialwebstudio:developfrom
esokullu:master
Open

added a new method Subscription::clearPendingCancellation#32
esokullu wants to merge 6 commits intocrucialwebstudio:developfrom
esokullu:master

Conversation

@esokullu
Copy link
Copy Markdown

@esokullu esokullu commented Aug 8, 2019

just read CONTRIBUTING.md (sorry for the duplicate)

@esokullu
Copy link
Copy Markdown
Author

esokullu commented Aug 8, 2019

sorry I had to release this on packagist for a package we use internally, hence the composer.json name change. messed things up a bit, will roll it back.

@esokullu
Copy link
Copy Markdown
Author

esokullu commented Aug 8, 2019

You may add manually:

    /**
     * Clears the pending cancellation from a subscription in delayed cancellation
     *
     * @param int $id
     *
     * @return Subscription
     * @see Subscription::cancelDelayed()
     */
    public function clearPendingCancellation($id)
    {
        $service = $this->getService();
        $response = $service->request('subscriptions/' . (int)$id .'/delayed_cancel', 'DELETE', []);
        $responseArray = $this->getResponseArray($response);
        if (!$this->isError()) {
            $this->_data = $responseArray['subscription'];
        } else {
            $this->_data = array();
        }

        return $this;
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant