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
I've tested the listPlans() request and by default a maximum of 10 plans are returned. To return more plans I need to pass the parameter array('limit' => 100) but I've not been able to make this work.
Even if I add the parameter in Gateway.php as follows the parameter is not logged in Stripe:
public function listPlans(array $parameters = array())
{
$parameters['limit'] = 100;
return $this->createRequest('\Omnipay\Stripe\Message\ListPlansRequest', $parameters);
}
The Stripe listPlans function is a GET request to https://api.stripe.com/v1/plans so the limit parameter needs to be in a query string like https://api.stripe.com/v1/plans?limit=3
I was hoping that Omnipay gateway logic, knowing that ListPlansRequest HttpMethod is 'GET', would add any parameters set to a query string in the CURLOPT_URL. So I tried the following code in my project: $request = $this->gateway->listPlans(array('limit' => 100))->send();
and $request = $this->gateway->listPlans()->initialize(array('setLimit' => 100))->send();
But neither applied the limit parameter.
So I added the following class methods to ListPlansRequest:
public function getLimit()
{
return $this->getParameter('limit');
}
public function setLimit($limit)
{
return $this->setParameter('limit', $limit);
}
Unless there's another way to pass a parameter to the GET request, it would be good if omnipay-stripe could be extended to accept the limit parameter in the listPlans request either as above or by some other method.
I've tested the listPlans() request and by default a maximum of 10 plans are returned. To return more plans I need to pass the parameter
array('limit' => 100)
but I've not been able to make this work.Even if I add the parameter in Gateway.php as follows the parameter is not logged in Stripe:
But it does work if I use the stripe-php library
UPDATE: I've tried adding the following function to omnipay\stripe\src\Message\ListPlansRequest.php
And changed my code to:
But still only 10 plans returned and the limit parameter is not logged as received in the Stripe request GET logs.
The text was updated successfully, but these errors were encountered: