TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TrainPurchaseOrderPayurlRequest req = new TrainPurchaseOrderPayurlRequest();
req.setPayType(1L);
req.setMainBizOrderId(123333333345L);
req.setPayChannel("union");
req.setBusinessType(1L);
req.setChangeApplyId(532585123123L);
TrainPurchaseOrderPayurlResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TrainPurchaseOrderPayurlRequest req = new TrainPurchaseOrderPayurlRequest();
req.PayType = 1L;
req.MainBizOrderId = 123333333345L;
req.PayChannel = "union";
req.BusinessType = 1L;
req.ChangeApplyId = 532585123123L;
TrainPurchaseOrderPayurlResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TrainPurchaseOrderPayurlRequest;
$req->setPayType("1");
$req->setMainBizOrderId("123333333345");
$req->setPayChannel("union");
$req->setBusinessType("1");
$req->setChangeApplyId("532585123123");
$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.train.purchase.order.payurl' \
-d 'partner_id=apidoc' \
-d 'session=a2f35731-aa12-45b7-9056-8d2f85cca888' \
-d 'sign=7CD0EC50C30F81EB709F354BC0E5E7B0' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-02+05%3A09%3A51' \
-d 'v=2.0' \
-d 'business_type=1' \
-d 'change_apply_id=532585123123' \
-d 'main_biz_order_id=123333333345' \
-d 'pay_channel=union' \
-d 'pay_type=1'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TrainPurchaseOrderPayurlRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.pay_type=1
req.main_biz_order_id=123333333345
req.pay_channel="union"
req.business_type=1
req.change_apply_id=532585123123
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.train.purchase.order.payurl");
add_param(pRequest,"pay_type","1");
add_param(pRequest,"main_biz_order_id","123333333345");
add_param(pRequest,"pay_channel","union");
add_param(pRequest,"business_type","1");
add_param(pRequest,"change_apply_id","532585123123");
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.train.purchase.order.payurl', {
'pay_type':'1',
'main_biz_order_id':'123333333345',
'pay_channel':'union',
'business_type':'1',
'change_apply_id':'532585123123'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})