Skip to content

Commit a370608

Browse files
Merge pull request #103 from sunitpanwar/master
Added exception handling for expired code
2 parents b555cb9 + 9335479 commit a370608

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)