Fix for ezypay payment import
This commit is contained in:
parent
49a4830d89
commit
28438c6423
4
app/Classes/External/Payments/Ezypay.php
vendored
4
app/Classes/External/Payments/Ezypay.php
vendored
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user