Closed gigalabs18 closed 3 years ago
What Plaid API version are you using? Can you add a try... catch
around the the createLinkToken
call and send the contents of: \dd($exception->getResponse())
?
For example:
try {
$item = $plaid->createLinkToken('name of user', 'es', ['US'],'unique_user_id',[]);
} catch ( PlaidRequestException $exception) {
\dd($exception->getResponse());
}
What Plaid API version are you using? Can you add a
try... catch
around the thecreateLinkToken
call and send the contents of:\dd($exception->getResponse())
?For example:
try { $item = $plaid->createLinkToken('name of user', 'es', ['US'],'unique_user_id',[]); } catch ( PlaidRequestException $exception) { \dd($exception->getResponse()); }
i am using 0.14.0 version and it generate an error now bad request error image : https://ibb.co/4RjDYnm by default it install 0.14.0 version by "composer require tomorrow-ideas/plaid-sdk-php" and should i update version?
Sounds like you are on PHP 7.2 and are locked into the 0.14 release. Can you send the contents of:
try {
$item = $plaid->createLinkToken('name of user', 'es', ['US'],'unique_user_id',[]);
} catch ( PlaidRequestException $exception) {
\dd($exception->getResponse());
}
To know exactly what the issue is, I need to see the error being returned by Plaid.
Sounds like you are on PHP 7.2 and are locked into the 0.14 release. Can you send the contents of:
try { $item = $plaid->createLinkToken('name of user', 'es', ['US'],'unique_user_id',[]); } catch ( PlaidRequestException $exception) { \dd($exception->getResponse()); }
To know exactly what the issue is, I need to see the error being returned by Plaid.
<?php
namespace App\Http\Controllers\API;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Http\Controllers\API\BaseController as BaseController;
use TomorrowIdeas\Plaid\Plaid;
class PlaidController extends BaseController
{
public function auth() {
$clientId = "***********************";
$secretKey = "**************************";
$env = "development";
$plaid = new Plaid(
$clientId,
$secretKey,
$env
);
try {
$item = $plaid->createLinkToken('hassan shafique', 'es', ['US'],'1',["auth"]);
} catch ( PlaidRequestException $exception) {
return dd($exception->getResponse());
}
return $this->sendSuccessResponse('item', $item, 'item created successfully!');
}
}
error : https://ibb.co/4RjDYnm error Log:
local.ERROR: Bad Request {"userId":1,"email":"admin@gmail.com","exception":"[object] (TomorrowIdeas\\Plaid\\PlaidRequestException(code: 400): Bad Request at /var/www/html/plaid/vendor/tomorrow-ideas/plaid-sdk-php/src/Plaid.php:205
)
The issue is you are referencing the current master documentation which is drastically different than the version you are on (version 0.14). Your constructor parameters are incorrect. For version 0.14, you need to either include your public key
or set it to null in the constructor. For example:
$plaid = new Plaid(
$client_id,
$client_secret,
null,
"development"
);
Or you can upgrade your PHP version to at least 7.3 and update the SDK to the 1.x version.
Yes i upgrade php and package version now it is running perfectly.
I am using this package(0.14.0) wrapper in php framework (laravel) as below.
it return me an error as TomorrowIdeas \ Plaid \ PlaidRequestException (400) Bad Request don't why although clientId, secret is correct.