getParameter('subscriptionReference'); } /** * Set the set subscription reference. * * @param string $value * * @return CancelSubscriptionRequest provides a fluent interface. */ public function setSubscriptionReference($value) { return $this->setParameter('subscriptionReference', $value); } /** * Set whether or not to cancel the subscription at period end. * * @param bool $value * * @return CancelSubscriptionRequest provides a fluent interface. */ public function setAtPeriodEnd($value) { return $this->setParameter('atPeriodEnd', $value); } /** * Get whether or not to cancel the subscription at period end. * * @return bool */ public function getAtPeriodEnd() { return $this->getParameter('atPeriodEnd'); } public function getData() { $this->validate('customerReference', 'subscriptionReference'); $data = array(); // NOTE: Boolean must be passed as string // Otherwise it will be converted to numeric 0 or 1 // Causing an error with the API if ($this->getAtPeriodEnd()) { $data['at_period_end'] = 'true'; } return $data; } public function getEndpoint() { return $this->endpoint .'/customers/'.$this->getCustomerReference() .'/subscriptions/'.$this->getSubscriptionReference(); } public function getHttpMethod() { return 'DELETE'; } }