TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelInvoicePrintRequest req = new XhotelInvoicePrintRequest();
req.setPrintInvioce("{ \"connectionCode\": \"123456\", \"digitalCertificatePassword\": \"12345678\", \"equipmentType\": 1, \"invioceCode\": \"1110000478\", \"invioceNo\": \"42180181\", \"invioceSerialNo\": null, \"invioceSiteCode\": \"kaipd001\", \"invioceTypeCode\": \"007\", \"printMode\": 1, \"printType\": 0, \"taxDiskNo\": \"499000150418\", \"taxDiskPassword\": \"88880000\", \"taxPayerID\": \"91500000747150000A\"}");
XhotelInvoicePrintResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelInvoicePrintRequest req = new XhotelInvoicePrintRequest();
req.PrintInvioce = "{ \"connectionCode\": \"123456\", \"digitalCertificatePassword\": \"12345678\", \"equipmentType\": 1, \"invioceCode\": \"1110000478\", \"invioceNo\": \"42180181\", \"invioceSerialNo\": null, \"invioceSiteCode\": \"kaipd001\", \"invioceTypeCode\": \"007\", \"printMode\": 1, \"printType\": 0, \"taxDiskNo\": \"499000150418\", \"taxDiskPassword\": \"88880000\", \"taxPayerID\": \"91500000747150000A\"}";
XhotelInvoicePrintResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelInvoicePrintRequest;
$req->setPrintInvioce("{ \"connectionCode\": \"123456\", \"digitalCertificatePassword\": \"12345678\", \"equipmentType\": 1, \"invioceCode\": \"1110000478\", \"invioceNo\": \"42180181\", \"invioceSerialNo\": null, \"invioceSiteCode\": \"kaipd001\", \"invioceTypeCode\": \"007\", \"printMode\": 1, \"printType\": 0, \"taxDiskNo\": \"499000150418\", \"taxDiskPassword\": \"88880000\", \"taxPayerID\": \"91500000747150000A\"}");
$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.invoice.print' \
-d 'partner_id=apidoc' \
-d 'session=c1cf5ff0-c6dc-4ad9-88bc-9e3deac3e04c' \
-d 'sign=96CBE7E604963E3B928DEE7AF2C42696' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+19%3A29%3A44' \
-d 'v=2.0' \
-d 'print_invioce=%7B+%5C%22connectionCode%5C%22%3A+%5C%22123456%5C%22%2C+%5C%22digitalCertificatePassword%5C%22%3A+%5C%2212345678%5C%22%2C+%5C%22equipmentType%5C%22%3A+1%2C+%5C%22invioceCode%5C%22%3A+%5C%221110000478%5C%22%2C+%5C%22invioceNo%5C%22%3A+%5C%2242180181%5C%22%2C+%5C%22invioceSerialNo%5C%22%3A+null%2C+%5C%22invioceSiteCode%5C%22%3A+%5C%22kaipd001%5C%22%2C+%5C%22invioceTypeCode%5C%22%3A+%5C%22007%5C%22%2C+%5C%22printMode%5C%22%3A+1%2C+%5C%22printType%5C%22%3A+0%2C+%5C%22taxDiskNo%5C%22%3A+%5C%22499000150418%5C%22%2C+%5C%22taxDiskPassword%5C%22%3A+%5C%2288880000%5C%22%2C+%5C%22taxPayerID%5C%22%3A+%5C%2291500000747150000A%5C%22%7D'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelInvoicePrintRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.print_invioce="{ \"connectionCode\": \"123456\", \"digitalCertificatePassword\": \"12345678\", \"equipmentType\": 1, \"invioceCode\": \"1110000478\", \"invioceNo\": \"42180181\", \"invioceSerialNo\": null, \"invioceSiteCode\": \"kaipd001\", \"invioceTypeCode\": \"007\", \"printMode\": 1, \"printType\": 0, \"taxDiskNo\": \"499000150418\", \"taxDiskPassword\": \"88880000\", \"taxPayerID\": \"91500000747150000A\"}"
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.invoice.print");
add_param(pRequest,"print_invioce","{ \"connectionCode\": \"123456\", \"digitalCertificatePassword\": \"12345678\", \"equipmentType\": 1, \"invioceCode\": \"1110000478\", \"invioceNo\": \"42180181\", \"invioceSerialNo\": null, \"invioceSiteCode\": \"kaipd001\", \"invioceTypeCode\": \"007\", \"printMode\": 1, \"printType\": 0, \"taxDiskNo\": \"499000150418\", \"taxDiskPassword\": \"88880000\", \"taxPayerID\": \"91500000747150000A\"}");
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.invoice.print', {
'print_invioce':'{ \"connectionCode\": \"123456\", \"digitalCertificatePassword\": \"12345678\", \"equipmentType\": 1, \"invioceCode\": \"1110000478\", \"invioceNo\": \"42180181\", \"invioceSerialNo\": null, \"invioceSiteCode\": \"kaipd001\", \"invioceTypeCode\": \"007\", \"printMode\": 1, \"printType\": 0, \"taxDiskNo\": \"499000150418\", \"taxDiskPassword\": \"88880000\", \"taxPayerID\": \"91500000747150000A\"}'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})