From c54b2d0a7b90f14497a71e0265594cb145c0c8a9 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Wed, 11 Dec 2024 14:38:55 +0800 Subject: [PATCH] =?UTF-8?q?XML=E8=AF=B7=E6=B1=82=E6=95=B0=E6=8D=AExmlKey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/webService/ChinaTaxes.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/service/webService/ChinaTaxes.php b/app/service/webService/ChinaTaxes.php index 1de1446..58dbb79 100644 --- a/app/service/webService/ChinaTaxes.php +++ b/app/service/webService/ChinaTaxes.php @@ -28,6 +28,8 @@ class ChinaTaxes protected $xml = 1; // 申请发票信息 protected $invoiceIssuance; + // 加密XML名 + protected $xmlKey = '01'; /** * @throws FuncException @@ -313,6 +315,7 @@ class ChinaTaxes ]; $this->xmlType = 2; + $this->xmlKey = '07'; $param = $this->getParamData('SSGZ_GZPT_SZQKL_SFJYJK', $body); @@ -352,6 +355,7 @@ class ChinaTaxes ]; $this->xmlType = 2; + $this->xmlKey = '10'; $param = $this->getParamData('SSGZ_GZPT_SZQKL_SB_XNHGZ', $body); @@ -515,11 +519,15 @@ class ChinaTaxes */ protected function bizXml($body, int $type = 0): string { + $xmlKey = $this->xmlKey; $start = ' -'; - $start1 = ''; - $end = ''; + $start1 = ''; + $end = ''; + + $this->xmlKey = '01'; + $xml = ''; $xml2 = ''; foreach ($body as $key => $value) {