Skip to content

Commit 9e6dd8f

Browse files
Fix parameter cancel_at_period_end
1 parent c08c8d5 commit 9e6dd8f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/Message/UpdateSubscriptionRequest.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,19 @@ public function setSubscriptionReference($value)
7474
return $this->setParameter('subscriptionReference', $value);
7575
}
7676

77+
/**
78+
* @return bool
79+
*/
80+
public function getCancelAtPeriodEnd()
81+
{
82+
return $this->getParameter('cancel_at_period_end');
83+
}
84+
85+
public function setCancelAtPeriodEnd($value)
86+
{
87+
return $this->setParameter('cancel_at_period_end', $value);
88+
}
89+
7790
public function getData()
7891
{
7992
$this->validate('subscriptionReference', 'plan');
@@ -87,7 +100,7 @@ public function getData()
87100
}
88101

89102
if ($this->parameters->has('cancel_at_period_end')) {
90-
$data['cancel_at_period_end'] = (bool)$this->getParameter('cancel_at_period_end');
103+
$data['cancel_at_period_end'] = (bool)$this->getCancelAtPeriodEnd();
91104
}
92105

93106
if ($this->getMetadata()) {

0 commit comments

Comments
 (0)