|
|
@ -11,6 +11,7 @@ class Rpc |
|
|
|
|
|
|
|
|
const SEPARATE_ACCOUNTS = "/order/onlineComplete"; |
|
|
const SEPARATE_ACCOUNTS = "/order/onlineComplete"; |
|
|
const ORDER_REFUND = "/order/onlineRefund"; |
|
|
const ORDER_REFUND = "/order/onlineRefund"; |
|
|
|
|
|
const ORDER_SINGLE_REFUND = "/order/onlineSingleRefund"; |
|
|
const GET_DISTANCE = "/location/getDistanceByTencent"; |
|
|
const GET_DISTANCE = "/location/getDistanceByTencent"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -63,4 +64,37 @@ class Rpc |
|
|
$response = $client->send($request); |
|
|
$response = $client->send($request); |
|
|
return json_decode($response->getBody()->getContents(),true); |
|
|
return json_decode($response->getBody()->getContents(),true); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 线上订单单笔退款,主要用于后台强行操作退单退款 |
|
|
|
|
|
* 支持单商品、单店、整单 |
|
|
|
|
|
* 按比例计算红包进行退款 |
|
|
|
|
|
* 比如:两个子订单和子订单商品,分别是2元,98元,使用了10元优惠券 |
|
|
|
|
|
* 退2元商品时,退款金额为 |
|
|
|
|
|
* 红包 :(2/(98+2))*10 = 0.2 |
|
|
|
|
|
* 退款:2-0.2=1.8元 |
|
|
|
|
|
* @param $user_id |
|
|
|
|
|
* @param $note |
|
|
|
|
|
* @param $global_order_id |
|
|
|
|
|
* @param null $order_child_id |
|
|
|
|
|
* @param null $order_goods_id |
|
|
|
|
|
* @return mixed |
|
|
|
|
|
*/ |
|
|
|
|
|
public static function onlineSingleRefund($user_id, $note, $global_order_id, $order_child_id=null, $order_goods_id=null){ |
|
|
|
|
|
$client = Client::factory(env('RPC_SITE_HOST')); |
|
|
|
|
|
$request = $client->request( |
|
|
|
|
|
uniqid(), |
|
|
|
|
|
self::ORDER_SINGLE_REFUND, |
|
|
|
|
|
[ |
|
|
|
|
|
'user_id' => $user_id, |
|
|
|
|
|
'note'=>$note, |
|
|
|
|
|
'global_order_id'=>$global_order_id, |
|
|
|
|
|
'order_child_id'=>$order_child_id, |
|
|
|
|
|
'order_goods_id'=>$order_goods_id |
|
|
|
|
|
]); |
|
|
|
|
|
$response = $client->send($request); |
|
|
|
|
|
return json_decode($response->getBody()->getContents(),true); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |