1 Star 0 Fork 3

wanggn / 高灯电子发票Go SDK

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

gaodeng

用Go封装了高灯电子发票SDK。

简介

  • 支持全局配置AppKeyAppSecret
  • 全部参数和返回值均使用struct类型传递,而不是map类型。
  • 调用时,按struct传入参数,内部自动将其转换为原生SDK支持的map类型。
  • 返回时,先按通用类型解析:
    • 异常时,记录日志;
    • 正常后,仅返回业务部分数据(即data部分)的字节流,需要在具体的业务内转为对应的struct类型。

代码简介

  • constant.go:常数定义。
  • model.go:通用返回类型定义。
  • config.go:HTTP请求客户端的环境配置。
  • client.go:HTTP请求客户端。
  • gd_*.go:相关的业务接口。
  • gd_*_test.go:业务接口对应的单元测试类。

接口

  • gd_invoice_blue.go:发票开具接口。
  • gd_invoice_blue_callback.go:发票开具的异步通知信息。
  • gd_invoice_red.go:发票冲红接口(批量查询,但一次最多20张)。
  • gd_invoice_status.go:查询发票信息接口(单张发票的查询)。
  • gd_invoice_amount.go:查询发票余量接口。
  • gd_invoice_verify.go:发票查验接口。
  • gd_send_email.go:邮件发送接口。
  • gd_send_email_query.go:邮件发送查询接口。

测试

需要跟高灯的商务人员,获取测试账号,然后在环境变量中,添加client_test.go中需要的测试变量:

export GDTestAppKey=xxxxxxxx
export GDTestAppSecret=xxxxxxxx
export GDTestTaxPayerNumber=xxxxxxxx
export GDTestSellerName=xxxxxxxx
export GDTestSellerAddress=xxxxxxxx
export GDTestEmail=xxxxxxxx

然后直接运行:

go test

资料

MIT License Copyright (c) 2019 XiaochengTech Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

高灯电子发票的Go SDK封装。 展开 收起
Go
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Go
1
https://gitee.com/wanggn/gaodeng.git
git@gitee.com:wanggn/gaodeng.git
wanggn
gaodeng
高灯电子发票Go SDK
master

搜索帮助