From 204cd7ad17e91922b4b35af3c146b54b91a87f53 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 18 Oct 2017 15:59:53 +0300 Subject: [PATCH] Fix error after failed to add gateway --- app/Http/Controllers/AccountGatewayController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/AccountGatewayController.php b/app/Http/Controllers/AccountGatewayController.php index 8c1db8731dd8..6aad0c21b69a 100644 --- a/app/Http/Controllers/AccountGatewayController.php +++ b/app/Http/Controllers/AccountGatewayController.php @@ -209,7 +209,8 @@ class AccountGatewayController extends BaseController $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { - return Redirect::to('gateways/create?other_providers=' . ($gatewayId == GATEWAY_WEPAY ? 'false' : 'true')) + $url = $accountGatewayPublicId ? "/gateways/{$accountGatewayPublicId}/edit" : 'gateways/create?other_providers=' . ($gatewayId == GATEWAY_WEPAY ? 'false' : 'true'); + return Redirect::to($url) ->withErrors($validator) ->withInput(); } else {