orderOnlineService->doComplete($orderMainId, $userId); $this->separateAccountsService->orderOnlineCompleted($orderMainId, $userId); Db::commit(); return [ "status" => 200, "code" => 0, "result" => [], "message" => '调用成功' ]; } catch (\Exception $e) { Db::rollBack(); $this->log->event(LogLabel::ORDER_COMPLETE_LOG, ['exception' => $e->getMessage()]); throw new ErrorCodeException(ErrorCode::ORDER_COMPLETE_FAIL, $e->getMessage()); } } /** * 线上订单退款 * 申请退款 state = 8 * 退款成功 state = 9 */ public function onlineRefund($global_order_id){ $result = [ "status" => 200, "code" => ErrorCode::ORDER_FAILURE, "result" => [], "message" => '' ]; $res = $this->orderOnlineService->onlineRefund($global_order_id); if($res['code'] > 0){ $result['result'] = $res; $result['message'] = '退款失败'; }else{ $result['code'] = 0; $result['result'] = $res; $result['message'] = '退款成功'; }; return $result; } }