Open padre opened 1 year ago
I'm sorry for the confusion, the service fix didn't cover all the cases we assumed. I'll work on getting this resolved.
@pakrym-stripe can't we just merge my PR in the meantime?
I'm sorry @driesvints, while merging your PR will unblock this issue, the ability to change filter parameters is not a feature we'd like to support long-term on all collections.
Is it possible for you to use manual pagination as a temporary workaround?
No worries. Unfortunately not as we just need to get all line items to display on the custom invoice.
You can get all items by manually iterating pages:
$invoice = $stripe->invoices->retrieve('in_....', [
'expand' => ['lines.data.price.product'],
]);
$page = $invoice->lines;
while (true) {
foreach ($page as $item) {
echo($item["price"]);
}
$page = $page->nextPage([
'expand' => ['data.price.product'],
]);
if ($page->isEmpty()) {
break;
}
}
@pakrym-stripe thank you for that example. I've sent this in for Cashier: https://github.com/laravel/cashier-stripe/pull/1503
Describe the bug
https://github.com/stripe/stripe-php/issues/1400#issuecomment-1344272956
To Reproduce
Expected behavior
All lines on an invoice should be expanded, but it'll fail with the following error:
Attempt to read property "display_name" on string
Code snippets
No response
OS
Ubuntu / Centos
PHP version
PHP 8.1
Library version
stripe/stripe-php v10.3.0
API version
2022-11-15
Additional context
No response