结算购物车
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 类方法 |
| 方法标识 | app\home\model\CartModel::settle |
| 所属业务 | 商品管理 |
| 来源模块/系统 | 购物车模型 |
功能说明
结算购物车
调用示例
$positions = ['string'];
$customfield = [];
$param = ['downstream_host_id' => 1, 'downstream_url' => 'https://example.com/callback', 'downstream_token' => 'example-token', 'downstream_system_type' => 'string'];
$result = (new \app\home\model\CartModel())->settle($positions, $customfield, $param);参数
| 参数 | 类型 | 必填 | 默认值 | 校验规则 | 说明 |
|---|---|---|---|---|---|
positions | array | 是 | — | required | 商品位置数组 |
customfield | object | 否 | — | — | 自定义参数,比如优惠码参数传:{"promo_code":["pr8nRQOGbmv5"]} |
param.downstream_host_id | int | 否 | — | — | 下游产品ID |
param.downstream_url | string | 否 | — | — | 下游地址 |
param.downstream_token | string | 否 | — | — | 下游产品token |
param.downstream_system_type | string | 否 | — | — | 下游系统类型 |
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
data | object | 数据 |
data.order_id | int | 订单ID |
status | int | 状态码,200成功,400失败 |
msg | string | 提示信息 |
正常返回
{
"data": {
"order_id": 1
},
"status": 1,
"msg": "string"
}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |