TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TrainAgentOrderFailRequest req = new TrainAgentOrderFailRequest();
TrainAgentOrderFailRequest.BookTicketFailRQ obj1 = new TrainAgentOrderFailRequest.BookTicketFailRQ();
obj1.setSubOrderId(1234L);
obj1.setFailReason("余票不足");
obj1.setTtpOrderId(3891829747058L);
req.setParam(obj1);
TrainAgentOrderFailResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TrainAgentOrderFailRequest req = new TrainAgentOrderFailRequest();
TrainAgentOrderFailRequest.BookTicketFailRQDomain obj1 = new TrainAgentOrderFailRequest.BookTicketFailRQDomain();
obj1.SubOrderId = 1234L;
obj1.FailReason = "余票不足";
obj1.TtpOrderId = 3891829747058L;
req.Param_ = obj1;
TrainAgentOrderFailResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TrainAgentOrderFailRequest;
$param = new BookTicketFailRQ;
$param->sub_order_id="1234";
$param->fail_reason="余票不足";
$param->ttp_order_id="3891829747058";
$req->setParam(json_encode($param));
$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=taobao.train.agent.order.fail' \
-d 'partner_id=apidoc' \
-d 'session=f8299c81-7cda-4ffe-a522-90e58fd7050a' \
-d 'sign=B8A2EF108B79D70B71B1DC3876D2B701' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-01-29+13%3A55%3A57' \
-d 'v=2.0' \
-d 'param=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TrainAgentOrderFailRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.param="数据结构示例JSON格式"
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,"taobao.train.agent.order.fail");
add_param(pRequest,"param","数据结构JSON示例");
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('taobao.train.agent.order.fail', {
'param':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})