buqiu/invoice

诺诺开放平台
1,934 8
Install
composer require buqiu/invoice
Latest Version:v3.0.5
PHP:>=8.1.0|>=7.3
License:MIT
Last Updated:Sep 14, 2023
Links: GitHub  ·  Packagist
Maintainer: buqiu

invoice

desc

诺诺发票开放平台,PHP版本的SDK

安装

composer require buqiu/invoice
发布配置

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

php artisan vendor:publish

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

如果你想使用 Facade
在 config\app.php 找到 providers 数组,添加刚创建的类
Buqiu\Invoice\InvoiceProvider::class
在 config\app.php 找到 aliaes 数组,添加刚创建的类
'InvoiceSdkFacade' =>   Buqiu\Invoice\Facades\InvoiceSdkFacade::class
配置文件
return [
    // 开放平台appKey
    'app_key' => '',
    // 开放平台appSecret
    'app_secret' => '',
    // 临时授权码
    'code' => '',
    // 授权商户税号
    'tax_num' => '',
    // 授权回调地址
    'redirect_uri' => '',
    // 环境 沙箱环境https://sandbox.nuonuocs.cn/open/v1/services 正式环境https://sdk.nuonuo.com/open/v1/services
    'url' => '',
    // 开票回调地址
    'call_back_url' => '',
    // 销方电话
    'saler_tel' => '',
    // 销方地址
    'saler_address' => '',
    // 销方银行开户行及账号(二手车销售统一发票时必填)
    'saler_account' => '',
    // 复核人
    'checker' => '',
    // 收款人
    'payee' => '',
    // 部门门店id(诺诺系统中的id)
    'department_id' => '',
    // 开票员id
    'clerk_id' => '',
    // 开票员(全电发票时需要传入和开票登录账号对应的开票员姓名)
    'clerk' => '',
    // 是否机动车销售统一发票
    'is_vehicle' => '0',
    // 开具二手车销售统一发票才需要传
    'is_second_hand_car' => '0',
];

用法

    public function api()
    {
        $invoiceSdk = new InvoiceSDK(config('invoice'));
        $token = $invoiceSdk->getMerchantToken();// 访问令牌
        // API方法名 :
        // nuonuo.ElectronInvoice.requestBillingNew 开具发票
        // nuonuo.ElectronInvoice.queryInvoiceResult 获取发票结果
        $method = "nuonuo.ElectronInvoice.queryInvoiceResult";
        $body = $invoiceSdk->getBody($params,$method); // 获取过滤参数
        $senid = "唯一标识,32位随机码";

        $res = $invoiceSdk->sendPostSyncRequest($senid, $token->access_token, $method, $body);

        return $res;
    }

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

637,827,751 9,703
laravel/framework

The Laravel Framework.

589,172,971 34,950
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

413,412,504 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

394,964,158 4,660

Version History

Version Released PHP Laravel License
v3.0.5 >=8.1.0|>=7.3 ^5.7|^5.8|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0 MIT
v2.0.3 >=8.1.0 ^8.0|^9.0|^10.0|^11.0|^12.0 MIT
v2.0.2 >=8.1.0 ^8.0|^9.0 MIT
v2.0.1 >=8.1.0 ^8.0|^9.0 MIT
v2.0.0 >=8.1.0 ^8.0|^9.0 MIT