Error Message: Config must be an array or Collection
fdcore opened this issue · 2 comments
fdcore commented
Code
define('MERCHANT_ID', '***');
define('API_KEY', '***');
define('SECRET_KEY', '***');
define('PROJECT_ID', '***');
define('USER_ID', '***');
$tokenRequest = new TokenRequest(PROJECT_ID, MERCHANT_ID);
$tokenRequest->setUserEmail('email@example.com')
->setExternalPaymentId(12345)
->setSandboxMode(true)
->setUserName('USER_NAME')
->setCustomParameters(array('key1' => 'value1', 'key2' => 'value2'));
$xsollaClient = new XsollaClient(MERCHANT_ID, API_KEY);
$token = $xsollaClient->createPaymentUITokenFromRequest($tokenRequest);
Error
An uncaught Exception was encountered
Type: Guzzle\Common\Exception\InvalidArgumentException
Message: Config must be an array or Collection
Filename: /vendor/guzzle/guzzle/src/Guzzle/Http/Client.php
Line Number: 93
Backtrace:
File: /vendor/guzzle/guzzle/src/Guzzle/Http/Client.php
Line: 75
Function: setConfig
- guzzle/guzzle v3.9.3
- xsolla/xsolla-sdk-php v2.0.0
zakharovvi commented
Hi @fdcore
Please use factory
static method in XsollaClient
$client = XsollaClient::factory(array(
'merchant_id' => MERCHANT_ID,
'api_key' => API_KEY
));
I found wrong example with __construct
in our documentation http://developers.xsolla.com/#xsolla-php-sdk
We will fix it asap. Thank you.
fdcore commented
Thanks!