PHP code example of jmcc / digiwin_e10_api

1. Go to this page and download the library: Download jmcc/digiwin_e10_api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jmcc / digiwin_e10_api example snippets






return [
    // E10 集成服务主机地址或 IP,用于 digi-service.ip
    'host' => env('ERP_HOST', '127.0.0.1'),

    // E10 API 基础地址,用于 Guzzle base_uri
    'uri' => env('ERP_URI', 'http://127.0.0.1/'),

    // 调用端版本号,用于 digi-host.ver
    'ver' => env('ERP_VER', '1.0'),

    // 调用端产品标识,用于 digi-host.prod
    'prod' => env('ERP_PROD', 'APP'),

    // E10 集成服务 ID,用于 digi-service.id
    'service' => env('ERP_SERVICE_ID', ''),

    // E10 账套,用于 digi-host.acct
    'acct' => env('ERP_ACCT', ''),
];

use App\Api\E10Client;

$client = new E10Client();

$result = $client->httpPostJson(
    '/api/path',
    [
        'field' => 'value',
    ],
    [
        'name' => 'service-name',
    ]
);