常用快递API接口方案.doc常用快递API接口方案
常用快递API接口方案
1 / 16
常用快递API接口方案
可编辑可修改
常用快递 API 接口方案
电商企业从接收订单 - 配货 - 打印快递单到后期的快递员收件 - 快递配送 - 轨迹查询 - 签收
短信通知等,都需要快递接口的接入。整理目前较为常见的接口 demo如下:
对接流程:快递鸟网站申请接口—对接—联调测试—上线
预约取件 - 在线预约寄件
import
import
public class KdGoldAPIDemo {
....
return result;
}
/**
* MD5 加密
* ***@param str 内容
* ***@param charset 编码方式
* ***@throws Exception
*/
***@SuppressWarnings("unused")
private String MD5(String str, String charset) throws Exception {
MessageDigest md = ("MD5");
(charset));
byte[] result = ();
StringBuffer sb = new StringBuffer(32);
1
常用快递API接口方案
常用快递API接口方案
16 / 16
常用快递API接口方案
可编辑可修改
for (int i = 0; i < ; i++) {
int val = result[i] & 0xff;
if (val <= 0xf) {
("0");
}
(val));
}
return ().toLowerCase();
}
/**
* base64 编码
* ***@param str 内容
* ***@param charset 编码方式
* ***@throws UnsupportedEncodingException
*/
private String base64(String str, String charset) throws
UnsupportedEncodingException{
String encoded = (charset));
return encoded;
}
***@SuppressWarnings("unused")
private String urlEncoder(String str, String charset) throws
UnsupportedEncodingException{
String result = (str, charset);
return result;
常用快递API接口方案
常用快递API接口方案
3 / 16
常用快递API接口方案
2
常用快递API接口方案
常用快递API接口方案
16 / 16
常用快递API接口方案
可编辑可修改
}
/**
电商 Sign 签名生成
* ***@param content 内容
* ***@param keyValue Appkey
* ***@param charset 编码方式
* ***@throws UnsupportedEncodingException ,Exception
* ***@return DataSign 签名
*/
***@SuppressWarnings("unused")
private String encrypt (String content, String keyValue, String charset) throws
UnsupportedEncodingException, Exception
{
if (keyValue != null)
{
return base64(MD5(content + keyValue, c
常用快递API接口方案 来自淘豆网m.daumloan.com转载请标明出处.