fix
This commit is contained in:
parent
9233e287e4
commit
246da86c1b
45
src/AtolOnlineClient/AtolOnline.php
Normal file
45
src/AtolOnlineClient/AtolOnline.php
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace AtolOnlineClient;
|
||||||
|
|
||||||
|
use AtolOnlineClient\Configuration\Connection;
|
||||||
|
use AtolOnlineClient\Response\OperationResponse;
|
||||||
|
use JMS\Serializer\DeserializationContext;
|
||||||
|
use JMS\Serializer\SerializerBuilder;
|
||||||
|
|
||||||
|
class AtolOnline
|
||||||
|
{
|
||||||
|
|
||||||
|
private $serializer;
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->serializer = SerializerBuilder::create()->build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function createConfiguration()
|
||||||
|
{
|
||||||
|
return new Configuration();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function deserializeOperationResponse($response)
|
||||||
|
{
|
||||||
|
return $this->serializer->deserialize(
|
||||||
|
$response,
|
||||||
|
OperationResponse::class,
|
||||||
|
'json',
|
||||||
|
DeserializationContext::create()->setGroups(['post'])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $client
|
||||||
|
* @param Connection $connection
|
||||||
|
* @param $isDebug
|
||||||
|
* @return AtolOnlineApi
|
||||||
|
*/
|
||||||
|
public function getApi($client, Connection $connection, $isDebug)
|
||||||
|
{
|
||||||
|
return new AtolOnlineApi($client, $connection, $isDebug);
|
||||||
|
}
|
||||||
|
}
|
@ -42,11 +42,11 @@ class Configuration implements ConfigurationInterface
|
|||||||
$connection->login = $connectionItem['login'];
|
$connection->login = $connectionItem['login'];
|
||||||
$connection->pass = $connectionItem['pass'];
|
$connection->pass = $connectionItem['pass'];
|
||||||
$connection->group = $connectionItem['group'];
|
$connection->group = $connectionItem['group'];
|
||||||
$connection->legalEntity = $connectionItem['legalEntity'];
|
// $connection->legalEntity = $connectionItem['legalEntity'];
|
||||||
$connection->sno = $connectionItem['sno'];
|
$connection->sno = $connectionItem['sno'];
|
||||||
$connection->enabled = (bool) $connectionItem['enabled'];
|
$connection->enabled = (bool) $connectionItem['enabled'];
|
||||||
$connection->paymentTypes = $connectionItem['paymentTypes'];
|
// $connection->paymentTypes = $connectionItem['paymentTypes'];
|
||||||
$connection->paymentStatuses = $connectionItem['paymentStatuses'];
|
// $connection->paymentStatuses = $connectionItem['paymentStatuses'];
|
||||||
$connection->ofd = $connectionItem['ofd'];
|
$connection->ofd = $connectionItem['ofd'];
|
||||||
$connection->version = $connectionItem['version'];
|
$connection->version = $connectionItem['version'];
|
||||||
$this->connections[] = $connection;
|
$this->connections[] = $connection;
|
||||||
@ -143,4 +143,9 @@ class Configuration implements ConfigurationInterface
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function postLoadConfiguration()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user