Guzzle is a problem in the site certificate or in the data entered?

Good afternoon, decided to connect to your site payment system Xsolla, everything is configured as it should, but an error occurs. To start php version: 5.6, json and curl connected. Script standard:
use Xsolla\SDK\API\XsollaClient;
use Xsolla\SDK\API\PaymentUI\TokenRequest;

$tokenRequest = new TokenRequest($projectId, $userId);
 ->setCustomParameters(array('key1' => 'value1', 'key2' => 'value2'));

$xsollaClient = XsollaClient::factory(array(
 'merchant_id' => 12312,//Here my data
 'api_key' => "1233sdawe12e"//Here my data
$token = $xsollaClient->createPaymentUITokenFromRequest($tokenRequest);

In the test displays an error:
Fatal error: Uncaught exception 'Guzzle\Http\Exception\ClientErrorResponseException' with message 'Client error response
[status code] 422
[reason phrase] Unprocessable Entity
[url]' in /var/www/user/data/www/site.EN/scripts/payment/Guzzle/Http/Exception/BadResponseException.php:43
Stack trace:
#0 /var/www/user/data/www/ Guzzle\Http\Exception\BadResponseException::factory(Object(Guzzle\Http\Message\EntityEnclosingRequest), Object(Guzzle\Http\Message\Response))
#1 [internal function]: Guzzle\Http\Message\Request::onRequestError(Object(Guzzle\Common\Event), 'request'.error', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#2 /var/www/user/data/www/ call_user_func(Array, Object(Guzzle\Common\Event), 'request'.error', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#3 in /var/www/user/data/www/ on line 46

How to solve this problem?
July 4th 19 at 22:47
1 answer
July 4th 19 at 22:49
The problem is not in php and not in the environment, and in these, IMHO.
If a parameter was passed in an incorrect format, the token cannot be issued. We will return a 422 HTTP code, in the JSON object in the response body will contain information about the error. The parameter "extended_message" we specify what parameters were passed incorrectly.


Find more questions by tags PHP