From 03fc3b17f1186a3e4943fcc7f5dc21b4b34c9a56 Mon Sep 17 00:00:00 2001
From: Jamie McClelland <jm@mayfirst.org>
Date: Fri, 12 Mar 2021 13:55:45 -0500
Subject: [PATCH] don't over count by one.

---
 api/v3/Stripe/Listevents.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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