TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripBtripSupplychainTrainCallbackChangeRequest req = new AlitripBtripSupplychainTrainCallbackChangeRequest();
AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeCallbackParam obj1 = new AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeCallbackParam();
obj1.setResignTotalPrice("1200");
obj1.setSupplierOrderId("987654321");
obj1.setResignTotalCost("0");
List<AlitripBtripSupplychainTrainCallbackChangeRequest.OriginalTrainDetail> list3 = new ArrayList<AlitripBtripSupplychainTrainCallbackChangeRequest.OriginalTrainDetail>();
AlitripBtripSupplychainTrainCallbackChangeRequest.OriginalTrainDetail obj4 = new AlitripBtripSupplychainTrainCallbackChangeRequest.OriginalTrainDetail();
list3.add(obj4);
obj4.setFromStationName("北京");
obj4.setToStationCode("SHH");
obj4.setTrainNo("T123");
obj4.setToStationName("上海");
obj4.setArriveTime("2022-10-19 15:00:00");
obj4.setOrderTotalPrice("1000");
obj4.setTrainDate("2022-10-19");
List<AlitripBtripSupplychainTrainCallbackChangeRequest.OriginalTicketDetail> list7 = new ArrayList<AlitripBtripSupplychainTrainCallbackChangeRequest.OriginalTicketDetail>();
AlitripBtripSupplychainTrainCallbackChangeRequest.OriginalTicketDetail obj8 = new AlitripBtripSupplychainTrainCallbackChangeRequest.OriginalTicketDetail();
list7.add(obj8);
obj8.setSeatType("1");
obj8.setSeatName("硬座");
obj8.setTicketType("1");
obj8.setTicketPrice("1000");
obj8.setPassengerTicketNo("EW12121");
obj8.setSeatNo("001");
obj8.setCoachNo("01");
obj8.setPassengerId("1234212");
list5.setOriginalTicketDetails(list7);
obj4.setTicketNum("1");
obj4.setFromStationCode("BJP");
obj4.setStartTime("2022-10-19");
obj4.setTrainId("车次id");
obj1.setOriginalTrainDetails(list3);
obj1.setTicketNo("EW12312312");
obj1.setOrderId("123456789");
obj1.setChangeOrderId("1234542");
obj1.setOrderStatus("21");
obj1.setResignTotalDiff("200");
List<AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeTrainDetail> list10 = new ArrayList<AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeTrainDetail>();
AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeTrainDetail obj11 = new AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeTrainDetail();
list10.add(obj11);
obj11.setToStationName("上海");
obj11.setArriveTime("2022-10-19 15:00:00");
obj11.setOrderTotalPrice("1200");
List<AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeTicketDetail> list14 = new ArrayList<AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeTicketDetail>();
AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeTicketDetail obj15 = new AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeTicketDetail();
list14.add(obj15);
obj15.setResignFlag("1");
obj15.setCoachNo("01");
obj15.setTicketPrice("1200");
obj15.setTicketEntrance("{\"0\":\"xx检票口\"}");
AlitripBtripSupplychainTrainCallbackChangeRequest.PassengerInfo obj17 = new AlitripBtripSupplychainTrainCallbackChangeRequest.PassengerInfo();
obj17.setPassengerName("张三");
obj17.setPassengerMobile("1667xxx7xxx");
obj17.setPassengerIdNo("432524100011191212");
obj17.setPassengerIdType("0");
obj17.setCountryCode("CN");
obj17.setSex("0");
obj17.setPassengerId("12312");
obj17.setValidDateStart("2000-10-19");
obj17.setBirthDate("1000-10-19");
obj17.setValidDateEnd("2030-10-19");
list16.setPassengerInfo(obj17);
obj15.setTicketType("1");
obj15.setChangeFee("0");
obj15.setSeatType("1");
obj15.setChangeDiff("200");
obj15.setTicketStatus("21");
obj15.setRefundFlag("0");
obj15.setSeatName("硬座");
obj15.setChangeFlag("0");
obj15.setSeatNo("001");
obj15.setPassengerTicketNo("EW123121");
obj15.setFailCode("2001");
obj15.setFailReason("车次已无票");
List<AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeHandingFeeItem> list20 = new ArrayList<AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeHandingFeeItem>();
AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeHandingFeeItem obj21 = new AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeHandingFeeItem();
list20.add(obj21);
obj21.setChangeHandingFeeAmount("100");
obj21.setChangeHandingFeeType("1");
list18.setChangeHandingFeeItems(list20);
list12.setChangeTicketDetails(list14);
obj11.setTrainDate("2022-10-19");
obj11.setFromStationName("北京");
obj11.setTicketNum("1");
obj11.setToStationCode("SHH");
obj11.setTrainNo("T123");
obj11.setFromStationCode("BJP");
obj11.setStartTime("2022-10-19 12:00:00");
obj11.setChooseRule("1");
obj11.setChooseBeds("1T");
obj11.setChooseSeats("1A");
obj11.setTrainId("车次id");
obj1.setChangeTrainDetails(list10);
obj1.setFailCode("1001");
obj1.setFailReason("车次已无票");
req.setChangeCallbackParam(obj1);
AlitripBtripSupplychainTrainCallbackChangeResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripBtripSupplychainTrainCallbackChangeRequest req = new AlitripBtripSupplychainTrainCallbackChangeRequest();
AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeCallbackParamDomain obj1 = new AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeCallbackParamDomain();
obj1.ResignTotalPrice = "1200";
obj1.SupplierOrderId = "987654321";
obj1.ResignTotalCost = "0";
List<AlitripBtripSupplychainTrainCallbackChangeRequest.OriginalTrainDetailDomain> list3 = new List<AlitripBtripSupplychainTrainCallbackChangeRequest.OriginalTrainDetailDomain>();
AlitripBtripSupplychainTrainCallbackChangeRequest.OriginalTrainDetailDomain obj4 = new AlitripBtripSupplychainTrainCallbackChangeRequest.OriginalTrainDetailDomain();
list3.Add(obj4);
obj4.FromStationName = "北京";
obj4.ToStationCode = "SHH";
obj4.TrainNo = "T123";
obj4.ToStationName = "上海";
obj4.ArriveTime = "2022-10-19 15:00:00";
obj4.OrderTotalPrice = "1000";
obj4.TrainDate = "2022-10-19";
List<AlitripBtripSupplychainTrainCallbackChangeRequest.OriginalTicketDetailDomain> list6 = new List<AlitripBtripSupplychainTrainCallbackChangeRequest.OriginalTicketDetailDomain>();
AlitripBtripSupplychainTrainCallbackChangeRequest.OriginalTicketDetailDomain obj7 = new AlitripBtripSupplychainTrainCallbackChangeRequest.OriginalTicketDetailDomain();
list6.Add(obj7);
obj7.SeatType = "1";
obj7.SeatName = "硬座";
obj7.TicketType = "1";
obj7.TicketPrice = "1000";
obj7.PassengerTicketNo = "EW12121";
obj7.SeatNo = "001";
obj7.CoachNo = "01";
obj7.PassengerId = "1234212";
obj4.OriginalTicketDetails= list6;
obj4.TicketNum = "1";
obj4.FromStationCode = "BJP";
obj4.StartTime = "2022-10-19";
obj4.TrainId = "车次id";
obj1.OriginalTrainDetails= list3;
obj1.TicketNo = "EW12312312";
obj1.OrderId = "123456789";
obj1.ChangeOrderId = "1234542";
obj1.OrderStatus = "21";
obj1.ResignTotalDiff = "200";
List<AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeTrainDetailDomain> list9 = new List<AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeTrainDetailDomain>();
AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeTrainDetailDomain obj10 = new AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeTrainDetailDomain();
list9.Add(obj10);
obj10.ToStationName = "上海";
obj10.ArriveTime = "2022-10-19 15:00:00";
obj10.OrderTotalPrice = "1200";
List<AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeTicketDetailDomain> list12 = new List<AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeTicketDetailDomain>();
AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeTicketDetailDomain obj13 = new AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeTicketDetailDomain();
list12.Add(obj13);
obj13.ResignFlag = "1";
obj13.CoachNo = "01";
obj13.TicketPrice = "1200";
obj13.TicketEntrance = "{\"0\":\"xx检票口\"}";
AlitripBtripSupplychainTrainCallbackChangeRequest.PassengerInfoDomain obj14 = new AlitripBtripSupplychainTrainCallbackChangeRequest.PassengerInfoDomain();
obj14.PassengerName = "张三";
obj14.PassengerMobile = "1667xxx7xxx";
obj14.PassengerIdNo = "432524100011191212";
obj14.PassengerIdType = "0";
obj14.CountryCode = "CN";
obj14.Sex = "0";
obj14.PassengerId = "12312";
obj14.ValidDateStart = "2000-10-19";
obj14.BirthDate = "1000-10-19";
obj14.ValidDateEnd = "2030-10-19";
obj13.PassengerInfo= obj14;
obj13.TicketType = "1";
obj13.ChangeFee = "0";
obj13.SeatType = "1";
obj13.ChangeDiff = "200";
obj13.TicketStatus = "21";
obj13.RefundFlag = "0";
obj13.SeatName = "硬座";
obj13.ChangeFlag = "0";
obj13.SeatNo = "001";
obj13.PassengerTicketNo = "EW123121";
obj13.FailCode = "2001";
obj13.FailReason = "车次已无票";
List<AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeHandingFeeItemDomain> list16 = new List<AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeHandingFeeItemDomain>();
AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeHandingFeeItemDomain obj17 = new AlitripBtripSupplychainTrainCallbackChangeRequest.ChangeHandingFeeItemDomain();
list16.Add(obj17);
obj17.ChangeHandingFeeAmount = "100";
obj17.ChangeHandingFeeType = "1";
obj13.ChangeHandingFeeItems= list16;
obj10.ChangeTicketDetails= list12;
obj10.TrainDate = "2022-10-19";
obj10.FromStationName = "北京";
obj10.TicketNum = "1";
obj10.ToStationCode = "SHH";
obj10.TrainNo = "T123";
obj10.FromStationCode = "BJP";
obj10.StartTime = "2022-10-19 12:00:00";
obj10.ChooseRule = "1";
obj10.ChooseBeds = "1T";
obj10.ChooseSeats = "1A";
obj10.TrainId = "车次id";
obj1.ChangeTrainDetails= list9;
obj1.FailCode = "1001";
obj1.FailReason = "车次已无票";
req.ChangeCallbackParam_ = obj1;
AlitripBtripSupplychainTrainCallbackChangeResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripBtripSupplychainTrainCallbackChangeRequest;
$change_callback_param = new ChangeCallbackParam;
$change_callback_param->resign_total_price="1200";
$change_callback_param->supplier_order_id="987654321";
$change_callback_param->resign_total_cost="0";
$original_train_details = new OriginalTrainDetail;
$original_train_details->from_station_name="北京";
$original_train_details->to_station_code="SHH";
$original_train_details->train_no="T123";
$original_train_details->to_station_name="上海";
$original_train_details->arrive_time="2022-10-19 15:00:00";
$original_train_details->order_total_price="1000";
$original_train_details->train_date="2022-10-19";
$original_ticket_details = new OriginalTicketDetail;
$original_ticket_details->seat_type="1";
$original_ticket_details->seat_name="硬座";
$original_ticket_details->ticket_type="1";
$original_ticket_details->ticket_price="1000";
$original_ticket_details->passenger_ticket_no="EW12121";
$original_ticket_details->seat_no="001";
$original_ticket_details->coach_no="01";
$original_ticket_details->passenger_id="1234212";
$original_train_details->original_ticket_details = $original_ticket_details;
$original_train_details->ticket_num="1";
$original_train_details->from_station_code="BJP";
$original_train_details->start_time="2022-10-19";
$original_train_details->train_id="车次id";
$change_callback_param->original_train_details = $original_train_details;
$change_callback_param->ticket_no="EW12312312";
$change_callback_param->order_id="123456789";
$change_callback_param->change_order_id="1234542";
$change_callback_param->order_status="21";
$change_callback_param->resign_total_diff="200";
$change_train_details = new ChangeTrainDetail;
$change_train_details->to_station_name="上海";
$change_train_details->arrive_time="2022-10-19 15:00:00";
$change_train_details->order_total_price="1200";
$change_ticket_details = new ChangeTicketDetail;
$change_ticket_details->resign_flag="1";
$change_ticket_details->coach_no="01";
$change_ticket_details->ticket_price="1200";
$change_ticket_details->ticket_entrance="{\"0\":\"xx检票口\"}";
$passenger_info = new PassengerInfo;
$passenger_info->passenger_name="张三";
$passenger_info->passenger_mobile="1667xxx7xxx";
$passenger_info->passenger_id_no="432524100011191212";
$passenger_info->passenger_id_type="0";
$passenger_info->country_code="CN";
$passenger_info->sex="0";
$passenger_info->passenger_id="12312";
$passenger_info->valid_date_start="2000-10-19";
$passenger_info->birth_date="1000-10-19";
$passenger_info->valid_date_end="2030-10-19";
$change_ticket_details->passenger_info = $passenger_info;
$change_ticket_details->ticket_type="1";
$change_ticket_details->change_fee="0";
$change_ticket_details->seat_type="1";
$change_ticket_details->change_diff="200";
$change_ticket_details->ticket_status="21";
$change_ticket_details->refund_flag="0";
$change_ticket_details->seat_name="硬座";
$change_ticket_details->change_flag="0";
$change_ticket_details->seat_no="001";
$change_ticket_details->passenger_ticket_no="EW123121";
$change_ticket_details->fail_code="2001";
$change_ticket_details->fail_reason="车次已无票";
$change_handing_fee_items = new ChangeHandingFeeItem;
$change_handing_fee_items->change_handing_fee_amount="100";
$change_handing_fee_items->change_handing_fee_type="1";
$change_ticket_details->change_handing_fee_items = $change_handing_fee_items;
$change_train_details->change_ticket_details = $change_ticket_details;
$change_train_details->train_date="2022-10-19";
$change_train_details->from_station_name="北京";
$change_train_details->ticket_num="1";
$change_train_details->to_station_code="SHH";
$change_train_details->train_no="T123";
$change_train_details->from_station_code="BJP";
$change_train_details->start_time="2022-10-19 12:00:00";
$change_train_details->choose_rule="1";
$change_train_details->choose_beds="1T";
$change_train_details->choose_seats="1A";
$change_train_details->train_id="车次id";
$change_callback_param->change_train_details = $change_train_details;
$change_callback_param->fail_code="1001";
$change_callback_param->fail_reason="车次已无票";
$req->setChangeCallbackParam(json_encode($change_callback_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=alitrip.btrip.supplychain.train.callback.change' \
-d 'partner_id=apidoc' \
-d 'session=189e6b57-85f9-4f36-b1d7-5855dfeb1521' \
-d 'sign=C64BC491E158D99F2D4D26F16E28467D' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+19%3A50%3A18' \
-d 'v=2.0' \
-d 'change_callback_param=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripBtripSupplychainTrainCallbackChangeRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.change_callback_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,"alitrip.btrip.supplychain.train.callback.change");
add_param(pRequest,"change_callback_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('alitrip.btrip.supplychain.train.callback.change', {
'change_callback_param':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})