PHPackages                             xinmoumomo/invoice - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. xinmoumomo/invoice

ActiveLibrary[API Development](/categories/api)

xinmoumomo/invoice
==================

上海航天信息电子发票对接平台

v1.0.0.x-dev(5y ago)03MITPHPPHP &gt;=7.2.0

Since Oct 13Pushed 5y ago1 watchersCompare

[ Source](https://github.com/xinmoumomo/invoice)[ Packagist](https://packagist.org/packages/xinmoumomo/invoice)[ RSS](/packages/xinmoumomo-invoice/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (2)Used By (0)

invoice
=======

[](#invoice)

desc
----

[](#desc)

上海航天电子发票对接平台，PHP版本的SDK

安装
--

[](#安装)

```
composer require xinmoumomo/invoice

```

#### 发布配置

[](#发布配置)

如果您希望覆盖存储库和条件所在的路径,请发布配置文件:

```
php artisan vendor:publish
```

然后只需打开 `config/invoice.php` 并编辑即可！

#### 配置文件

[](#配置文件)

```
return [
    // 电商平台编码
    'DSPTBM' => 'P1000001',
    // 纳税人识别码
    'NSRSBH' => '913101010000000090',
    // 纳税人名称
    'NSRMC' => 'XXX官方旗舰店',
    // 销货方名称
    'XHFMC' => 'XXX官方旗舰店',
    // 销货方地址
    'XHF_DZ' => '上海市徐汇区XXX号',
    // 销货方电话
    'XHF_DH' => '17621251***',
    // 销货方银行账号
    'XHF_YHZH' => 'XX支行    87878787878788787878787',
    // 开票员
    'KPY' => '开票员',
    // 收款员（可选）
    'SKY' => '收款员',
    //'复核员'
    'FHR' => '复核员',
    // 含税标志
    'HSBZ' => '0',
    // 终端类型标识
    'TERMINALCODE' => '0',
    // APPID
    'APPID' => 'ZZS_PT_DZFP',
    // 税号
    'TAXPAYWERID' => '913101010000000090',
    // 认证码
    'AUTHORIZATIONCODE' => 'NH873FG4KW',
    // 加密码
    'ENCRYPTCODE' => '2',
    // 发票开具 ECXML.FPKJ.BC.E_INV
    'INTERFACE_FPKJ' => 'ECXML.FPKJ.BC.E_INV',
    // 发票信息下载 ECXML.FPXZ.CX.E_INV
    'INTERFACE_FPXZ' => 'ECXML.FPXZ.CX.E_INV',
    // 邮箱发票推送 ECXML.EMAILPHONEFPTS.TS.E.INV
    'INTERFACE_FPYX' => 'ECXML.EMAILPHONEFPTS.TS.E.INV',
    // 请求码
    'REQUESTCODE' => 'sdf11dfd1MsfdFWegesdfIK',
    // 响应码
    'RESPONSECODE' => '121',
    // 密码
    'PASSWORD' => '',
    // 交互码
    'DATAEXCHANGEID' => '交互码',
    // 发票明细信息下载 ECXML.FPKJ.BC.E_INV
    'KJFP' => 'ECXML.FPKJ.BC.E_INV',
    // 发票信息推送 ECXML.FPXZ.CX.E_INV
    'DOWNLOAD' => 'ECXML.FPXZ.CX.E_INV',
    // 获取企业可用发票数量API ECXML.EMAILPHONEFPTS.TS.E.INV
    'EMAIL' => 'ECXML.EMAILPHONEFPTS.TS.E.INV',
    // 注册码
    'REGISTERCODE' => '922588450019',
    // 电子发票网址
    'HOST' => 'http://xxxxx',
    // 3DES密码
    'KEY' => '*************',
];

```

用法
--

[](#用法)

```
          public static function info($order_ids, &$post_data, $no)
          {
              return [
                  'invoice_type'  => '01',
                  'invoice_title' => '测试发票单',
                  'items' => [
                      [
                          'name' => '治疗',  //项目名称
                          'quantity' => '1',
                          'price' => '100', //项目单价
                          'spbm' => '0000101000000000000', //商品编码 填商品名称对应的商品税收分类编码，19位不足补0
                          'zxbm' => '',    //自行编码
                          'id' => '',      //有折扣时自行编码取值
                          'sl' => '0.06',      //税率
                          'hsbz' => '0',      //含税标志
                          //是否享受优惠政策
                          'yhzcbs' => $yhzcbs ?? "",
                          //优惠政策类型
                          'zzstsgl' => $zzstsgl ?? '',
                          //零税率标识
                          'lslbs' => $lslab ?? '',
                      ],
                  ],
                  'discount' => '',
                  'mobile'   => config('invoice')['XHF_DH'],
                  // 价税合计金额
                  'sum' => '',
                  //订单号
                  'order_bn' => $no,
                  //请求流水号
                  'FPQQLSH' => $no,
                  //商品信息中第一条
                  'KPXM' => 'sfd',
                  //购货方名称
                  'GHFMC' => $company,
                  // 购货方手机
                  'GHF_SJ' => $contact_mobile,
                  // nor_code
                  'GHF_NSRSBH' => $nor_code,
                  // 购货方企业类型
                  'GHFQYLX' => '01',
                  // 开票类型  1 正票 2 红票
                  'KPLX' => ($type == 'main_ticket') ? 1 : 2,
                  // 操作代码
                  'CZDM' => ($type == 'main_ticket') ? 10 : 20,
                  // 合计不含税金额
                  'HJBHSJE' => '',
                  // 合计税额
                  'HJSE' => '',
                  // 请求流水号
                  'trade_no' => $invoice->no,
                  // 价税合计金额
                  'KPHJJE' => '',
                  // 购货方，银行账户
                  'GHF_YHZH' => !empty($invoice->bank_number) ? ($invoice->bank_number)['bank_name'] . ' ' . ($invoice->bank_number)['bank_account'] : '',
                  // 购货方 固定电话
                  'GHF_GDDH' => !empty($invoice->address_mobile) ? ($invoice->address_mobile)['mobile'] : '',
                  // 购货方地址
                  'GHF_DZ' => !empty($invoice->address_mobile) ? ($invoice->address_mobile)['address'] : '',
                  // 发票代码
                  'YFP_DM' => $invoice->invoice_code,
                  // 发票编号
                  'YFP_HM' => $invoice->invoice_no,
              ];
          }

```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2088d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/59594ae789dafc02a9e6149d3b627b46047f768b94778267b81ffcc0329a327b?d=identicon)[hcxinmou](/maintainers/hcxinmou)

---

Top Contributors

[![xinmoumomo](https://avatars.githubusercontent.com/u/48463164?v=4)](https://github.com/xinmoumomo "xinmoumomo (11 commits)")

### Embed Badge

![Health badge](/badges/xinmoumomo-invoice/health.svg)

```
[![Health](https://phpackages.com/badges/xinmoumomo-invoice/health.svg)](https://phpackages.com/packages/xinmoumomo-invoice)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M186](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M129](/packages/roots-acorn)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React/Svelte) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

4925.3k](/packages/erag-laravel-lang-sync-inertia)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
