This commit is contained in:
2024-04-30 22:01:37 +05:00
parent 2d2e37e8ae
commit d53db60a20

View File

@@ -18,7 +18,9 @@ class OnlinePaymentController extends Controller
public function store(Request $request)
{
// Validate the order id
$request->validate(['orderId' => ['required', 'string', 'max:50', 'exists:online_payment_histories,orderId']]);
if (validator($request->all(), ['orderId' => ['required', 'string', 'max:50', 'exists:online_payment_histories,orderId']])->fails()) {
return ['wrong order id'];
}
// Find order from history
$paymentHistory = OnlinePaymentHistory::where('orderId', $request->orderId)->first();