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

Am geting this error what do I do

Open rextech03 opened this issue 7 years ago • 7 comments

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

rextech03 avatar Aug 09 '18 12:08 rextech03

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

sayopaul avatar Aug 30 '18 20:08 sayopaul

@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??

ghost avatar Apr 14 '19 02:04 ghost

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

kingzamzon avatar Dec 13 '19 17:12 kingzamzon

worked thanks

tope6217 avatar Oct 15 '20 02:10 tope6217

@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" }

jeffybanjo avatar Aug 05 '21 08:08 jeffybanjo

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.

Alben-cmd avatar Apr 20 '22 11:04 Alben-cmd

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

denis19ke avatar Dec 10 '23 06:12 denis19ke