TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripBtripSupplychainTrainCallbackRefundRequest req = new AlitripBtripSupplychainTrainCallbackRefundRequest();
AlitripBtripSupplychainTrainCallbackRefundRequest.RefundCallBackParam obj1 = new AlitripBtripSupplychainTrainCallbackRefundRequest.RefundCallBackParam();
List<AlitripBtripSupplychainTrainCallbackRefundRequest.RefundTrainDetail> list3 = new ArrayList<AlitripBtripSupplychainTrainCallbackRefundRequest.RefundTrainDetail>();
AlitripBtripSupplychainTrainCallbackRefundRequest.RefundTrainDetail obj4 = new AlitripBtripSupplychainTrainCallbackRefundRequest.RefundTrainDetail();
list3.add(obj4);
obj4.setToStationName("上海");
obj4.setArriveTime("2022-10-19 14:00:00");
obj4.setTrainDate("2022-10-19");
obj4.setFromStationName("北京");
List<AlitripBtripSupplychainTrainCallbackRefundRequest.RefundTicketDetail> list7 = new ArrayList<AlitripBtripSupplychainTrainCallbackRefundRequest.RefundTicketDetail>();
AlitripBtripSupplychainTrainCallbackRefundRequest.RefundTicketDetail obj8 = new AlitripBtripSupplychainTrainCallbackRefundRequest.RefundTicketDetail();
list7.add(obj8);
obj8.setSeatType("1");
obj8.setCoachNo("01");
obj8.setTicketPrice("1000");
obj8.setTicketStatus("31");
obj8.setSeatName("硬座");
AlitripBtripSupplychainTrainCallbackRefundRequest.PassengerInfo obj10 = new AlitripBtripSupplychainTrainCallbackRefundRequest.PassengerInfo();
obj10.setPassengerName("123123");
obj10.setPassengerMobile("1667xx77xxx");
obj10.setPassengerIdNo("432524100011191212");
obj10.setPassengerIdType("0");
obj10.setCountryCode("CN");
obj10.setSex("0");
obj10.setPassengerId("1231232");
obj10.setValidDateStart("2000-10-19");
obj10.setBirthDate("1000-10-19");
obj10.setValidDateEnd("2030-10-19");
list9.setPassengerInfo(obj10);
obj8.setTicketType("1");
obj8.setRefundRate("0");
obj8.setSeatNo("001");
obj8.setRefundPrice("1000");
obj8.setPassengerTicketNo("EW123121");
obj8.setRefundCost("0");
obj8.setFailReason("退票失败");
obj8.setFailCode("3001");
list5.setRefundTicketDetails(list7);
obj4.setToStationCode("SHH");
obj4.setTrainNo("T123");
obj4.setFromStationCode("BJP");
obj4.setStartTime("2022-10-19 12:00:00");
obj1.setRefundTrainDetails(list3);
obj1.setOrderId("123456789");
obj1.setRefundTotal("1000");
obj1.setOrderStatus("31");
obj1.setRefundRate("0");
obj1.setRefundId("1231123");
obj1.setRefundCost("0");
obj1.setSupplierOrderId("12345678");
obj1.setTicketNo("EW123412");
req.setRefundCallBackParam(obj1);
AlitripBtripSupplychainTrainCallbackRefundResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripBtripSupplychainTrainCallbackRefundRequest req = new AlitripBtripSupplychainTrainCallbackRefundRequest();
AlitripBtripSupplychainTrainCallbackRefundRequest.RefundCallBackParamDomain obj1 = new AlitripBtripSupplychainTrainCallbackRefundRequest.RefundCallBackParamDomain();
List<AlitripBtripSupplychainTrainCallbackRefundRequest.RefundTrainDetailDomain> list3 = new List<AlitripBtripSupplychainTrainCallbackRefundRequest.RefundTrainDetailDomain>();
AlitripBtripSupplychainTrainCallbackRefundRequest.RefundTrainDetailDomain obj4 = new AlitripBtripSupplychainTrainCallbackRefundRequest.RefundTrainDetailDomain();
list3.Add(obj4);
obj4.ToStationName = "上海";
obj4.ArriveTime = "2022-10-19 14:00:00";
obj4.TrainDate = "2022-10-19";
obj4.FromStationName = "北京";
List<AlitripBtripSupplychainTrainCallbackRefundRequest.RefundTicketDetailDomain> list6 = new List<AlitripBtripSupplychainTrainCallbackRefundRequest.RefundTicketDetailDomain>();
AlitripBtripSupplychainTrainCallbackRefundRequest.RefundTicketDetailDomain obj7 = new AlitripBtripSupplychainTrainCallbackRefundRequest.RefundTicketDetailDomain();
list6.Add(obj7);
obj7.SeatType = "1";
obj7.CoachNo = "01";
obj7.TicketPrice = "1000";
obj7.TicketStatus = "31";
obj7.SeatName = "硬座";
AlitripBtripSupplychainTrainCallbackRefundRequest.PassengerInfoDomain obj8 = new AlitripBtripSupplychainTrainCallbackRefundRequest.PassengerInfoDomain();
obj8.PassengerName = "123123";
obj8.PassengerMobile = "1667xx77xxx";
obj8.PassengerIdNo = "432524100011191212";
obj8.PassengerIdType = "0";
obj8.CountryCode = "CN";
obj8.Sex = "0";
obj8.PassengerId = "1231232";
obj8.ValidDateStart = "2000-10-19";
obj8.BirthDate = "1000-10-19";
obj8.ValidDateEnd = "2030-10-19";
obj7.PassengerInfo= obj8;
obj7.TicketType = "1";
obj7.RefundRate = "0";
obj7.SeatNo = "001";
obj7.RefundPrice = "1000";
obj7.PassengerTicketNo = "EW123121";
obj7.RefundCost = "0";
obj7.FailReason = "退票失败";
obj7.FailCode = "3001";
obj4.RefundTicketDetails= list6;
obj4.ToStationCode = "SHH";
obj4.TrainNo = "T123";
obj4.FromStationCode = "BJP";
obj4.StartTime = "2022-10-19 12:00:00";
obj1.RefundTrainDetails= list3;
obj1.OrderId = "123456789";
obj1.RefundTotal = "1000";
obj1.OrderStatus = "31";
obj1.RefundRate = "0";
obj1.RefundId = "1231123";
obj1.RefundCost = "0";
obj1.SupplierOrderId = "12345678";
obj1.TicketNo = "EW123412";
req.RefundCallBackParam_ = obj1;
AlitripBtripSupplychainTrainCallbackRefundResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripBtripSupplychainTrainCallbackRefundRequest;
$refund_call_back_param = new RefundCallBackParam;
$refund_train_details = new RefundTrainDetail;
$refund_train_details->to_station_name="上海";
$refund_train_details->arrive_time="2022-10-19 14:00:00";
$refund_train_details->train_date="2022-10-19";
$refund_train_details->from_station_name="北京";
$refund_ticket_details = new RefundTicketDetail;
$refund_ticket_details->seat_type="1";
$refund_ticket_details->coach_no="01";
$refund_ticket_details->ticket_price="1000";
$refund_ticket_details->ticket_status="31";
$refund_ticket_details->seat_name="硬座";
$passenger_info = new PassengerInfo;
$passenger_info->passenger_name="123123";
$passenger_info->passenger_mobile="1667xx77xxx";
$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="1231232";
$passenger_info->valid_date_start="2000-10-19";
$passenger_info->birth_date="1000-10-19";
$passenger_info->valid_date_end="2030-10-19";
$refund_ticket_details->passenger_info = $passenger_info;
$refund_ticket_details->ticket_type="1";
$refund_ticket_details->refund_rate="0";
$refund_ticket_details->seat_no="001";
$refund_ticket_details->refund_price="1000";
$refund_ticket_details->passenger_ticket_no="EW123121";
$refund_ticket_details->refund_cost="0";
$refund_ticket_details->fail_reason="退票失败";
$refund_ticket_details->fail_code="3001";
$refund_train_details->refund_ticket_details = $refund_ticket_details;
$refund_train_details->to_station_code="SHH";
$refund_train_details->train_no="T123";
$refund_train_details->from_station_code="BJP";
$refund_train_details->start_time="2022-10-19 12:00:00";
$refund_call_back_param->refund_train_details = $refund_train_details;
$refund_call_back_param->order_id="123456789";
$refund_call_back_param->refund_total="1000";
$refund_call_back_param->order_status="31";
$refund_call_back_param->refund_rate="0";
$refund_call_back_param->refund_id="1231123";
$refund_call_back_param->refund_cost="0";
$refund_call_back_param->supplier_order_id="12345678";
$refund_call_back_param->ticket_no="EW123412";
$req->setRefundCallBackParam(json_encode($refund_call_back_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.refund' \
-d 'partner_id=apidoc' \
-d 'session=7df54b72-ce8c-4280-9175-52a9f35c7813' \
-d 'sign=4DD3CBDCFE2D2F23E7628D177A370383' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-23+15%3A59%3A42' \
-d 'v=2.0' \
-d 'refund_call_back_param=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripBtripSupplychainTrainCallbackRefundRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.refund_call_back_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.refund");
add_param(pRequest,"refund_call_back_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.refund', {
'refund_call_back_param':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})