mirror of
https://gitee.com/ShopeX/OMS
synced 2026-04-06 23:05:36 +08:00
75 lines
2.6 KiB
PHP
75 lines
2.6 KiB
PHP
<?php
|
|
/**
|
|
* Copyright 2026 ShopeX (https://www.shopex.cn)
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
|
|
class ome_rpc_response_refund extends ome_rpc_response
|
|
{
|
|
|
|
/**
|
|
* 添加退款单
|
|
* @access public
|
|
* @param array $refund_sdf 退款单数据
|
|
* @param object $responseObj 框架API接口实例化对象
|
|
* @return array 退款单主键ID array('refund_id'=>'退款单主键ID')
|
|
*///20120706189369
|
|
function add($refund_sdf, &$responseObj){
|
|
|
|
$log = app::get('ome')->model('api_log');
|
|
|
|
$node_id = base_rpc_service::$node_id;
|
|
$rs = kernel::single('ome_rpc_mapper')->response_router($node_id,'refund','add',$refund_sdf);
|
|
|
|
$log->write_log($log->gen_id(), $rs['logTitle'], __CLASS__, __METHOD__, '', '', 'response', $rs['rsp'], $rs['logInfo'],'','api.store.trade.refund',$refund_sdf['order_bn']);
|
|
$data = array('tid'=>$rs['data']['tid'],'refund_id'=>$rs['data']['refund_id'],'retry'=>$rs['data']['retry']);
|
|
if($rs['rsp'] == 'success'){
|
|
return $data;
|
|
}else{
|
|
$this->send_user_error(app::get('base')->_($rs['msg']), $data);
|
|
exit;
|
|
}
|
|
exit;
|
|
|
|
}
|
|
|
|
/**
|
|
* 更新退款单状态
|
|
* @access public
|
|
* @param array $status_sdf 退款单状态数据
|
|
* @param object $responseObj 框架API接口实例化对象
|
|
*/
|
|
function status_update($status_sdf, &$responseObj){
|
|
|
|
$log = app::get('ome')->model('api_log');
|
|
|
|
$node_id = base_rpc_service::$node_id;
|
|
$rs = kernel::single('ome_rpc_mapper')->response_router($node_id,'refund','status_update',$status_sdf);
|
|
|
|
$log->write_log($log->gen_id(), $rs['logTitle'], __CLASS__, __METHOD__, '', '', 'response', $rs['rsp'], $rs['logInfo'],'','api.store.trade.refund',$refund_sdf['order_bn']);
|
|
|
|
$data = array('tid'=>$rs['data']['tid'],'refund_id'=>$rs['data']['refund_id'],'retry'=>$rs['data']['retry']);
|
|
if($rs['rsp'] == 'success'){
|
|
return $data;
|
|
}else{
|
|
$this->send_user_error(app::get('base')->_($rs['msg']), $data);
|
|
exit;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} |