laravel-paystack icon indicating copy to clipboard operation
laravel-paystack copied to clipboard

The paystack token has expired. Please refresh the page and try again.

Open Iconbanderas opened this issue 2 years ago • 1 comments

This keeps happening on laravel 8 and PHP 7.3, Is there a permanent fix? How do we fix the paystack token always getting expired? Or does this not work for test keys?

Iconbanderas avatar Mar 08 '22 11:03 Iconbanderas

Some required parameters to initiate the payment might be missing from your $request, you can try output the error under the catch block to see more details on what went wrong.

You can try this

            try {
                   return Paystack::getAuthorizationUrl()->redirectNow();
             } catch (\Exception $e) {
                   return $e->getMessage();  //Output the error here
                   echo "The paystack token has expired. Please refresh the page and try again.";
        }

iNerdStack avatar May 31 '22 08:05 iNerdStack