TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelFastinvoiceCompleteRequest req = new XhotelFastinvoiceCompleteRequest();
XhotelFastinvoiceCompleteRequest.InvoiceInfoParam obj1 = new XhotelFastinvoiceCompleteRequest.InvoiceInfoParam();
obj1.setRequestId("0013231");
obj1.setInvoiceRoomPrice(100000L);
obj1.setTaxNum("10001991");
obj1.setInvoiceOtherPrice(20000L);
obj1.setInvoiceType(1L);
XhotelFastinvoiceCompleteRequest.ValueAddedInfo obj2 = new XhotelFastinvoiceCompleteRequest.ValueAddedInfo();
obj2.setTel("0571-12132232");
obj2.setRegisterAddr("杭州市余杭区和睦路1号");
obj2.setAccountNo("60012121");
obj2.setOpeningBank("中国人民银行");
obj2.setTaxNo("12234342");
obj1.setValueAddedInfo(obj2);
req.setInvoiceInfoParam(obj1);
XhotelFastinvoiceCompleteResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelFastinvoiceCompleteRequest req = new XhotelFastinvoiceCompleteRequest();
XhotelFastinvoiceCompleteRequest.InvoiceInfoParamDomain obj1 = new XhotelFastinvoiceCompleteRequest.InvoiceInfoParamDomain();
obj1.RequestId = "0013231";
obj1.InvoiceRoomPrice = 100000L;
obj1.TaxNum = "10001991";
obj1.InvoiceOtherPrice = 20000L;
obj1.InvoiceType = 1L;
XhotelFastinvoiceCompleteRequest.ValueAddedInfoDomain obj2 = new XhotelFastinvoiceCompleteRequest.ValueAddedInfoDomain();
obj2.Tel = "0571-12132232";
obj2.RegisterAddr = "杭州市余杭区和睦路1号";
obj2.AccountNo = "60012121";
obj2.OpeningBank = "中国人民银行";
obj2.TaxNo = "12234342";
obj1.ValueAddedInfo= obj2;
req.InvoiceInfoParam_ = obj1;
XhotelFastinvoiceCompleteResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelFastinvoiceCompleteRequest;
$invoice_info_param = new InvoiceInfoParam;
$invoice_info_param->request_id="0013231";
$invoice_info_param->invoice_room_price="100000";
$invoice_info_param->tax_num="10001991";
$invoice_info_param->invoice_other_price="20000";
$invoice_info_param->invoice_type="1";
$value_added_info = new ValueAddedInfo;
$value_added_info->tel="0571-12132232";
$value_added_info->register_addr="杭州市余杭区和睦路1号";
$value_added_info->account_no="60012121";
$value_added_info->opening_bank="中国人民银行";
$value_added_info->tax_no="12234342";
$invoice_info_param->value_added_info = $value_added_info;
$req->setInvoiceInfoParam(json_encode($invoice_info_param));
$resp = $c->execute($req);
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.fastinvoice.complete' \
-d 'partner_id=apidoc' \
-d 'sign=9105FBD8ED233BDABEB9602631DE88A3' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+19%3A51%3A04' \
-d 'v=2.0' \
-d 'invoice_info_param=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelFastinvoiceCompleteRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.invoice_info_param=""
try:
resp= req.getResponse()
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.fastinvoice.complete");
add_param(pRequest,"invoice_info_param","数据结构JSON示例");
pResponse = top_execute(pClient,pRequest,NULL);
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.fastinvoice.complete', {
'invoice_info_param':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})