PHP | <?php
require_once("../WdtClient.php");
$c = new WdtClient;
$c->sid = '';
$c->appkey = '';
$c->appsecret = '';
$c->gatewayUrl = 'http://sandbox.wangdian.cn/openapi2/vip_trade_batch_modify.php';
$trade_batch_info=array(
array(
"trade_no"=>"",
"logistics_code"=>"",
"logistics_no"=>"",
"invoice_no"=>"",
"cs_remark"=>"",
"print_remark"=>"",
"flag_cover"=>"",
"flag_name"=>"",
"remark_from"=>""
),
array(
"trade_no"=>"",
"logistics_code"=>"",
"logistics_no"=>"",
"invoice_no"=>"",
"cs_remark"=>"",
"print_remark"=>"",
"flag_cover"=>"",
"flag_name"=>"",
"remark_from"=>""
)
);
$c->putApiParam('trade_batch_info', json_encode($trade_batch_info, JSON_UNESCAPED_UNICODE));
$json = $c->wdtOpenApi();
var_dump($json);
?> |
JAVA | package com.wangdian.api.trade;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSON;
import com.wangdian.api.WdtClient;
public class VipTradeBatchModify {
public static void main(String[] args) {
// TODO Auto-generated method stub
WdtClient client = new WdtClient("传入sid", "传入appkey", "传入appsecret", "传入url");
//测试环境sid、appkey、密钥请到旺店通开放平台-自助对接-申请测试环境内查看,测试环境url=https://sandbox.wangdian.cn/openapi2/
//调用正式环境时请将sid、appkey、appsecret切换为实际参数,参数在旺店通开放平台-自助对接-应用管理内应用状态为已上线的应用中查看,调用正式环境注意切换正式环境url=https://api.wangdian.cn/openapi2/
List<Map<String, Object>> trade_batch_info = new ArrayList<Map<String, Object>>();
Map<String, Object> trade_batch_info_1 = new HashMap<String, Object>();
trade_batch_info_1.put("trade_no","JY202203090063");
trade_batch_info_1.put("cs_remark","JY202203160083");
trade_batch_info_1.put("flag_cover", 0);
trade_batch_info_1.put("remark_from", 0);
trade_batch_info.add(trade_batch_info_1);
Map<String, Object> trade_batch_info_2 = new HashMap<String, Object>();
trade_batch_info_2.put("trade_no","JY202203160083");
trade_batch_info_2.put("cs_remark","JY202203160083");
trade_batch_info_2.put("flag_cover", 0);
trade_batch_info_2.put("remark_from", 0);
trade_batch_info.add(trade_batch_info_2);
String trade_batch_info_json = JSON.toJSONString(trade_batch_info);
Map<String, String> params = new HashMap<String, String>();
params.put("trade_batch_info", trade_batch_info_json);
try {
String response = client.execute("vip_trade_batch_modify.php", params);
System.out.println(response);
} catch (IOException e) {
e.printStackTrace();
}
}
} |
C# | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WdtSdk;
namespace VipTradeBatchModify
{
class VipTradeBatchModify
{
static void Main(string[] args)
{
WdtClient client = new WdtClient();
client.sid = "";
client.appkey = "";
client.appsecret = "";
client.gatewayUrl = "http://sandbox.wangdian.cn/openapi2/vip_trade_batch_modify.php";
var trade_batch_info= new[]
{
trade_no= "dd456789876543",
print_remark= "备注测试",
};
string json = trade_batch_info.ToJsonString();
client.putParams("trade_batch_info", json);
string result = client.wdtOpenapi();
Console.WriteLine(result);
Console.ReadKey();
}
}
} |