拼多多需要服务商自己实现加签接口,只需要data_to_sign,对data_to_sign字段中的值实现加签
string datasign = JsonConvert.SerializeObject(request["data_to_sign"]);
string sgin = SignHelper.SignatureValue(JsonConvert.SerializeObject(request["data_to_sign"])).Item1;
jObject["response_code"] = 1;
jObject["response_msg"] = "加签成功。";
jObject["signature"] = sgin;
return jObject;
public static Tuple<string, string> SignatureValue(string xmlValue, bool isKeyInfo = false)
{
State state = WebSocketSign(xmlValue);
JObject jObject = JObject.Parse(state.Data);
JArray jArray = jObject["Data"].ToObject<JArray>();
string keyName = null;
if (isKeyInfo)
keyName = jArray[1].ToString();
return Tuple.Create(jArray[0].ToString(), keyName);
}
具体加签实现:记:.net 海关179自行加签方法_q1606671375的博客-CSDN博客