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

Am geting this error what do I do #55

Open rextech03 opened 6 years ago

rextech03 commented 6 years ago

Client error: POST https://api.paystack.co/transaction/initialize resulted in a 401 Unauthorized response: { "status": false, "message": "Invalid key" }

sayopaul commented 6 years ago

Hey there . Please ensure that you have set your public key and secret key in your .env file

PAYSTACK_PUBLIC_KEY=xxxxxxxxxxxxx PAYSTACK_SECRET_KEY=xxxxxxxxxxxxx

replace xxxxxxxxxxxxx with the appropriate key

ghost commented 5 years ago

@rextech03 Please, how did you solve this error? Am getting a similar error
Client error: POST https://api.paystack.co/transaction/initialize resulted in a 401 Unauthorized response: { "status": false, "message": "Invalid key" } and @sayopaul the problem is not with the .env file, I have done this processed and I crosschecked it several times. Any suggestion??

kingzamzon commented 4 years ago

I just replaced this line 'secretKey' => getenv('PAYSTACK_SECRET_KEY'), with 'secretKey' => 'paystack_secret_key',

tope6217 commented 3 years ago

worked thanks

jeffybanjo commented 3 years ago

@kingzamzon where exactly did you change those lines. I have similar issue using paystack,net.sdk and am certain the key is correct cause am using same for testing with others methods(xamarin), but this keeps showing Client error: POST https://api.paystack.co/transaction/initialize resulted in a 401 Unauthorized response: { "status": false, "message": "Invalid key" }

Alben-cmd commented 2 years ago

Was having the same issue. had to double-check the public key and secret key in my .env file. The public key starts with PK while the secret key starts with SK

PAYSTACK_PUBLIC_KEY=pk_test_xxxxxxxxxxxxx PAYSTACK_SECRET_KEY=sk_test_xxxxxxxxxxxxx

Don't forget to clear the cache files.

denis19ke commented 9 months ago

Client error: POST https://api.paystack.co/transaction/initialize resulted in a 403 Forbidden how do you solve this