TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripTravelTradeCloseRequest req = new AlitripTravelTradeCloseRequest();
req.setCloseReason("未及时付款");
req.setSubOrderId(12345L);
req.setReasonDesc("未及时履约");
AlitripTravelTradeCloseResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripTravelTradeCloseRequest req = new AlitripTravelTradeCloseRequest();
req.CloseReason = "未及时付款";
req.SubOrderId = 12345L;
req.ReasonDesc = "未及时履约";
AlitripTravelTradeCloseResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripTravelTradeCloseRequest;
$req->setCloseReason("未及时付款");
$req->setSubOrderId("12345");
$req->setReasonDesc("未及时履约");
$resp = $c->execute($req, $sessionKey);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'app_key=12129701' \
-d 'format=json' \
-d 'method=alitrip.travel.trade.close' \
-d 'partner_id=apidoc' \
-d 'session=75b5d3f9-d293-4918-ba00-d59f063bb3dd' \
-d 'sign=308CC9D584A539307B36BD2E35A79B1A' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-12-04+16%3A21%3A09' \
-d 'v=2.0' \
-d 'close_reason=%E6%9C%AA%E5%8F%8A%E6%97%B6%E4%BB%98%E6%AC%BE' \
-d 'reason_desc=%E6%9C%AA%E5%8F%8A%E6%97%B6%E5%B1%A5%E7%BA%A6' \
-d 'sub_order_id=12345'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripTravelTradeCloseRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.close_reason="未及时付款"
req.sub_order_id=12345
req.reason_desc="未及时履约"
try:
resp= req.getResponse(sessionkey)
print(resp)
except Exception,e:
print(e)
pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"alitrip.travel.trade.close");
add_param(pRequest,"close_reason","未及时付款");
add_param(pRequest,"sub_order_id","12345");
add_param(pRequest,"reason_desc","未及时履约");
pResponse = top_execute(pClient,pRequest,sessionKey);
printf("ret code:%d\n",pResponse->code);
if(pResponse->code == 0){
pTopResponseIterator ite = init_response_iterator(pResponse);
pResultItem pResultItem = alloc_result_item();
while(parseNext(ite, pResultItem) == 0){
printf("%s:%s\n",pResultItem->key,pResultItem->value);
}
destroy_response_iterator(ite);
destroy_result_item(pResultItem);
}
destroy_top_request(pRequest);
destroy_top_response(pResponse);
destroy_taobao_client(pClient);
TopClient = require('./topClient').TopClient;
var client = new TopClient({
'appkey': 'appkey',
'appsecret': 'secret',
'REST_URL': 'http://gw.api.taobao.com/router/rest'
});
client.execute('alitrip.travel.trade.close', {
'close_reason':'未及时付款',
'sub_order_id':'12345',
'reason_desc':'未及时履约'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})