Skip to content

AutoPagingIterator does not work with an invoice that has more than 10 line items that use tax rates #1422

@padre

Description

@padre

Describe the bug

#1400 (comment)

To Reproduce

$stripe = new \Stripe\StripeClient('stripe-secret');

$invoice = $stripe->invoices->retrieve('in_xxx', [
    'expand' => ['lines.data.tax_amounts.tax_rate'],
]);

foreach ($invoice->lines->autoPagingIterator() as $line) {
    foreach ($line->tax_amounts as $tax_amount) {
        $tax_rate = $tax_amount->tax_rate;
        echo $tax_rate->display_name . ' ' . $tax_rate->percentage . '%' . PHP_EOL;
    }
}

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions