智简魔方文档

订单退款

方法概览

项目内容
文档类型PHP 类方法
方法标识app\common\model\OrderModel::orderRefund
所属业务订单管理
来源模块/系统订单模型

功能说明

订单退款

调用示例

$param = ['id' => 1, 'host_id' => 1, 'amount' => 0.01, 'type' => 'string', 'notes' => '示例说明', 'gateway' => 'credit'];
$result = (new \app\common\model\OrderModel())->orderRefund($param);

参数

参数类型必填默认值校验规则说明
param.idintrequire订单ID
param.host_idint产品ID
param.amountfloatrequire退款金额
param.typestringrequire退款类型(credit_first=余额优先,gateway_first=渠道优先,credit=余额,transaction=支付接口)
param.notesstring备注
param.gatewaystring支付接口 requireIf:type=transaction

返回值

返回项类型说明
statusint状态码(200=成功,400=失败)
msgstring信息
data.idint退款记录ID

正常返回

{
  "status": 1,
  "msg": "string",
  "data": {
    "id": 1
  }
}

异常情况

异常类型说明
Throwable调用失败时由具体实现抛出异常,异常信息以运行时结果为准。