accessToken = new AccessToken([ 'access_key' => ACCESS_KEY, 'secret_key' => SECRET_KEY, ]); $this->factory = Factory::setAccessToken($this->accessToken); $res = $this->factory->invoice()->getCategory(); var_dump($res); } public function testCategoryUser() { $this->accessToken = new AccessToken([ 'access_key' => ACCESS_KEY, 'secret_key' => SECRET_KEY, ]); $this->factory = Factory::setAccessToken($this->accessToken); $res = $this->factory->invoice()->getCategoryUser(); var_dump($res); } public function testgetInvoiceInfo() { $this->accessToken = new AccessToken([ 'access_key' => ACCESS_KEY, 'secret_key' => SECRET_KEY, ]); $this->factory = Factory::setAccessToken($this->accessToken); $res = $this->factory->invoice()->getInvoiceInfo('23612000000028265987'); var_dump($res); } public function testdownloadInvoice() { $this->accessToken = new AccessToken([ 'access_key' => ACCESS_KEY, 'secret_key' => SECRET_KEY, ]); $this->factory = Factory::setAccessToken($this->accessToken); $res = $this->factory->invoice()->downloadInvoice('23612000000028265987'); var_dump($res); } public function testinvoiceIssuance() { $this->accessToken = new AccessToken([ 'access_key' => ACCESS_KEY, 'secret_key' => SECRET_KEY, ]); $this->factory = Factory::setAccessToken($this->accessToken); $option = new InvoiceIssuanceOption(); $option->setDataToGoods([ [ 'storeName' => '多商户', 'unitPrice' => '10', 'num' => '1', 'cateId' => 10 ] ]); $option->taxId = ''; $option->bankName = ''; $res = $this->factory->invoice()->invoiceIssuance($option); var_dump($res); } }