laravel-paystack: Any body experience this exception "URI must be a string or UriInterface"
The app has been throwing this error for a while. If I comment out this line in the form
<input type="hidden" name="reference" value="{{ Paystack::genTranxRef() }}"> it works fine but throws that same error on the PaymentController@redirectToGateway controller.
I search and realized it has to do with Guzzle, anyway to bypass this exception?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 3
- Comments: 24 (4 by maintainers)
@Pauloo101 i experienced this same issue and it took me three days to discover that i didn’t update my .env with paystack details in production server (in deployment) as shown below. hope this help someone.
PAYSTACK_PUBLIC_KEY=xxxxxxxxxxxxxxxx PAYSTACK_SECRET_KEY=xxxxxxxxxxxxxxxxx PAYSTACK_PAYMENT_URL=https://api.paystack.co MERCHANT_EMAIL=unicodeveloper@gmail.com
You will most likely experience this issue on a live server. Here is how to fix
Explanation The reason you are seeing this error is due to the fact that you added Paystack details after publishing your website to a live server since .env is in gitignore file, it means that the changes you make are not tracked on the live server. So by removing .env from the gitignore file, the changes can now be tracked an effected. You can also decide to readd .env to gitignore after your changes take effect.
@Emmanuel96 and @nensok , I updated my packages using
composer update(this is after I added"unicodeveloper/laravel-paystack": "1.0.*"to my composer.json file of course) and it worked.Try that and let’s see
I assume you have already done the installation of the package and added
paystack.phpmanually and populatedconfig:app, with the provider and alliases to get this error, if not do so. now this is what worked for me:composer updateconfig:cacheand you are good to go