TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelOrderAlipayfaceSettleRequest req = new XhotelOrderAlipayfaceSettleRequest();
req.setTid(12323L);
req.setTotalRoomFee(12300L);
req.setOtherFee(12300L);
req.setOtherFeeDetail("{\"洗衣费\":5000,\"水吧\":10000,\"优惠\":1000}");
req.setOutId("外部单号");
req.setRoomNo("12A");
req.setDailyPriceInfo("[{\"day\":\"2015-08-12\",\"price\":48800,\"taxAndFee\":1200},{\"day\":\"2015-08-13\",\"price\":48800,\"taxAndFee\":1200,\"basePrice\":1000}]");
req.setCheckOut(StringUtils.parseDateTime("2015-08-10 00:00:00"));
req.setMemo("\"客人要求提前离店\"");
List<XhotelOrderAlipayfaceSettleRequest.RoomSettleInfo> list2 = new ArrayList<XhotelOrderAlipayfaceSettleRequest.RoomSettleInfo>();
XhotelOrderAlipayfaceSettleRequest.RoomSettleInfo obj3 = new XhotelOrderAlipayfaceSettleRequest.RoomSettleInfo();
list2.add(obj3);
obj3.setRoomNo("123");
obj3.setRoomFee(500L);
obj3.setRoomOtherFee(12L);
obj3.setRoomOtherFeeDetail("{\"洗衣费\":5000,\"水吧\":10000,\"优惠\":1000}");
obj3.setRoomCheckIn(StringUtils.parseDateTime("2015-08-10 00:00:00"));
obj3.setRoomCheckOut(StringUtils.parseDateTime("2015-08-11 00:00:00"));
obj3.setDailyPriceInfo("[{\"day\":\"2015-08-12\",\"price\":48800,\"taxAndFee\":1200},{\"day\":\"2015-08-13\",\"price\":48800,\"taxAndFee\":1200,\"basePrice\":1000}]");
obj3.setRoomStatus("3");
req.setRoomSettleInfoList(list2);
req.setContainGuarantee(0L);
req.setPriceChange(0L);
req.setCurrencyCode("CNY");
req.setCurrencyRate("1.0");
req.setTaxAndFee(1200L);
req.setAmount(1200L);
req.setHotelCode("A1000");
XhotelOrderAlipayfaceSettleResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelOrderAlipayfaceSettleRequest req = new XhotelOrderAlipayfaceSettleRequest();
req.Tid = 12323L;
req.TotalRoomFee = 12300L;
req.OtherFee = 12300L;
req.OtherFeeDetail = "{\"洗衣费\":5000,\"水吧\":10000,\"优惠\":1000}";
req.OutId = "外部单号";
req.RoomNo = "12A";
req.DailyPriceInfo = "[{\"day\":\"2015-08-12\",\"price\":48800,\"taxAndFee\":1200},{\"day\":\"2015-08-13\",\"price\":48800,\"taxAndFee\":1200,\"basePrice\":1000}]";
req.CheckOut = DateTime.Parse("2015-08-10 00:00:00");
req.Memo = "\"客人要求提前离店\"";
List<XhotelOrderAlipayfaceSettleRequest.RoomSettleInfoDomain> list2 = new List<XhotelOrderAlipayfaceSettleRequest.RoomSettleInfoDomain>();
XhotelOrderAlipayfaceSettleRequest.RoomSettleInfoDomain obj3 = new XhotelOrderAlipayfaceSettleRequest.RoomSettleInfoDomain();
list2.Add(obj3);
obj3.RoomNo = "123";
obj3.RoomFee = 500L;
obj3.RoomOtherFee = 12L;
obj3.RoomOtherFeeDetail = "{\"洗衣费\":5000,\"水吧\":10000,\"优惠\":1000}";
obj3.RoomCheckIn = DateTime.Parse(2015-08-10 00:00:00");
obj3.RoomCheckOut = DateTime.Parse(2015-08-11 00:00:00");
obj3.DailyPriceInfo = "[{\"day\":\"2015-08-12\",\"price\":48800,\"taxAndFee\":1200},{\"day\":\"2015-08-13\",\"price\":48800,\"taxAndFee\":1200,\"basePrice\":1000}]";
obj3.RoomStatus = "3";
req.RoomSettleInfoList_ = list2;
req.ContainGuarantee = 0L;
req.PriceChange = 0L;
req.CurrencyCode = "CNY";
req.CurrencyRate = "1.0";
req.TaxAndFee = 1200L;
req.Amount = 1200L;
req.HotelCode = "A1000";
XhotelOrderAlipayfaceSettleResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelOrderAlipayfaceSettleRequest;
$req->setTid("12323");
$req->setTotalRoomFee("12300");
$req->setOtherFee("12300");
$req->setOtherFeeDetail("{\"洗衣费\":5000,\"水吧\":10000,\"优惠\":1000}");
$req->setOutId("外部单号");
$req->setRoomNo("12A");
$req->setDailyPriceInfo("[{\"day\":\"2015-08-12\",\"price\":48800,\"taxAndFee\":1200},{\"day\":\"2015-08-13\",\"price\":48800,\"taxAndFee\":1200,\"basePrice\":1000}]");
$req->setCheckOut("2015-08-10 00:00:00");
$req->setMemo("\"客人要求提前离店\"");
$room_settle_info_list = new RoomSettleInfo;
$room_settle_info_list->room_no="123";
$room_settle_info_list->room_fee="500";
$room_settle_info_list->room_other_fee="12";
$room_settle_info_list->room_other_fee_detail="{\"洗衣费\":5000,\"水吧\":10000,\"优惠\":1000}";
$room_settle_info_list->room_check_in="2015-08-10 00:00:00";
$room_settle_info_list->room_check_out="2015-08-11 00:00:00";
$room_settle_info_list->daily_price_info="[{\"day\":\"2015-08-12\",\"price\":48800,\"taxAndFee\":1200},{\"day\":\"2015-08-13\",\"price\":48800,\"taxAndFee\":1200,\"basePrice\":1000}]";
$room_settle_info_list->room_status="3";
$req->setRoomSettleInfoList(json_encode($room_settle_info_list));
$req->setContainGuarantee("0");
$req->setPriceChange("0");
$req->setCurrencyCode("CNY");
$req->setCurrencyRate("1.0");
$req->setTaxAndFee("1200");
$req->setAmount("1200");
$req->setHotelCode("A1000");
$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.xhotel.order.alipayface.settle' \
-d 'partner_id=apidoc' \
-d 'session=5fa0d8dc-5ac1-418b-8e8c-deeff40fb829' \
-d 'sign=73300D9D64A02A44928C91A11833BE84' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+23%3A52%3A10' \
-d 'v=2.0' \
-d 'amount=1200' \
-d 'check_out=2015-08-10+00%3A00%3A00' \
-d 'contain_guarantee=0' \
-d 'currency_code=CNY' \
-d 'currency_rate=1.0' \
-d 'daily_price_info=%7B%22day%22%3A%222015-08-12%22%2C%22price%22%3A48800%2C%22taxAndFee%22%3A1200%7D%2C%7B%22day%22%3A%222015-08-13%22%2C%22price%22%3A48800%2C%22taxAndFee%22%3A1200%2C%22basePrice%22%3A1000%7D' \
-d 'hotel_code=A1000' \
-d 'memo=%5C%22%E5%AE%A2%E4%BA%BA%E8%A6%81%E6%B1%82%E6%8F%90%E5%89%8D%E7%A6%BB%E5%BA%97%5C%22' \
-d 'other_fee=12300' \
-d 'other_fee_detail=%7B%5C%22%E6%B4%97%E8%A1%A3%E8%B4%B9%5C%22%3A5000%2C%5C%22%E6%B0%B4%E5%90%A7%5C%22%3A10000%2C%5C%22%E4%BC%98%E6%83%A0%5C%22%3A1000%7D' \
-d 'out_id=%E5%A4%96%E9%83%A8%E5%8D%95%E5%8F%B7' \
-d 'price_change=0' \
-d 'room_no=12A' \
-d 'room_settle_info_list=null' \
-d 'tax_and_fee=1200' \
-d 'tid=12323' \
-d 'total_room_fee=12300'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelOrderAlipayfaceSettleRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.tid=12323
req.total_room_fee=12300
req.other_fee=12300
req.other_fee_detail="{\"洗衣费\":5000,\"水吧\":10000,\"优惠\":1000}"
req.out_id="外部单号"
req.room_no="12A"
req.daily_price_info="[{\"day\":\"2015-08-12\",\"price\":48800,\"taxAndFee\":1200},{\"day\":\"2015-08-13\",\"price\":48800,\"taxAndFee\":1200,\"basePrice\":1000}]"
req.check_out="2015-08-10 00:00:00"
req.memo="\"客人要求提前离店\""
req.room_settle_info_list=""
req.contain_guarantee=0
req.price_change=0
req.currency_code="CNY"
req.currency_rate="1.0"
req.tax_and_fee=1200
req.amount=1200
req.hotel_code="A1000"
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.xhotel.order.alipayface.settle");
add_param(pRequest,"tid","12323");
add_param(pRequest,"total_room_fee","12300");
add_param(pRequest,"other_fee","12300");
add_param(pRequest,"other_fee_detail","{\"洗衣费\":5000,\"水吧\":10000,\"优惠\":1000}");
add_param(pRequest,"out_id","外部单号");
add_param(pRequest,"room_no","12A");
add_param(pRequest,"daily_price_info","{"day":"2015-08-12","price":48800,"taxAndFee":1200},{"day":"2015-08-13","price":48800,"taxAndFee":1200,"basePrice":1000}");
add_param(pRequest,"check_out","2015-08-10 00:00:00");
add_param(pRequest,"memo","\"客人要求提前离店\"");
add_param(pRequest,"room_settle_info_list","数据结构JSON示例");
add_param(pRequest,"contain_guarantee","0");
add_param(pRequest,"price_change","0");
add_param(pRequest,"currency_code","CNY");
add_param(pRequest,"currency_rate","1.0");
add_param(pRequest,"tax_and_fee","1200");
add_param(pRequest,"amount","1200");
add_param(pRequest,"hotel_code","A1000");
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.xhotel.order.alipayface.settle', {
'tid':'12323',
'total_room_fee':'12300',
'other_fee':'12300',
'other_fee_detail':'{\"洗衣费\":5000,\"水吧\":10000,\"优惠\":1000}',
'out_id':'外部单号',
'room_no':'12A',
'daily_price_info':'{"day":"2015-08-12","price":48800,"taxAndFee":1200},{"day":"2015-08-13","price":48800,"taxAndFee":1200,"basePrice":1000}',
'check_out':'2015-08-10 00:00:00',
'memo':'\"客人要求提前离店\"',
'room_settle_info_list':'数据结构JSON示例',
'contain_guarantee':'0',
'price_change':'0',
'currency_code':'CNY',
'currency_rate':'1.0',
'tax_and_fee':'1200',
'amount':'1200',
'hotel_code':'A1000'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})