Skip to content

Commit

Permalink
Merge pull request #75 from Neirda24/master
Browse files Browse the repository at this point in the history
Add tax_percent when creating subscription
  • Loading branch information
delatbabel committed May 12, 2017
2 parents e11b40d + 25728b5 commit 65f3b98
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/Message/CreateSubscriptionRequest.php
Expand Up @@ -33,6 +33,26 @@ public function setPlan($value)
return $this->setParameter('plan', $value);
}

/**
* Get the tax percent
*
* @return string
*/
public function getTaxPercent()
{
return $this->getParameter('tax_percent');
}

/**
* Set the tax percentage
*
* @return CreateSubscriptionRequest provides a fluent interface.
*/
public function setTaxPercent($value)
{
return $this->setParameter('tax_percent', $value);
}

public function getData()
{
$this->validate('customerReference', 'plan');
Expand All @@ -41,6 +61,10 @@ public function getData()
'plan' => $this->getPlan()
);

if ($this->parameters->has('tax_percent')) {
$data['tax_percent'] = (float)$this->getParameter('tax_percent');
}

return $data;
}

Expand Down

0 comments on commit 65f3b98

Please sign in to comment.