From 32a13c8e0e40e7cf4ebce26b519e2cf7b0a0fc40 Mon Sep 17 00:00:00 2001 From: Stephan Vock Date: Tue, 6 Jul 2021 14:59:14 +0100 Subject: [PATCH] Subscription: add option to update at end of term --- lib/recurly/subscription.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/recurly/subscription.php b/lib/recurly/subscription.php index c7b96bfa..b1b16edc 100644 --- a/lib/recurly/subscription.php +++ b/lib/recurly/subscription.php @@ -154,6 +154,16 @@ public function updateAtNextBillDate() { $this->_save(Recurly_Client::PUT, $this->uri()); } + /** + * Make an update that applies at the term end date of the subscription. + * + * @throws Recurly_Error + */ + public function updateAtTermEnd() { + $this->timeframe = 'term_end'; + $this->_save(Recurly_Client::PUT, $this->uri()); + } + /** * Terminate the subscription immediately and issue a full refund of the last renewal *