The Stripe 'list all plans' api call by default only returns a maximum of 10 plans; There is an optional limit parameter which I wish to set to the value 100 to raise the default limit - Stripe api ref.
I'm using Omnipay-Stripe and I can return 10 plans with the following code:
$response = $this->gateway->listPlans($params)->send();
if ($response->isSuccessful()) {
$data = $response->getData();
return $data['data'];
}
Following this SO answer I'm trying to set the limit parameter to 100 with the code below:
$request = $this->gateway->listPlans();
$data = $request->getData();
$data['limit'] = 100;
$response = $request->sendData($data);
if ($response->isSuccessful()) {
$data = $response->getData();
return $data['data'];
}
But this still will not return any more than 10 plans. I have successfully tested stripe-php to prove the limit parameter does work, but no luck yet with omnipay-stripe. Any ideas please?
I've tried adding the following function to omnipay\stripe\src\Message\ListPlansRequest.php
public function setLimit($limit)
{
return $this->setParameter('limit', $limit);
}
And changed my code to:
$request = $this->gateway->listPlans();
$request->setLimit('100');
$data = $request->getData();
$response = $request->sendData($data);
But still only 10 plans returned and the limit parameter is not logged as received in the Stripe request GET logs.