|
|
@@ -22,158 +22,86 @@ class ExpressClass extends BaseClass
|
|
|
|
|
|
$orderId = $params['orderId'];
|
|
|
$openId = $params['openId'];
|
|
|
- //暂时只支持顺丰
|
|
|
- $deliveryId = 'SF';
|
|
|
+ $deliveryId = $params['deliveryId'];
|
|
|
$bizId = $params['bizId'];
|
|
|
- $customRemark = '鲜花';
|
|
|
- $sender = $params['sender'];
|
|
|
- $receiver = $params['receiver'];
|
|
|
- $shop = $params['shop'];
|
|
|
- $cargo = $params['cargo'];
|
|
|
- $insured = $params['insured'];
|
|
|
- $service = $params['service'];
|
|
|
- $expectTime = $params['expectTime'];
|
|
|
- $sender = $params['sender'];
|
|
|
- $receiver = $params['receiver'];
|
|
|
- $shop = $params['shop'];
|
|
|
- $cargo = $params['cargo'];
|
|
|
- $insured = $params['insured'];
|
|
|
- $service = $params['service'];
|
|
|
- $expectTime = $params['expectTime'];
|
|
|
-
|
|
|
- $sender = [
|
|
|
- 'name' => $params['sender']['name'],
|
|
|
- 'tel' => $params['sender']['tel'],
|
|
|
- 'mobile' => $params['sender']['mobile'],
|
|
|
- 'company' => $params['sender']['company'],
|
|
|
- 'post_code' => $params['sender']['post_code'],
|
|
|
- ];
|
|
|
-
|
|
|
- $receiver = [
|
|
|
- 'name' => $params['receiver']['name'],
|
|
|
- 'tel' => $params['receiver']['tel'],
|
|
|
- 'mobile' => $params['receiver']['mobile'],
|
|
|
- 'company' => $params['receiver']['company'],
|
|
|
- 'post_code' => $params['receiver']['post_code'],
|
|
|
- ];
|
|
|
-
|
|
|
- $shop = [
|
|
|
- 'wxa_path' => $params['shop']['wxa_path'],
|
|
|
- 'img_url' => $params['shop']['img_url'],
|
|
|
- 'goods_name' => $params['shop']['goods_name'],
|
|
|
- 'goods_count' => $params['shop']['goods_count'],
|
|
|
- 'goods_price' => $params['shop']['goods_price'],
|
|
|
- ];
|
|
|
-
|
|
|
- $cargo = [
|
|
|
- 'count' => $params['cargo']['count'],
|
|
|
- 'weight' => $params['cargo']['weight'],
|
|
|
- 'space_x' => $params['cargo']['space_x'],
|
|
|
- 'space_y' => $params['cargo']['space_y'],
|
|
|
- 'space_z' => $params['cargo']['space_z'],
|
|
|
- ];
|
|
|
-
|
|
|
- $cargoDetailList = [
|
|
|
- 'name' => $params['cargo']['name'],
|
|
|
- 'count' => $params['cargo']['count'],
|
|
|
- ];
|
|
|
-
|
|
|
- $cargo = [
|
|
|
- 'count' => $params['cargo']['count'],
|
|
|
- 'weight' => $params['cargo']['weight'],
|
|
|
- 'space_x' => $params['cargo']['space_x'],
|
|
|
- 'space_y' => $params['cargo']['space_y'],
|
|
|
- 'space_z' => $params['cargo']['space_z'],
|
|
|
- 'detail_list' => $cargoDetailList,
|
|
|
- ];
|
|
|
-
|
|
|
- $service = [
|
|
|
- 'service_type' => $params['service']['service_type'],
|
|
|
- 'service_name' => $params['service']['service_name'],
|
|
|
- ];
|
|
|
-
|
|
|
- $insured = [
|
|
|
- 'use_insured' => $params['insured']['use_insured'],
|
|
|
- 'insured_value' => $params['insured']['insured_value'],
|
|
|
- ];
|
|
|
-
|
|
|
+ $customRemark = $params['customRemark'];
|
|
|
+ $senderName = $params['senderName'];
|
|
|
+ $senderMobile = $params['senderMobile'];
|
|
|
+ $senderProvince = $params['senderProvince'];
|
|
|
+ $senderCity = $params['senderCity'];
|
|
|
+ $senderAddress = $params['senderAddress'];
|
|
|
+ $receiverName = $params['receiverName'];
|
|
|
+ $receiverMobile = $params['receiverMobile'];
|
|
|
+ $receiverProvince = $params['receiverProvince'];
|
|
|
+ $receiverCity = $params['receiverCity'];
|
|
|
+ $receiverAddress = $params['receiverAddress'];
|
|
|
+ $goodsCount = $params['goodsCount'];
|
|
|
+ $goodsName = $params['goodsName'];
|
|
|
+ $weight = $params['weight'];
|
|
|
+ $height = $params['height'];
|
|
|
+ $length = $params['length'];
|
|
|
+ $width = $params['width'];
|
|
|
+ $packageNum = $params['packageNum'];
|
|
|
+ $serviceType = $params['serviceType'];
|
|
|
+ $serviceName = $params['serviceName'];
|
|
|
|
|
|
$data = [
|
|
|
// 订单信息
|
|
|
- 'order_id' => $orderId, // 商家订单ID,需唯一【必填】
|
|
|
- 'openid' => $openId, // 用户openid【必填】
|
|
|
- 'delivery_id' => $deliveryId, // 快递公司ID【必填】
|
|
|
- 'biz_id' => $bizId, // 快递公司客户编码或月结账号【必填】
|
|
|
- 'custom_remark' => $customRemark, // 备注【选填】
|
|
|
-
|
|
|
+ 'order_id' => $orderId, // 商家订单ID,需唯一
|
|
|
+ 'openid' => $openId, // 用户openid
|
|
|
+ 'delivery_id' => $deliveryId, // 快递公司ID
|
|
|
+ 'biz_id' => $bizId, // 快递公司客户编码或月结账号
|
|
|
+ 'custom_remark' => $customRemark, // 备注
|
|
|
+ //0表示已事先约定取件时间;否则请传预期揽件时间戳,需大于当前时间
|
|
|
+ 'expect_time' => 0,
|
|
|
// 发件人信息
|
|
|
'sender' => [
|
|
|
- 'name' => '', // 发件人姓名【必填】
|
|
|
- 'tel' => '', // 发件人电话【必填】
|
|
|
- 'mobile' => '', // 发件人手机号【必填】
|
|
|
- 'company' => '', // 发件人公司【选填】
|
|
|
- 'post_code' => '', // 发件人邮编【选填】
|
|
|
- 'country' => '', // 发件人国家【选填】
|
|
|
- 'province' => '', // 发件人省份【必填】
|
|
|
- 'city' => '', // 发件人城市【必填】
|
|
|
- 'area' => '', // 发件人区/县【必填】
|
|
|
- 'address' => '', // 发件人详细地址【必填】
|
|
|
+ 'name' => $senderName, // 发件人姓名
|
|
|
+ 'mobile' => $senderMobile, // 发件人手机号
|
|
|
+ 'province' => $senderProvince, // 发件人省份
|
|
|
+ 'city' => $senderCity, // 发件人城市
|
|
|
+ 'address' => $senderAddress, // 发件人详细地址
|
|
|
],
|
|
|
-
|
|
|
+
|
|
|
// 收件人信息
|
|
|
'receiver' => [
|
|
|
- 'name' => '', // 收件人姓名【必填】
|
|
|
- 'tel' => '', // 收件人电话【必填】
|
|
|
- 'mobile' => '', // 收件人手机号【必填】
|
|
|
- 'company' => '', // 收件人公司【选填】
|
|
|
- 'post_code' => '', // 收件人邮编【选填】
|
|
|
- 'country' => '', // 收件人国家【选填】
|
|
|
- 'province' => '', // 收件人省份【必填】
|
|
|
- 'city' => '', // 收件人城市【必填】
|
|
|
- 'area' => '', // 收件人区/县【必填】
|
|
|
- 'address' => '', // 收件人详细地址【必填】
|
|
|
+ 'name' => $receiverName, // 收件人姓名
|
|
|
+ 'mobile' => $receiverMobile, // 收件人手机号
|
|
|
+ 'province' => $receiverProvince, // 收件人省份
|
|
|
+ 'city' => $receiverCity, // 收件人城市
|
|
|
+ 'address' => $receiverAddress, // 收件人详细地址
|
|
|
],
|
|
|
-
|
|
|
// 商品信息
|
|
|
'shop' => [
|
|
|
- 'wxa_path' => '', // 小程序商品路径【选填】
|
|
|
- 'img_url' => '', // 商品缩略图【选填】
|
|
|
- 'goods_name' => '', // 商品名称【选填】
|
|
|
- 'goods_count' => 1, // 商品数量【选填】
|
|
|
- 'goods_price' => 0, // 商品单价,单位分【选填】
|
|
|
- 'goods_desc' => '', // 商品描述【选填】
|
|
|
+ 'goods_name' => $goodsName, // 商品名称
|
|
|
+ 'goods_count' => $goodsCount, // 商品数量
|
|
|
],
|
|
|
-
|
|
|
// 货物信息
|
|
|
'cargo' => [
|
|
|
- 'count' => 1, // 货物数量【必填】
|
|
|
- 'weight' => 0, // 货物总重量,单位kg【必填】
|
|
|
- 'space_x' => 0, // 货物长度,单位cm【必填】
|
|
|
- 'space_y' => 0, // 货物宽度,单位cm【必填】
|
|
|
- 'space_z' => 0, // 货物高度,单位cm【必填】
|
|
|
+ 'count' => $packageNum, // 货物数量
|
|
|
+ 'weight' => $weight, // 货物总重量,单位kg
|
|
|
+ 'space_x' => $length, // 货物长度,单位cm
|
|
|
+ 'space_y' => $width, // 货物宽度,单位cm
|
|
|
+ 'space_z' => $height, // 货物高度,单位cm
|
|
|
'detail_list' => [
|
|
|
[
|
|
|
- 'name' => '', // 货物名称【必填】
|
|
|
- 'count' => 1, // 货物数量【必填】
|
|
|
+ 'name' => '鲜花花材', // 货物名称
|
|
|
+ 'count' => $packageNum, // 货物数量
|
|
|
],
|
|
|
- // ...可添加多个
|
|
|
],
|
|
|
],
|
|
|
-
|
|
|
// 保价信息
|
|
|
'insured' => [
|
|
|
- 'use_insured' => 0, // 是否保价,0-否,1-是【必填】
|
|
|
- 'insured_value' => 0, // 保价金额,单位分【选填,use_insured=1时必填】
|
|
|
+ 'use_insured' => 0, // 是否保价,0-否,1-是
|
|
|
],
|
|
|
-
|
|
|
// 服务类型
|
|
|
'service' => [
|
|
|
- 'service_type' => 0, // 服务类型,0-标准快递【必填】
|
|
|
- 'service_name' => '', // 服务名称【选填】
|
|
|
+ 'service_type' => $serviceType, // 服务类型,0-标准快递
|
|
|
+ 'service_name' => $serviceName, // 服务名称
|
|
|
],
|
|
|
];
|
|
|
-
|
|
|
- expressUtil::addOrder($merchant, $data, $ptStyle);
|
|
|
+ $ret = expressUtil::addOrder($merchant, $data, $ptStyle);
|
|
|
+ print_r($ret);
|
|
|
}
|
|
|
|
|
|
}
|