[
{
"sum_money": 232,
"total_money": 232,
"sum_carriage": 0,
"add_itional_fee": 0,
"skuList": [
{
"amount": 82,
"price": 41,
"product_id": 1685,
"sku_id": 2649196,
"product_num": 2,
"sub_order_on": "5b3eefdb4a4e41aceef869edd7dbc16e32149799173dd133f7a83bb394277e6e"
},
{
"amount": 150,
"price": 50,
"product_id": 826,
"sku_id": 1628029,
"product_num": 3,
"sub_order_on": "5b3eefdb4a4e41aceef869edd7dbc16e32149799173dd133f7a83bb394277e6e"
}
]
},
{
"sum_money": 108,
"total_money": 108,
"sum_carriage": 0,
"add_itional_fee": 0,
"skuList": [
{
"amount": 108,
"price": 36,
"product_id": 1700,
"sku_id": 2681523,
"product_num": 3,
"sub_order_on": "fccc0108763ae2e8911f4f114522976375281959e044422b1803ca031b54404e"
}
]
}
]
<?php
require_once dirname(__FILE__) . '/PhalApiClient.php';
$client = PhalApiClient::create()
->withHost('http://api.hmgyl.com.cn/');$rs = $client->reset()
->withService('App.Order.Preview')
->withParams('products', '[{"product_id":"553669822926","sku_id":"f561c4f7cdb23de81fc2303ebf1e8f55","product_num":2},{"product_id":"553507958686","sku_id":"f561c4f7cdb23de81fc2303ebf1e8f55","product_num":3}]')
->withParams('address', '{"user_phone":18602344691,"user_name":"tiger","user_address_province":"重庆市","user_address_city":"市辖区","user_address_area":"万州区","user_address_town":"镇/街道","user_address":"滨江路1号"}')
->withParams('out_order_no', 12345678)
->withTimeout(3000)
->request();
// ret状态码,200表示成功
var_dump($rs->getRet());
// 业务数据
var_dump($rs->getData());
// 提示信息
var_dump($rs->getMsg());