作者 竞泽

alter:调整

/vendor/
... ...
... ... @@ -6,5 +6,8 @@ return [
'secret_key' => '12345678',
'company_cert_sn' => '20200000000652',
'sender_sn' => 'GEYOUSUOAI',
'receiver_sn' => 'KJPUBLICPT'
'receiver_sn' => 'KJPUBLICPT',
'client' => [
'timeout' => 30
]
];
... ...
... ... @@ -4,7 +4,6 @@
namespace Lackoxygen\GzCbec\Request;
use Lackoxygen\GzCbec\Contract\XMLInterface;
use Lackoxygen\GzCbec\Utils\Collection;
class CEBRequest extends Request implements XMLInterface
{
... ...
... ... @@ -64,7 +64,6 @@ class Packet
$xmlHead = sprintf(XML::DATA, $firstLabel, $this->request->getGuid(), $this->request->getVersion(),
$firstLabel);
$dataXml = $this->request->toXML($xmlHead);
file_put_contents('test.xml', $dataXml);
$data = base64_encode($dataXml);
$packet->setData($data);
}
... ... @@ -77,7 +76,7 @@ class Packet
}
/**
* @param $signXml
* @param string $signXml
*
* @return string
*/
... ...
... ... @@ -3,8 +3,6 @@
namespace Lackoxygen\GzCbec\Request\Report;
use Lackoxygen\GzCbec\Contract\RequestInterface;
use Lackoxygen\GzCbec\Contract\XMLInterface;
use Lackoxygen\GzCbec\Request\CEBRequest;
use Lackoxygen\GzCbec\Request\Report\Node\BaseTransfer;
use Lackoxygen\GzCbec\Request\Report\Node\Order;
... ...
... ... @@ -39,7 +39,6 @@ abstract class Request extends Collection implements RequestInterface
return \Str::uuid();
}
/**
* @return Packet
*/
... ...
... ... @@ -29,15 +29,15 @@ trait XML
* @param \SimpleXMLElement $xmlObj
* @param $key
* @param null $value
*
* @return \SimpleXMLElement
*/
protected function appendChildToXMl(\SimpleXMLElement $xmlObj, $key, $value = null): \SimpleXMLElement
{
if ($this instanceof XMLInterface) {
$key = $this->getFirstLabelPrefix() . ':' . $key;
}
if (is_null($value)) {
//$xmlObj->addChild($key);
} else {
if (!is_null($value)) {
$xmlObj->addChild($key, $value);
}
... ...
... ... @@ -15,6 +15,9 @@ class Signature
*/
protected $uri;
/**
* @var Client
*/
protected $client;
/**
... ... @@ -24,8 +27,9 @@ class Signature
*/
public function __construct(string $uri)
{
$clientConfig = config('gz-cbec.client');
$this->uri = $uri;
$this->client = new Client;
$this->client = new Client($clientConfig);
}
/**
... ... @@ -61,7 +65,7 @@ class Signature
}
} catch (\Throwable $throwable) {
}
file_put_contents('tran.xml', $content);
return $content;
}
}
... ...