PHP code example of ybjd / erppush

1. Go to this page and download the library: Download ybjd/erppush 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/ */

    

ybjd / erppush example snippets


use Erppush\Erppush;

$erpPush = new Erppush([
    'username'  => 'test',//账号名
    'password'  => 'test',//密码
    'signKey'   => 'db8ebff65c0c5050299dc2bo8a141e5f',//接口密钥
    'checkSign' => 1,//是否启动验签 0否 1是
]);
try {
    //订单推送示例
    $order = array(
        0 => array(
            'order_no'    => '202004261802062000',//订单编号
            'goods_sku'   => 'S00214140-1',//商品编码
            'goods_name'  => '商品1',//商品名称
            'goods_nums'  => 1,//购买数量
            'remarks'     => '备注1',//备注
            'accept_name' => '张三',//收货人
            'telphone'    => '13025898958',//收货人联系电话
            'province'    => '广东省',//收货人所在省
            'city'        => '深圳市',//收货人所在市
            'area'        => '龙华区',//收货人所在区
            'address'     => '龙华街道油富商城',//收货人详细地址
        ),
        1 => array(
            'order_no'    => '202004261802062000',
            'goods_sku'   => 'S00214140-2',
            'goods_name'  => '商品2',
            'goods_nums'  => 1,
            'remarks'     => '备注2',
            'accept_name' => '张三',
            'telphone'    => '13025898958',
            'province'    => '广东省',
            'city'        => '深圳市',
            'area'        => '龙华区',
            'address'     => '龙华街道油富商城',
        ),
        2 => array(
            'order_no'    => '202004261802062001',
            'goods_sku'   => 'S00214140-3',
            'goods_name'  => '商品3',
            'goods_nums'  => 1,
            'remarks'     => '备注3',
            'accept_name' => '张三3',
            'telphone'    => '130258989583',
            'province'    => '广东省3',
            'city'        => '深圳市3',
            'area'        => '龙华区3',
            'address'     => '龙华街道油富商城3',
        ),
    );
    $res = $erpPush->pushOrder($order);
  
}catch (\Exception $e) {
    echo $e->getCode().'='.$e->getMessage();die;
}