From 8c1b5f8ffa3ff345255241a1a68549c349b38d43 Mon Sep 17 00:00:00 2001 From: Baghiz Zuhdi Adzin <74885652+baghizzhd@users.noreply.github.com> Date: Tue, 3 Feb 2026 11:55:22 +0700 Subject: [PATCH] penambahan durasi pengecekan VA --- .../student/PurchaseController.php | 4 ++-- .../student/VAPaymentController.php | 2 +- resources/views/payment/va_show.blade.php | 24 ++++--------------- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/app/Http/Controllers/student/PurchaseController.php b/app/Http/Controllers/student/PurchaseController.php index a6bc411..41fa84a 100644 --- a/app/Http/Controllers/student/PurchaseController.php +++ b/app/Http/Controllers/student/PurchaseController.php @@ -35,11 +35,11 @@ class PurchaseController extends Controller DB::raw('payment_histories.id as invoice_id') ); - // 2. Query untuk Unpaid menggunakan Model VAPayment + // 2. Query untuk Unpaid menggunakan Model VAPayment -> dikurangi 30 menit karena mengantisipasi delay saat pembayaran $unpaid = VAPayment::query() ->where('user_id', $userId) ->where('status', 0) - ->where('expired_at', '>=', now()) + ->where('expired_at', '>=', now()->subMinutes(45)) ->select( 'id', DB::raw('"Virtual Account BTN" as title'), diff --git a/app/Http/Controllers/student/VAPaymentController.php b/app/Http/Controllers/student/VAPaymentController.php index f5d0f9c..1b6cc08 100644 --- a/app/Http/Controllers/student/VAPaymentController.php +++ b/app/Http/Controllers/student/VAPaymentController.php @@ -193,7 +193,7 @@ class VAPaymentController extends Controller ]); } - if (now()->greaterThan($payment->expired_at)) { + if (now()->subMinutes(45)->greaterThan($payment->expired_at)) { $payment->update(['status' => 2]); return response()->json([ diff --git a/resources/views/payment/va_show.blade.php b/resources/views/payment/va_show.blade.php index 21a39ab..53a4438 100644 --- a/resources/views/payment/va_show.blade.php +++ b/resources/views/payment/va_show.blade.php @@ -131,9 +131,8 @@