Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscription termination - add charge argument #313

Closed
kai11 opened this issue Apr 15, 2017 · 0 comments · Fixed by #374
Closed

Subscription termination - add charge argument #313

kai11 opened this issue Apr 15, 2017 · 0 comments · Fixed by #374
Assignees
Labels

Comments

@kai11
Copy link

kai11 commented Apr 15, 2017

https://dev.recurly.com/docs/terminate-subscription mention charge argument, but it's not in library.
Please fix.

Until this is fixed, my monkey patch can be useful for others:

class Recurly_SubscriptionEx extends \Recurly_Subscription {
    public static function get($uuid, $client = null) {
        Recurly_Resource::$class_map['subscription'] = 'Recurly_SubscriptionEx';
        $ret = \Recurly_Base::_get(\Recurly_SubscriptionEx::uriForSubscription($uuid), $client);
        Recurly_Resource::$class_map['subscription'] = 'Recurly_Subscription';
        return $ret;
    }
    public function terminateEx($refundType, $charge) {
        $this->_save(\Recurly_Client::PUT, $this->uri() . '/terminate?refund=' . $refundType . '    &charge=' . ($charge ? 'true' : 'false'));
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants