From c0ea157ab6ee44bd354bbb75c70c42ae808a0940 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 9 Jul 2023 17:50:30 +1000 Subject: [PATCH] Adjustments for payments --- app/Jobs/Subscription/CleanStaleInvoiceOrder.php | 4 ++-- app/Services/ClientPortal/InstantPayment.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Jobs/Subscription/CleanStaleInvoiceOrder.php b/app/Jobs/Subscription/CleanStaleInvoiceOrder.php index f872b467f636..b182a8831c1f 100644 --- a/app/Jobs/Subscription/CleanStaleInvoiceOrder.php +++ b/app/Jobs/Subscription/CleanStaleInvoiceOrder.php @@ -56,7 +56,7 @@ class CleanStaleInvoiceOrder implements ShouldQueue Invoice::query() ->withTrashed() ->where('status_id', Invoice::STATUS_SENT) - ->where('created_at', '<', now()->subHours(2)) + ->whereBetween('created_at', [now()->subHours(1), now()->subMinutes(10)]) ->where('balance', '>', 0) ->cursor() ->each(function ($invoice){ @@ -77,7 +77,7 @@ class CleanStaleInvoiceOrder implements ShouldQueue Invoice::query() ->withTrashed() ->where('is_proforma', 1) - ->where('created_at', '<', now()->subHour()) + ->whereBetween('created_at', [now()->subHours(1), now()->subMinutes(10)]) ->cursor() ->each(function ($invoice) use ($repo) { $invoice->is_proforma = false; diff --git a/app/Services/ClientPortal/InstantPayment.php b/app/Services/ClientPortal/InstantPayment.php index 2e5feffd85ea..284e79d93a24 100644 --- a/app/Services/ClientPortal/InstantPayment.php +++ b/app/Services/ClientPortal/InstantPayment.php @@ -190,7 +190,7 @@ class InstantPayment /* Schedule a job to check the gateway fees for this invoice*/ if (Ninja::isHosted()) { - CheckGatewayFee::dispatch($first_invoice->id, $client->company->db)->delay(600); + CheckGatewayFee::dispatch($first_invoice->id, $client->company->db)->delay(800); } if ($gateway) {