unicodeveloper / laravel-paystack

:credit_card: :package: :moneybag: Laravel 6, 7, 8, 9, 10 and 11 Package for Paystack
https://paystack.co
MIT License
605 stars 312 forks source link

Class 'Paystack' not found #52

Open samieaji opened 6 years ago

samieaji commented 6 years ago

Hi,

I followed the instructions for installation, but each time I try to pay, I get the error "Class 'Paystack' not found".

Also when I try to publish the configuration file, it doesn't publish it but says "Publishing complete."

I'm running Laravel 5.6.

Mercyware commented 6 years ago

Check that you have the right namespace

example use Unicodeveloper\Paystack\Paystack;

athousandklicks commented 6 years ago

I am getting the class 'Paystack' not found error, and this is happening in the form: The code snippet is seen below:

. . . {{-- required --}} . . .
codenaz commented 6 years ago

Specify the full paystack class path in the form input value

ichtrojan commented 6 years ago

better still return it as a variable while returning your view

On Sun, Jun 24, 2018 at 1:59 AM, Nwakwoke Patrick Nnaemeka < notifications@github.com> wrote:

Specify the full paystack class path in the form input value

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/unicodeveloper/laravel-paystack/issues/52#issuecomment-399720966, or mute the thread https://github.com/notifications/unsubscribe-auth/AFF21IYf0g3HO2Dlb8m3JzeOQSedEQJlks5t_uRXgaJpZM4T9vmN .

UmarAbdullahi commented 6 years ago

I had the same problem, all you need to do is go to config/app.php under providers add Unicodeveloper\Paystack\PaystackServiceProvider::class, add 'Paystack' => Unicodeveloper\Paystack\Facades\Paystack::class, to aliases then run php artisan vendor:publish --provider="Unicodeveloper\Paystack\PaystackServiceProvider" again.

frankly034 commented 6 years ago

I had same issue too, my problem was that paystack did not fully download to my project. Make sure its there and that the unicodeveloper folder is in the vendor's folder after installing the paystack from composer.

In Laravel 5.6 publish does not work, you'll have to add the provider and the alias in the config.app file manually.

taghwo commented 6 years ago

On laravel 5.6 you have to manually add the service to config and if after adding the service provider class and alias you still get the error,hit the config:cache artisan command it should work

mykinde commented 6 years ago

Client error: POST http://localhost/infyom-paystack/public/payment/transaction/initialize resulted in a 404 Not Found response:\n

transaction/initialize`

Test webhock URL -> is set to payement url

jgodstime commented 5 years ago

Am getting the same error Class 'Paystack' not found
in PaymentController.php (line 23) I have tried @UmarAbdullahi's suggestion but still getting the same error. I am using laravel 5.4. Please any fix for this?

aeadedoyin commented 5 years ago

So I just dropped a respone to @jgodstime Here

nonso07 commented 4 years ago

On laravel 5.6 you have to manually add the service to config and if after adding the service provider class and alias you still get the error,hit the config:cache artisan command it should work

wow thumb up sir, config:cache artisan command worked for my laravel 5.4

ShuleSoft commented 4 years ago

Try to run php artisan cache:clear