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 @@