Open rextech03 opened 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
@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??
I just replaced this line
'secretKey' => getenv('PAYSTACK_SECRET_KEY'),
with
'secretKey' => 'paystack_secret_key',
worked thanks
@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" }
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.
Client error: POST https://api.paystack.co/transaction/initialize resulted in a 403 Forbidden how do you solve this
Client error:
POST https://api.paystack.co/transaction/initialize
resulted in a401 Unauthorized
response: { "status": false, "message": "Invalid key" }