...
|
...
|
@@ -47,16 +47,16 @@ class GuanYiCloud extends Api |
|
|
}
|
|
|
|
|
|
// 会员新增
|
|
|
function addVip()
|
|
|
function addVip($UnionID, $Nickname)
|
|
|
{
|
|
|
$data = array();
|
|
|
$data['appkey'] = APPKEY;
|
|
|
$data['sessionkey'] = SESSIONKEY;
|
|
|
$data['method'] = 'gy.erp.vip.add';
|
|
|
//会员代码
|
|
|
$data['code'] = 'bronettest111';
|
|
|
$data['code'] = $UnionID;
|
|
|
//会员名称
|
|
|
$data['name'] = '百荣测试会员新增';
|
|
|
$data['name'] = $Nickname;
|
|
|
//所属店铺
|
|
|
$data['shop_code'] = 'ZCZXCX';
|
|
|
//地址列表
|
...
|
...
|
@@ -65,17 +65,18 @@ class GuanYiCloud extends Api |
|
|
//名称
|
|
|
'name' => '地址',
|
|
|
//收货人
|
|
|
'receiver' => '收货人',
|
|
|
'receiver' => $Nickname,
|
|
|
//收获手机
|
|
|
'mobile' => 13292442918,
|
|
|
'mobile' => 18888888888,
|
|
|
//收货详细地址
|
|
|
'address' => '收货详细地址'
|
|
|
'address' => '中国'
|
|
|
);
|
|
|
$data['receive_infos'] = $receive_infos;
|
|
|
|
|
|
|
|
|
$data['sign'] = $this->sign($data, SECRET);
|
|
|
$this->success('成功', json_decode($this->mycurl(URL, $data)));
|
|
|
$Rult = json_decode(json_encode(json_decode($this->mycurl(URL, $data))), true);
|
|
|
if ($Rult['success'] == false) {
|
|
|
$this->error('失败');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//获取仓库信息
|
...
|
...
|
@@ -152,7 +153,7 @@ class GuanYiCloud extends Api |
|
|
|
|
|
|
|
|
//新增订单
|
|
|
function addOrder()
|
|
|
function addOrder($OrderSn, $OrderTime, $PayTime, $UnionID, $Name, $Mobile, $Address, $Province, $City, $District, $details, $Money, $PayOrder)
|
|
|
{
|
|
|
$data = array();
|
|
|
$data['appkey'] = APPKEY;
|
...
|
...
|
@@ -168,61 +169,64 @@ class GuanYiCloud extends Api |
|
|
$data['shop_code'] = 'ZCZXCX';
|
|
|
//未提供时,根据系统快递公司匹配规则自动分配快递公司,若内部服务调用超时,调用多次无果,相关项留空进行订单新增,调用结果按创建成功返回
|
|
|
// $data['express_code'] = 'sto';
|
|
|
$random_code = time(); //获取当前时间戳,以时间戳做平台单号可以防止重复,避免出错,此方式仅为测试
|
|
|
// $random_code = time(); //获取当前时间戳,以时间戳做平台单号可以防止重复,避免出错,此方式仅为测试
|
|
|
//平台单号
|
|
|
$data['platform_code'] = 'Brone1t81881';
|
|
|
$data['platform_code'] = $OrderSn;
|
|
|
//下单时间
|
|
|
$data['deal_datetime'] = '2020-12-01 14:39:23';
|
|
|
$data['deal_datetime'] = $OrderTime;
|
|
|
//支付时间
|
|
|
$data['pay_datetime'] = '2015-09-09 10:47:00';
|
|
|
$data['pay_datetime'] = $PayTime;
|
|
|
//会员代码
|
|
|
$data['vip_code'] = 'bronettest';
|
|
|
$data['vip_code'] = $UnionID;
|
|
|
//买家留言
|
|
|
$data['buyer_memo'] = '这是买家留言';
|
|
|
$data['buyer_memo'] = '';
|
|
|
//收货人
|
|
|
$data['receiver_name'] = '王叨叨';
|
|
|
$data['receiver_mobile'] = '13292442918';
|
|
|
$data['receiver_address'] = '鑫茂科技园F座412';
|
|
|
$data['receiver_province'] = '天津';
|
|
|
$data['receiver_city'] = '天津市';
|
|
|
$data['receiver_district'] = '南开区';
|
|
|
$details = array();
|
|
|
$details[] = array(
|
|
|
//商品代码
|
|
|
'item_code' => '4060250152',
|
|
|
//规格代码
|
|
|
// 'sku_code' => 'A002012',
|
|
|
//实际单价
|
|
|
'price' => 9.99,
|
|
|
//商品数量
|
|
|
'qty' => 2,
|
|
|
//0:未退款//1:退款完成//2:退款中
|
|
|
// 'refund' => 0
|
|
|
);
|
|
|
$data['receiver_name'] = $Name;
|
|
|
$data['receiver_mobile'] = $Mobile;
|
|
|
$data['receiver_address'] = $Address;
|
|
|
$data['receiver_province'] = $Province;
|
|
|
$data['receiver_city'] = $City;
|
|
|
$data['receiver_district'] = $District;
|
|
|
// $details = array();
|
|
|
// $details[] = array(
|
|
|
// //商品代码
|
|
|
// 'item_code' => $CoodsCode,
|
|
|
// //规格代码
|
|
|
//// 'sku_code' => 'A002012',
|
|
|
// //实际单价
|
|
|
// 'price' => $Price,
|
|
|
// //商品数量
|
|
|
// 'qty' => $Num,
|
|
|
// //0:未退款//1:退款完成//2:退款中
|
|
|
//// 'refund' => 0
|
|
|
// );
|
|
|
$data['details'] = $details;
|
|
|
$payments = array();
|
|
|
$payments[] = array(
|
|
|
//支付放视
|
|
|
'pay_type_code' => 'WechatPay',
|
|
|
//支付金额
|
|
|
'payment' => 22.03,
|
|
|
'payment' => $Money,
|
|
|
//交易号
|
|
|
'pay_code' => 9.99,
|
|
|
'pay_code' => $PayOrder,
|
|
|
//支付时间
|
|
|
'paytime' => $random_code * 1000
|
|
|
'paytime' => $PayTime
|
|
|
);
|
|
|
$data['payments'] = $payments;
|
|
|
$invoices = array();
|
|
|
$invoices[] = array(
|
|
|
//发票部分
|
|
|
'invoice_type' => 1,
|
|
|
'invoice_title' => '上海管易云计算软件有限公司kkkkk',
|
|
|
'invoice_content' => '明细',
|
|
|
'invoice_amount' => '88.90'
|
|
|
'invoice_title' => '个人',
|
|
|
// 'invoice_content' => '明细',
|
|
|
// 'invoice_amount' => '88.90'
|
|
|
);
|
|
|
$data['invoices'] = $invoices;
|
|
|
$data['sign'] = $this->sign($data, SECRET);
|
|
|
echo 'response: ' . $this->mycurl(URL, $data);
|
|
|
$Rult = json_decode(json_encode(json_decode($this->mycurl(URL, $data))), true);
|
|
|
if ($Rult['success'] == false) {
|
|
|
$this->error('失败');
|
|
|
}
|
|
|
// $Array = json_decode(json_encode(json_decode($this->mycurl(URL, $data))), true);
|
|
|
//订单单据编号
|
|
|
//SO285064111288
|
...
|
...
|
|