yabacon / paystack-php

A PHP Wrapper for Paystack API - https://www.paystack.com
MIT License
109 stars 70 forks source link

Verification fails for test keys #18

Closed idoqo closed 6 years ago

idoqo commented 6 years ago

I keep getting an InvalidArgumentException: A Valid Paystack Secret Key must start with 'sk_'. which seems to be happening because Paystack's test keys begin with 'pk' instead.

Maybe we could update the checker code in the Paystack() constructor or find a better way to check for valid keys.

Steps to repeat: (Describe how the issue can be repeated by someone who is to work on it)

  1. Generate a test key from paystack dashboard.
  2. Attempt to pass test key as a parameter to the constructor.
ezra-obiwale commented 6 years ago

I know this has been closed but since no reason was given for those who may stumble on this in future, here:

Paystack has public and secret test keys. The public key begins with pk_ while the secret key begins with sk_. Use the appropriate key and all will be will, be it in test mode or live.

9024d6d8-1db6-4594-b01b-3ec1325ca17b

jgodstime commented 4 years ago

composer dumpautoload -o

then clear Laravel config cache

It worked for me