TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaNlifeB2cTradePayRequest req = new AlibabaNlifeB2cTradePayRequest();
req.setTradeNo("10000400000000045678");
List<AlibabaNlifeB2cTradePayRequest.FundBill> list2 = new ArrayList<AlibabaNlifeB2cTradePayRequest.FundBill>();
AlibabaNlifeB2cTradePayRequest.FundBill obj3 = new AlibabaNlifeB2cTradePayRequest.FundBill();
list2.add(obj3);
obj3.setId("2017022837483658463");
obj3.setType("ALIPAY");
obj3.setBuyerId("294344535");
obj3.setBuyerIdType("ALIPAY_OPENID");
obj3.setTitle("支付宝支付");
obj3.setAmount(180L);
obj3.setCurrency("CNY");
obj3.setExtendParams("{\"k1\":v1;\"k2\":v2}");
obj3.setAttachment("gender:female");
req.setFundBillList(list2);
req.setPickingUp("SELF_DELIVERY");
req.setConsignee("孙悟空");
req.setConsigneePhoneNum("0571-85022088");
req.setConsigneeAddress("阿里巴巴西溪园区");
req.setGmtPayment(StringUtils.parseDateTime("2017-01-20 13:00:00"));
req.setOutTradeNo("OT4392057438956");
req.setActualPayFee(5000L);
req.setStoreId("10004");
AlibabaNlifeB2cTradePayResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaNlifeB2cTradePayRequest req = new AlibabaNlifeB2cTradePayRequest();
req.TradeNo = "10000400000000045678";
List<AlibabaNlifeB2cTradePayRequest.FundBillDomain> list2 = new List<AlibabaNlifeB2cTradePayRequest.FundBillDomain>();
AlibabaNlifeB2cTradePayRequest.FundBillDomain obj3 = new AlibabaNlifeB2cTradePayRequest.FundBillDomain();
list2.Add(obj3);
obj3.Id = "2017022837483658463";
obj3.Type = "ALIPAY";
obj3.BuyerId = "294344535";
obj3.BuyerIdType = "ALIPAY_OPENID";
obj3.Title = "支付宝支付";
obj3.Amount = 180L;
obj3.Currency = "CNY";
obj3.ExtendParams = "{\"k1\":v1;\"k2\":v2}";
obj3.Attachment = "gender:female";
req.FundBillList_ = list2;
req.PickingUp = "SELF_DELIVERY";
req.Consignee = "孙悟空";
req.ConsigneePhoneNum = "0571-85022088";
req.ConsigneeAddress = "阿里巴巴西溪园区";
req.GmtPayment = DateTime.Parse("2017-01-20 13:00:00");
req.OutTradeNo = "OT4392057438956";
req.ActualPayFee = 5000L;
req.StoreId = "10004";
AlibabaNlifeB2cTradePayResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaNlifeB2cTradePayRequest;
$req->setTradeNo("10000400000000045678");
$fund_bill_list = new FundBill;
$fund_bill_list->id="2017022837483658463";
$fund_bill_list->type="ALIPAY";
$fund_bill_list->buyer_id="294344535";
$fund_bill_list->buyer_id_type="ALIPAY_OPENID";
$fund_bill_list->title="支付宝支付";
$fund_bill_list->amount="180";
$fund_bill_list->currency="CNY";
$fund_bill_list->extend_params="{\"k1\":v1;\"k2\":v2}";
$fund_bill_list->attachment="gender:female";
$req->setFundBillList(json_encode($fund_bill_list));
$req->setPickingUp("SELF_DELIVERY");
$req->setConsignee("孙悟空");
$req->setConsigneePhoneNum("0571-85022088");
$req->setConsigneeAddress("阿里巴巴西溪园区");
$req->setGmtPayment("2017-01-20 13:00:00");
$req->setOutTradeNo("OT4392057438956");
$req->setActualPayFee("5000");
$req->setStoreId("10004");
$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=alibaba.nlife.b2c.trade.pay' \
-d 'partner_id=apidoc' \
-d 'session=6fa44497-8a33-4d41-859d-1ff5982017aa' \
-d 'sign=62041FE5D1D8D4A955C9C7E34BFA4946' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-04+16%3A15%3A37' \
-d 'v=2.0' \
-d 'actual_pay_fee=5000' \
-d 'consignee=%E5%AD%99%E6%82%9F%E7%A9%BA' \
-d 'consignee_address=%E9%98%BF%E9%87%8C%E5%B7%B4%E5%B7%B4%E8%A5%BF%E6%BA%AA%E5%9B%AD%E5%8C%BA' \
-d 'consignee_phone_num=0571-85022088' \
-d 'fund_bill_list=null' \
-d 'gmt_payment=2017-01-20+13%3A00%3A00' \
-d 'out_trade_no=OT4392057438956' \
-d 'picking_up=SELF_DELIVERY' \
-d 'store_id=10004' \
-d 'trade_no=10000400000000045678'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaNlifeB2cTradePayRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.trade_no="10000400000000045678"
req.fund_bill_list=""
req.picking_up="SELF_DELIVERY"
req.consignee="孙悟空"
req.consignee_phone_num="0571-85022088"
req.consignee_address="阿里巴巴西溪园区"
req.gmt_payment="2017-01-20 13:00:00"
req.out_trade_no="OT4392057438956"
req.actual_pay_fee=5000
req.store_id="10004"
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,"alibaba.nlife.b2c.trade.pay");
add_param(pRequest,"trade_no","10000400000000045678");
add_param(pRequest,"fund_bill_list","数据结构JSON示例");
add_param(pRequest,"picking_up","SELF_DELIVERY");
add_param(pRequest,"consignee","孙悟空");
add_param(pRequest,"consignee_phone_num","0571-85022088");
add_param(pRequest,"consignee_address","阿里巴巴西溪园区");
add_param(pRequest,"gmt_payment","2017-01-20 13:00:00");
add_param(pRequest,"out_trade_no","OT4392057438956");
add_param(pRequest,"actual_pay_fee","5000");
add_param(pRequest,"store_id","10004");
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('alibaba.nlife.b2c.trade.pay', {
'trade_no':'10000400000000045678',
'fund_bill_list':'数据结构JSON示例',
'picking_up':'SELF_DELIVERY',
'consignee':'孙悟空',
'consignee_phone_num':'0571-85022088',
'consignee_address':'阿里巴巴西溪园区',
'gmt_payment':'2017-01-20 13:00:00',
'out_trade_no':'OT4392057438956',
'actual_pay_fee':'5000',
'store_id':'10004'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})