You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can't create a subscription with a coupon in the parameters. Settings the coupon as a parameter in the request allow you to set a discount on a newly created subscription as it is stated in the documentation.
We should update the CreateSubscriptionRequest and add getter and setter for the coupon as follow :
`/**
* Set the coupon
*
* @param $value
* @return \Omnipay\Common\Message\AbstractRequest|CreateSubscriptionRequest
*/
public function setCoupon($value)
{
return $this->setParameter('coupon', $value);
}
/**
* Set the plan
*
* @param $value
* @return \Omnipay\Common\Message\AbstractRequest|CreateSubscriptionRequest
*/
public function setPlan($value)
{
return $this->setParameter('plan', $value);
}
`
And also add a condition the getData() method to add the coupon in the request data like this :
Hello,
We can't create a subscription with a coupon in the parameters. Settings the coupon as a parameter in the request allow you to set a discount on a newly created subscription as it is stated in the documentation.
We should update the CreateSubscriptionRequest and add getter and setter for the coupon as follow :
`/**
* Set the coupon
*
* @param $value
* @return \Omnipay\Common\Message\AbstractRequest|CreateSubscriptionRequest
*/
public function setCoupon($value)
{
return $this->setParameter('coupon', $value);
}
`
And also add a condition the getData() method to add the coupon in the request data like this :
if($this->parameters->has('coupon')) { $data['coupon'] = $this->getCoupon(); }
I will try to make a proper pull request
Thank you
The text was updated successfully, but these errors were encountered: