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

Class 'Paystack' not found

Open samieaji opened this issue 7 years ago • 12 comments

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.

samieaji avatar May 14 '18 12:05 samieaji

Check that you have the right namespace

example use Unicodeveloper\Paystack\Paystack;

Mercyware avatar May 19 '18 13:05 Mercyware

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

. . .
        <input type="hidden" name="reference" value="{{ Paystack::genTranxRef() }}"> {{-- required --}}

. . .

athousandklicks avatar Jun 24 '18 00:06 athousandklicks

Specify the full paystack class path in the form input value

codenaz avatar Jun 24 '18 00:06 codenaz

better still return it as a variable while returning your view

On Sun, Jun 24, 2018 at 1:59 AM, Nwakwoke Patrick Nnaemeka < [email protected]> 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 .

ichtrojan avatar Jun 24 '18 15:06 ichtrojan

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.

UmarAbdullahi avatar Jul 13 '18 17:07 UmarAbdullahi

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.

frankly034 avatar Aug 03 '18 20:08 frankly034

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

taghwo avatar Aug 22 '18 18:08 taghwo

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

mykinde avatar Aug 28 '18 13:08 mykinde

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?

jgodstime avatar Jan 10 '19 12:01 jgodstime

So I just dropped a respone to @jgodstime Here

aeadedoyin avatar Jan 10 '19 14:01 aeadedoyin

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

nonso07 avatar Mar 05 '20 00:03 nonso07

Try to run php artisan cache:clear

ShuleSoft avatar Apr 15 '20 15:04 ShuleSoft