bolechen/gongmall-php-sdk

工猫(gongmall.com)sdk for php,非官方支持。基于官网文档:https://opendoc.gongmall.com 实现

v1.2.0 2023-07-06 01:06 UTC

README

Build Status StyleCI Packagist Downloads Packagist Version GitHub

工猫(gongmall.com)官网文档参见:https://opendoc.gongmall.com

  • Base on hanson/foundation-sdk
  • 仅实现了几个常用功能,如需要增加功能,可以参考 Employee.php 自行扩展,欢迎 PR

Installing

composer require bolechen/gongmall-php-sdk -vvv

Usage

<?php

$gongmall = new \Bolechen\Gongmall\Gongmall([
    'apiKey' => '',
    'apiSecret' => '',
    'contractUrl' => '', //电签网址

    'debug' => true, // 调试模式
    'sandbox' => true, //沙盒模式

    'log' => [
        'name' => 'gongmall',
        'file' => __DIR__.'/gongmall.log',
        'level'      => 'debug',
        'permission' => 0777,
    ]
]);

// 电签地址
$result = $gongmall->employee->getContractUrl(['name' => '张三', 'mobile' => 'xxx', 'idNumber' => 'xxx']);

// 查询电签结果
$result = $gongmall->employee->getContractStatus($array);

// 查询企业当前余额
$result = $gongmall->company->getBalance();

Test

composer test

License

The MIT License (MIT). Please see License File for more information.