From 93354796ee37d4174703fbefa216a5d6c32eb265 Mon Sep 17 00:00:00 2001 From: sunitpanwar Date: Thu, 4 Jun 2020 19:23:04 +0530 Subject: [PATCH] Added exception handling for expired code --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e98d9db..f4ad8ec 100644 --- a/README.md +++ b/README.md @@ -181,7 +181,11 @@ class PaymentController extends Controller */ public function redirectToGateway() { - return Paystack::getAuthorizationUrl()->redirectNow(); + try{ + return Paystack::getAuthorizationUrl()->redirectNow(); + }catch(\Exception $e) { + return Redirect::back()->withMessage(['msg'=>'The paystack token has expired. Please refresh the page and try again.', 'type'=>'error']); + } } /**