TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AliyunAliosPayTokenGetRequest req = new AliyunAliosPayTokenGetRequest();
AliyunAliosPayTokenGetRequest.GetTokenRequest obj1 = new AliyunAliosPayTokenGetRequest.GetTokenRequest();
obj1.setOriginalAmount(888L);
obj1.setTraceId("0b0aad0e15441575065206212d0756");
obj1.setTokenType("ORDER");
obj1.setDiscountableAmount(888L);
obj1.setTotalAmount(888L);
obj1.setSubject("虾米音乐数字专辑");
obj1.setBizOrderId("格式由cp自行决定");
obj1.setTime("1559200938392");
obj1.setLang("en");
obj1.setPeriodRuleParams("{\"external_period_agreement_code\": \"VIP_RENEWAL\",\"period_type\": \"DAY\",\"period\": 3,\"period_execute_time\": \"20211201\",\"period_single_amount\": 888,\"period_total_amount\": 8888,\"period_total_payments\": 10}");
obj1.setServiceProtocol("HTTPS");
obj1.setPeriodSignNotifyUrl("www.tianmaoyangche.com/notify");
obj1.setPeriodUnsignNotifyUrl("www.tianmaoyangche.com/notify");
obj1.setPayNotifyUrl("www.tianmaoyangche.com/notify");
req.setGetTokenRequest(obj1);
AliyunAliosPayTokenGetResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AliyunAliosPayTokenGetRequest req = new AliyunAliosPayTokenGetRequest();
AliyunAliosPayTokenGetRequest.GetTokenRequestDomain obj1 = new AliyunAliosPayTokenGetRequest.GetTokenRequestDomain();
obj1.OriginalAmount = 888L;
obj1.TraceId = "0b0aad0e15441575065206212d0756";
obj1.TokenType = "ORDER";
obj1.DiscountableAmount = 888L;
obj1.TotalAmount = 888L;
obj1.Subject = "虾米音乐数字专辑";
obj1.BizOrderId = "格式由cp自行决定";
obj1.Time = "1559200938392";
obj1.Lang = "en";
obj1.PeriodRuleParams = "{\"external_period_agreement_code\": \"VIP_RENEWAL\",\"period_type\": \"DAY\",\"period\": 3,\"period_execute_time\": \"20211201\",\"period_single_amount\": 888,\"period_total_amount\": 8888,\"period_total_payments\": 10}";
obj1.ServiceProtocol = "HTTPS";
obj1.PeriodSignNotifyUrl = "www.tianmaoyangche.com/notify";
obj1.PeriodUnsignNotifyUrl = "www.tianmaoyangche.com/notify";
obj1.PayNotifyUrl = "www.tianmaoyangche.com/notify";
req.GetTokenRequest_ = obj1;
AliyunAliosPayTokenGetResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AliyunAliosPayTokenGetRequest;
$get_token_request = new GetTokenRequest;
$get_token_request->original_amount="888";
$get_token_request->trace_id="0b0aad0e15441575065206212d0756";
$get_token_request->token_type="ORDER";
$get_token_request->discountable_amount="888";
$get_token_request->total_amount="888";
$get_token_request->subject="虾米音乐数字专辑";
$get_token_request->biz_order_id="格式由cp自行决定";
$get_token_request->time="1559200938392";
$get_token_request->lang="en";
$get_token_request->period_rule_params="{\"external_period_agreement_code\": \"VIP_RENEWAL\",\"period_type\": \"DAY\",\"period\": 3,\"period_execute_time\": \"20211201\",\"period_single_amount\": 888,\"period_total_amount\": 8888,\"period_total_payments\": 10}";
$get_token_request->service_protocol="HTTPS";
$get_token_request->period_sign_notify_url="www.tianmaoyangche.com/notify";
$get_token_request->period_unsign_notify_url="www.tianmaoyangche.com/notify";
$get_token_request->pay_notify_url="www.tianmaoyangche.com/notify";
$req->setGetTokenRequest(json_encode($get_token_request));
$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=aliyun.alios.pay.token.get' \
-d 'partner_id=apidoc' \
-d 'sign=221CB80C6598BB6996F4B1258383B067' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-07-23+16%3A16%3A20' \
-d 'v=2.0' \
-d 'get_token_request=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AliyunAliosPayTokenGetRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.get_token_request=""
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,"aliyun.alios.pay.token.get");
add_param(pRequest,"get_token_request","数据结构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('aliyun.alios.pay.token.get', {
'get_token_request':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})