|
@@ -15,6 +15,8 @@ require_once (BASE_CORE_PATH . '/framework/function/http.php');
|
|
|
class deliveryLogic
|
|
|
{
|
|
|
const oms_url = 'http://oapi.lrlz.com/lrlzApiRest/router/rest';
|
|
|
+ //const oms_url = 'http://oapitest.lrlz.com/lrlzApiRest/router/rest';
|
|
|
+
|
|
|
|
|
|
private static $appkey = '2015panda';
|
|
|
private static $appPassWord = 'nEs5vu86JSjh89WPW4de2d3e87rwli3e8rw';
|
|
@@ -166,6 +168,24 @@ class deliveryLogic
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
+ public function cancel_oms($order_sn)
|
|
|
+ {
|
|
|
+ $param = array('type' => 'TRADE_INTERCEPT','data' => array('tids' => $order_sn,'remark' => '用户退款'));
|
|
|
+ $body = json_encode($param,JSON_UNESCAPED_UNICODE);
|
|
|
+ $sign = $this->sign($body);
|
|
|
+ $headers = array('v_appkey: '.self::$appkey, 'v_sign: '.$sign, 'Content-Type: application/json');
|
|
|
+ $resp = http_post_data(self::oms_url,urlencode($body),$headers);
|
|
|
+ if($resp === false) {
|
|
|
+ Log::record(__METHOD__ . " NET Error",Log::ERR);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ Log::record($resp,Log::DEBUG);
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @param $pay_sn
|
|
|
* @param $trade_no
|