Simplify redirect logic in PaymentsController

This commit is contained in:
Ahmed Ejaz
2025-08-27 03:27:09 +05:00
parent 626b802ea7
commit a18fd54916

View File

@@ -9,11 +9,7 @@ class PaymentsController < BaseController
@payment = Spree::Payment.find(params[:id])
authorize! :show, @payment.order
if (url = @payment.redirect_auth_url)
redirect_to url
else
redirect_to order_url(@payment.order)
end
redirect_to(@payment.redirect_auth_url || order_url(@payment.order))
end
private