diff --git a/api/v3/Stripe/Listevents.php b/api/v3/Stripe/Listevents.php index 8a896c56823d841fe2daf5d60b869882b52b0d7b..166ad46bc72242ef14e8c4858b7723fb0018a10f 100644 --- a/api/v3/Stripe/Listevents.php +++ b/api/v3/Stripe/Listevents.php @@ -358,8 +358,7 @@ function civicrm_api3_stripe_Listevents($params) { $out = []; $count = 0; foreach($data_list['data'] as $data) { - $count++; - if ($count > $limit) { + if ($count >= $limit) { break; } $item = []; @@ -450,6 +449,7 @@ function civicrm_api3_stripe_Listevents($params) { } } } + $count++; $out[] = $item; } }