From f2f39d86d8e8f605827ad42cb603aab0f8ac34b3 Mon Sep 17 00:00:00 2001 From: hafifierahman Date: Mon, 17 Jul 2023 12:42:08 +0800 Subject: [PATCH] add checking in the controller for the payment that have been successfully. --- app/Http/Controllers/BayaranController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Controllers/BayaranController.php b/app/Http/Controllers/BayaranController.php index e98b0f6..a8619f5 100644 --- a/app/Http/Controllers/BayaranController.php +++ b/app/Http/Controllers/BayaranController.php @@ -77,6 +77,10 @@ class BayaranController extends Controller { $gadai = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/gadai/norujukan/'. $sag)->json(); + $sagonline = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/portal/searchsagonline/',['norujukan' => $sag])->json(); + + if($sagonline == true) + return redirect()->route('home')->with('error','Salah Satu SAG Yang Dipilih Telah Pun Dibayar!'); //$array_lelong = Http::withOptions(['verify' => config('app.api_verify')])->get('https://niklah.arrahn.com.my/api/portalApi',['norujukan' => $sag])->json(); //if($array_lelong['lelong'] !== null){ // return redirect()->route('home')->with('error','Barangan Sedang Dilelong.');