TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TrainAgentReserveorderoccupyConfirmRequest req = new TrainAgentReserveorderoccupyConfirmRequest();
TrainAgentReserveorderoccupyConfirmRequest.ReserveOrderOccupyRQ obj1 = new TrainAgentReserveorderoccupyConfirmRequest.ReserveOrderOccupyRQ();
obj1.setTaskId(1635187060363644928L);
obj1.setGrabId(123L);
obj1.setAccountUsername("用户名");
TrainAgentReserveorderoccupyConfirmRequest.OccupyResult obj2 = new TrainAgentReserveorderoccupyConfirmRequest.OccupyResult();
obj2.setPayLimitTime("20241209115039");
obj2.setOrderDate("20241115");
obj2.setSequenceNo("EA84243106");
obj2.setBeginTime("1731654613506");
obj2.setLoseTime("1731654613506");
obj2.setResignFlag("1");
obj2.setTicketTotalnum("1");
obj2.setTicketPriceAll("400");
List<TrainAgentReserveorderoccupyConfirmRequest.TicketInfo> list4 = new ArrayList<TrainAgentReserveorderoccupyConfirmRequest.TicketInfo>();
TrainAgentReserveorderoccupyConfirmRequest.TicketInfo obj5 = new TrainAgentReserveorderoccupyConfirmRequest.TicketInfo();
list4.add(obj5);
obj5.setArriveTime("0800");
obj5.setBatchNo("1");
obj5.setCoachName("02");
obj5.setCoachNo("02");
obj5.setFromStationName("大连");
obj5.setFromStationTelecode("DLT");
obj5.setIntegralPayFlag("N");
obj5.setLimitTime("20241209114039");
obj5.setLoseTime("20241209114039");
obj5.setPassengerIdNo("4114***********019");
obj5.setPassengerIdTypeCode("1");
obj5.setPassengerName("张三");
obj5.setPayModeCode("\"\"");
obj5.setPreferenceRate("1");
obj5.setPreferenceWord("\"\"");
obj5.setPurposeCode("00");
obj5.setSeatName("07F号");
obj5.setSeatNo("007F");
obj5.setSeatTypeCode("0");
obj5.setSequenceNo("E249303965");
obj5.setStartTime("0618");
obj5.setStationTrainCode("D7741");
obj5.setTicketPrice("5.50");
obj5.setTicketTypeCode("1");
obj5.setToStationName("大连北");
obj5.setToStationTelecode("DFT");
obj5.setTradeNo("1232134");
obj5.setTrainDate("20241222");
obj5.setPassengerBornDate("19990101");
obj5.setArriveDate("20241116");
obj2.setTicketInfos(list4);
obj1.setOccupyResult(obj2);
TrainAgentReserveorderoccupyConfirmRequest.QueryPayResult obj6 = new TrainAgentReserveorderoccupyConfirmRequest.QueryPayResult();
obj6.setMerSignMsg("1323123");
obj6.setPayOrderId("123213");
obj6.setAmount("400");
obj6.setTransType("01");
obj6.setTranData("12312312");
obj6.setAppId("0001");
obj6.setInterfaceVersion("1.0");
obj6.setInterfaceName("WAP_SERVLET");
obj6.setEpayUrl("https://epay.12306.cn");
obj6.setPayUrl("https://epay.12306.cn");
obj1.setQueryPayResult(obj6);
TrainAgentReserveorderoccupyConfirmRequest.MonitorInfo obj7 = new TrainAgentReserveorderoccupyConfirmRequest.MonitorInfo();
List<TrainAgentReserveorderoccupyConfirmRequest.MonitorItem> list9 = new ArrayList<TrainAgentReserveorderoccupyConfirmRequest.MonitorItem>();
TrainAgentReserveorderoccupyConfirmRequest.MonitorItem obj10 = new TrainAgentReserveorderoccupyConfirmRequest.MonitorItem();
list9.add(obj10);
obj10.setStepName("com.cars.otsmobile.queryPassenger");
obj10.setStepStartTimeMillis(1734681315716L);
obj10.setStepCostTime(181L);
obj10.setStepSuccess(true);
obj10.setStepResult("成功");
obj7.setMonitorList(list9);
obj1.setMonitorInfo(obj7);
req.setReserveOrderOccupyRq(obj1);
TrainAgentReserveorderoccupyConfirmResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TrainAgentReserveorderoccupyConfirmRequest req = new TrainAgentReserveorderoccupyConfirmRequest();
TrainAgentReserveorderoccupyConfirmRequest.ReserveOrderOccupyRQDomain obj1 = new TrainAgentReserveorderoccupyConfirmRequest.ReserveOrderOccupyRQDomain();
obj1.TaskId = 1635187060363644928L;
obj1.GrabId = 123L;
obj1.AccountUsername = "用户名";
TrainAgentReserveorderoccupyConfirmRequest.OccupyResultDomain obj2 = new TrainAgentReserveorderoccupyConfirmRequest.OccupyResultDomain();
obj2.PayLimitTime = "20241209115039";
obj2.OrderDate = "20241115";
obj2.SequenceNo = "EA84243106";
obj2.BeginTime = "1731654613506";
obj2.LoseTime = "1731654613506";
obj2.ResignFlag = "1";
obj2.TicketTotalnum = "1";
obj2.TicketPriceAll = "400";
List<TrainAgentReserveorderoccupyConfirmRequest.TicketInfoDomain> list4 = new List<TrainAgentReserveorderoccupyConfirmRequest.TicketInfoDomain>();
TrainAgentReserveorderoccupyConfirmRequest.TicketInfoDomain obj5 = new TrainAgentReserveorderoccupyConfirmRequest.TicketInfoDomain();
list4.Add(obj5);
obj5.ArriveTime = "0800";
obj5.BatchNo = "1";
obj5.CoachName = "02";
obj5.CoachNo = "02";
obj5.FromStationName = "大连";
obj5.FromStationTelecode = "DLT";
obj5.IntegralPayFlag = "N";
obj5.LimitTime = "20241209114039";
obj5.LoseTime = "20241209114039";
obj5.PassengerIdNo = "4114***********019";
obj5.PassengerIdTypeCode = "1";
obj5.PassengerName = "张三";
obj5.PayModeCode = "\"\"";
obj5.PreferenceRate = "1";
obj5.PreferenceWord = "\"\"";
obj5.PurposeCode = "00";
obj5.SeatName = "07F号";
obj5.SeatNo = "007F";
obj5.SeatTypeCode = "0";
obj5.SequenceNo = "E249303965";
obj5.StartTime = "0618";
obj5.StationTrainCode = "D7741";
obj5.TicketPrice = "5.50";
obj5.TicketTypeCode = "1";
obj5.ToStationName = "大连北";
obj5.ToStationTelecode = "DFT";
obj5.TradeNo = "1232134";
obj5.TrainDate = "20241222";
obj5.PassengerBornDate = "19990101";
obj5.ArriveDate = "20241116";
obj2.TicketInfos= list4;
obj1.OccupyResult= obj2;
TrainAgentReserveorderoccupyConfirmRequest.QueryPayResultDomain obj6 = new TrainAgentReserveorderoccupyConfirmRequest.QueryPayResultDomain();
obj6.MerSignMsg = "1323123";
obj6.PayOrderId = "123213";
obj6.Amount = "400";
obj6.TransType = "01";
obj6.TranData = "12312312";
obj6.AppId = "0001";
obj6.InterfaceVersion = "1.0";
obj6.InterfaceName = "WAP_SERVLET";
obj6.EpayUrl = "https://epay.12306.cn";
obj6.PayUrl = "https://epay.12306.cn";
obj1.QueryPayResult= obj6;
TrainAgentReserveorderoccupyConfirmRequest.MonitorInfoDomain obj7 = new TrainAgentReserveorderoccupyConfirmRequest.MonitorInfoDomain();
List<TrainAgentReserveorderoccupyConfirmRequest.MonitorItemDomain> list9 = new List<TrainAgentReserveorderoccupyConfirmRequest.MonitorItemDomain>();
TrainAgentReserveorderoccupyConfirmRequest.MonitorItemDomain obj10 = new TrainAgentReserveorderoccupyConfirmRequest.MonitorItemDomain();
list9.Add(obj10);
obj10.StepName = "com.cars.otsmobile.queryPassenger";
obj10.StepStartTimeMillis = 1734681315716L;
obj10.StepCostTime = 181L;
obj10.StepSuccess = true;
obj10.StepResult = "成功";
obj7.MonitorList= list9;
obj1.MonitorInfo= obj7;
req.ReserveOrderOccupyRq_ = obj1;
TrainAgentReserveorderoccupyConfirmResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TrainAgentReserveorderoccupyConfirmRequest;
$reserve_order_occupy_rq = new ReserveOrderOccupyRQ;
$reserve_order_occupy_rq->task_id="1635187060363644928";
$reserve_order_occupy_rq->grab_id="123";
$reserve_order_occupy_rq->account_username="用户名";
$occupy_result = new OccupyResult;
$occupy_result->pay_limit_time="20241209115039";
$occupy_result->order_date="20241115";
$occupy_result->sequence_no="EA84243106";
$occupy_result->begin_time="1731654613506";
$occupy_result->lose_time="1731654613506";
$occupy_result->resign_flag="1";
$occupy_result->ticket_totalnum="1";
$occupy_result->ticket_price_all="400";
$ticket_infos = new TicketInfo;
$ticket_infos->arrive_time="0800";
$ticket_infos->batch_no="1";
$ticket_infos->coach_name="02";
$ticket_infos->coach_no="02";
$ticket_infos->from_station_name="大连";
$ticket_infos->from_station_telecode="DLT";
$ticket_infos->integral_pay_flag="N";
$ticket_infos->limit_time="20241209114039";
$ticket_infos->lose_time="20241209114039";
$ticket_infos->passenger_id_no="4114***********019";
$ticket_infos->passenger_id_type_code="1";
$ticket_infos->passenger_name="张三";
$ticket_infos->pay_mode_code="\"\"";
$ticket_infos->preference_rate="1";
$ticket_infos->preference_word="\"\"";
$ticket_infos->purpose_code="00";
$ticket_infos->seat_name="07F号";
$ticket_infos->seat_no="007F";
$ticket_infos->seat_type_code="0";
$ticket_infos->sequence_no="E249303965";
$ticket_infos->start_time="0618";
$ticket_infos->station_train_code="D7741";
$ticket_infos->ticket_price="5.50";
$ticket_infos->ticket_type_code="1";
$ticket_infos->to_station_name="大连北";
$ticket_infos->to_station_telecode="DFT";
$ticket_infos->trade_no="1232134";
$ticket_infos->train_date="20241222";
$ticket_infos->passenger_born_date="19990101";
$ticket_infos->arrive_date="20241116";
$occupy_result->ticket_infos = $ticket_infos;
$reserve_order_occupy_rq->occupy_result = $occupy_result;
$query_pay_result = new QueryPayResult;
$query_pay_result->mer_sign_msg="1323123";
$query_pay_result->pay_order_id="123213";
$query_pay_result->amount="400";
$query_pay_result->trans_type="01";
$query_pay_result->tran_data="12312312";
$query_pay_result->app_id="0001";
$query_pay_result->interface_version="1.0";
$query_pay_result->interface_name="WAP_SERVLET";
$query_pay_result->epay_url="https://epay.12306.cn";
$query_pay_result->pay_url="https://epay.12306.cn";
$reserve_order_occupy_rq->query_pay_result = $query_pay_result;
$monitor_info = new MonitorInfo;
$monitor_list = new MonitorItem;
$monitor_list->step_name="com.cars.otsmobile.queryPassenger";
$monitor_list->step_start_time_millis="1734681315716";
$monitor_list->step_cost_time="181";
$monitor_list->step_success="true";
$monitor_list->step_result="成功";
$monitor_info->monitor_list = $monitor_list;
$reserve_order_occupy_rq->monitor_info = $monitor_info;
$req->setReserveOrderOccupyRq(json_encode($reserve_order_occupy_rq));
$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.reserveorderoccupy.confirm' \
-d 'partner_id=apidoc' \
-d 'session=29377ace-c842-4544-93c4-5d7c9a373a59' \
-d 'sign=567D1E6540DCB3E4A009C5D1B661C024' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-01-30+04%3A02%3A00' \
-d 'v=2.0' \
-d 'reserve_order_occupy_rq=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TrainAgentReserveorderoccupyConfirmRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.reserve_order_occupy_rq="数据结构示例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.reserveorderoccupy.confirm");
add_param(pRequest,"reserve_order_occupy_rq","数据结构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.reserveorderoccupy.confirm', {
'reserve_order_occupy_rq':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})