TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TravelTicketOrderVerifyRequest req = new TravelTicketOrderVerifyRequest();
req.setCheckNum(1L);
req.setOrderId(12345678L);
req.setReturnNum(0L);
req.setTotalNum(1L);
req.setOutOrderId("12345");
req.setConfirmCode("2516352");
List<TravelTicketOrderVerifyRequest.VoucherInfoDto> list2 = new ArrayList<TravelTicketOrderVerifyRequest.VoucherInfoDto>();
TravelTicketOrderVerifyRequest.VoucherInfoDto obj3 = new TravelTicketOrderVerifyRequest.VoucherInfoDto();
list2.add(obj3);
obj3.setConfirmCode("2516352");
obj3.setUsedQuantity(1L);
obj3.setUsedDate("2020-01-11 14:00:00");
req.setVoucherInfos(list2);
req.setWriteOffType(0L);
TravelTicketOrderVerifyResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TravelTicketOrderVerifyRequest req = new TravelTicketOrderVerifyRequest();
req.CheckNum = 1L;
req.OrderId = 12345678L;
req.ReturnNum = 0L;
req.TotalNum = 1L;
req.OutOrderId = "12345";
req.ConfirmCode = "2516352";
List<TravelTicketOrderVerifyRequest.VoucherInfoDtoDomain> list2 = new List<TravelTicketOrderVerifyRequest.VoucherInfoDtoDomain>();
TravelTicketOrderVerifyRequest.VoucherInfoDtoDomain obj3 = new TravelTicketOrderVerifyRequest.VoucherInfoDtoDomain();
list2.Add(obj3);
obj3.ConfirmCode = "2516352";
obj3.UsedQuantity = 1L;
obj3.UsedDate = "2020-01-11 14:00:00";
req.VoucherInfos_ = list2;
req.WriteOffType = 0L;
TravelTicketOrderVerifyResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TravelTicketOrderVerifyRequest;
$req->setCheckNum("1");
$req->setOrderId("12345678");
$req->setReturnNum("0");
$req->setTotalNum("1");
$req->setOutOrderId("12345");
$req->setConfirmCode("2516352");
$voucher_infos = new VoucherInfoDto;
$voucher_infos->confirm_code="2516352";
$voucher_infos->used_quantity="1";
$voucher_infos->used_date="2020-01-11 14:00:00";
$req->setVoucherInfos(json_encode($voucher_infos));
$req->setWriteOffType("0");
$resp = $c->execute($req);
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.travel.ticket.order.verify' \
-d 'partner_id=apidoc' \
-d 'sign=2BD6D7BEBCCFA6E7D745B9227C4B1444' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-12-05+03%3A04%3A41' \
-d 'v=2.0' \
-d 'check_num=1' \
-d 'confirm_code=2516352' \
-d 'order_id=12345678' \
-d 'out_order_id=12345' \
-d 'return_num=0' \
-d 'total_num=1' \
-d 'voucher_infos=null' \
-d 'write_off_type=0'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TravelTicketOrderVerifyRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.check_num=1
req.order_id=12345678
req.return_num=0
req.total_num=1
req.out_order_id="12345"
req.confirm_code="2516352"
req.voucher_infos=""
req.write_off_type=0
try:
resp= req.getResponse()
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.travel.ticket.order.verify");
add_param(pRequest,"check_num","1");
add_param(pRequest,"order_id","12345678");
add_param(pRequest,"return_num","0");
add_param(pRequest,"total_num","1");
add_param(pRequest,"out_order_id","12345");
add_param(pRequest,"confirm_code","2516352");
add_param(pRequest,"voucher_infos","数据结构JSON示例");
add_param(pRequest,"write_off_type","0");
pResponse = top_execute(pClient,pRequest,NULL);
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.travel.ticket.order.verify', {
'check_num':'1',
'order_id':'12345678',
'return_num':'0',
'total_num':'1',
'out_order_id':'12345',
'confirm_code':'2516352',
'voucher_infos':'数据结构JSON示例',
'write_off_type':'0'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})