Skip to content

Commit 9335479

Browse files
authored
Added exception handling for expired code
1 parent 533d45b commit 9335479

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,11 @@ class PaymentController extends Controller
181181
*/
182182
public function redirectToGateway()
183183
{
184-
return Paystack::getAuthorizationUrl()->redirectNow();
184+
try{
185+
return Paystack::getAuthorizationUrl()->redirectNow();
186+
}catch(\Exception $e) {
187+
return Redirect::back()->withMessage(['msg'=>'The paystack token has expired. Please refresh the page and try again.', 'type'=>'error']);
188+
}
185189
}
186190

187191
/**

0 commit comments

Comments
 (0)