diff --git a/app/Classes/External/Payments/Ezypay.php b/app/Classes/External/Payments/Ezypay.php index 35d5be7..41aef52 100644 --- a/app/Classes/External/Payments/Ezypay.php +++ b/app/Classes/External/Payments/Ezypay.php @@ -30,8 +30,8 @@ class Ezypay extends Payments $api_remain = Arr::get($result->getHeader('X-RateLimit-Remaining'),0); $api_reset = Arr::get($result->getHeader('X-RateLimit-Reset'),0); - if ($api_remain == 0) { - Log::error('API Throttle.',['m'=>__METHOD__]); + if ($api_remain === 0) { + Log::error('API Throttle.',['m'=>__METHOD__,'api_reset'=>$api_reset]); Cache::put('api_throttle',$api_reset,now()->addSeconds($api_reset)); } diff --git a/app/Jobs/PaymentsImport.php b/app/Jobs/PaymentsImport.php index 0caab18..1011893 100644 --- a/app/Jobs/PaymentsImport.php +++ b/app/Jobs/PaymentsImport.php @@ -57,7 +57,7 @@ final class PaymentsImport implements ShouldQueue } // Find the last payment logged - $last = Carbon::createFromTimestamp(Payment::whereIN('checkout_id',$cos)->where('account_id',$ao->id)->max('paid_at')); + $last = Carbon::create(Payment::whereIN('checkout_id',$cos)->where('account_id',$ao->id)->max('paid_at')); $o = $this->o->getDebits([ 'customerId'=>$c->Id, @@ -66,6 +66,8 @@ final class PaymentsImport implements ShouldQueue 'pageSize'=>100, ]); + Log::info(sprintf('%s:Loaded [%d] payments for account: [%s]',self::LOGKEY,$o->count(),$ao->id)); + // Load the payments if ($o->count()) { foreach ($o->reverse() as $p) {