Nexmo / nexmo-laravel

Add Vonage functionality such as SMS and voice calling to your Laravel app with this Laravel Service Provider.
MIT License
318 stars 79 forks source link

Issue with getting api_key/secret #2

Closed achrafkh closed 7 years ago

achrafkh commented 8 years ago

I had an issue after php artisan vendor:publish After adding The right credential to nexemo.php config file it keeps showing Bad credentials error

So i had to edit Vendor\Nexmo\Client\Credentials\Basic and change the variables $key and $secret with the credential string to make this work.

shouldnt this be something like this?

class Basic extends AbstractCredentials implements CredentialsInterface
{
    public function __construct($key, $secret)
    {
        $this->credentials['api_key'] = $key ?: config('nexmo.api_key');
        $this->credentials['api_secret'] = $secret ?: config('nexmo.api_secret');
    }
}
tjlytle commented 8 years ago

No, the API client itself isn't aware of Laravel specific configuration, the Laravel wrapper constructs the credential object here: https://github.com/Nexmo/nexmo-laravel/blob/master/src/NexmoServiceProvider.php#L35-L39

It's gotta be something I have wrong here: https://github.com/Nexmo/nexmo-laravel/blob/master/src/NexmoServiceProvider.php#L35-L39

Will check and updated.

achrafkh commented 8 years ago

yes, that makes sense , but what could be wrong with the service provider? could it be a minor change in the framework it self or my app?

tjlytle commented 8 years ago

@achrafkh I can't replicate the issue. A few questions, you mention nexemo.php, but I'm assuming that's a typo, as you'd get a missing nexmo configuration section error (not Bad Credentials).

Only way I get that error is with invalid credentials in the nexmo.php config file. Any chance there was a typo there?

leonardeveloper commented 6 years ago

I had an issue regarding with the API Credentials whereas I already used the given credentials then I got an error that says: "Please provide Nexmo API credentials. Possible combinations: api_key + api_secret, api_key + signature_secret, private_key + application_id, api_key + api_secret + private_key + application_id, api_key + signature_secret + private_key + application_id ".

Thing is I already added it on my .env and config/nexmo.php files.

mheap commented 6 years ago

Hey @leonardeveloper,

Could you open a new issue to help us investigate your issue?