LaraCart::destroyCart() is not destroying cart anymore
Closed this issue · 3 comments
Hello Luke,
Thank you for this package. I have been using this package for a while now. But suddenly LaraCart::destroyCart();
stop working.
Once payment is successful, i destroy the cart of the user and it was working fine untill now. Now even if the payment is successful, laracart wont clear the cart items.
Can u please look into this.
Here is my code
public function handleGatewayResponse(Request $request,$trackingid){
$orderDetail = Order::where('order_tracking_id', $trackingId)->firstOrFail();
.............. payment gateway code here .............
if($paymentConfirm){
$order->update(['status'=>'paid']); //This is also working
Transaction::create($data); //This is also working and storing data
LaraCart::destroyCart(); //This is not working
return redirect(route('order.confirmation'))->with('orderId', $trackingId); //This is working again
}
}
Thank you.
What version of Laravel are you using ? The route your hitting , does it have the web middleware on it ? (php artisan route:list)
Hi, sorry for late response and yes it is there. The url in which i was trying to clear cart is the payment gateway return url, seems like something is wrong there.
But if i redirect to another url and clear the cart it works fine :)
Awesome glad you figured it out!