From 136c07662309093b9c0a7de3bf9c68522af701bd Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 19 Mar 2024 10:40:11 +1100 Subject: [PATCH] Fixes for square pagination --- app/PaymentDrivers/SquarePaymentDriver.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/PaymentDrivers/SquarePaymentDriver.php b/app/PaymentDrivers/SquarePaymentDriver.php index e77df79aa981..079ef5c3626b 100644 --- a/app/PaymentDrivers/SquarePaymentDriver.php +++ b/app/PaymentDrivers/SquarePaymentDriver.php @@ -470,8 +470,6 @@ class SquarePaymentDriver extends BaseDriver $client_repo = new ClientRepository(new ClientContactRepository()); - nlog($customers); - foreach($customers as $customer) { @@ -496,12 +494,15 @@ class SquarePaymentDriver extends BaseDriver $c = $api_response->getCursor(); if ($c) { - $api_response = $client->getCustomersApi()->listCustomers( - $c, - $limit, - 'DEFAULT', - 'DESC' - ); + $api_response = $this->init() + ->square + ->getCustomersApi() + ->listCustomers( + $c, + $limit, + 'DEFAULT', + 'DESC' + ); } else { break; }