跳转到: 导航, 搜索
第17行: 第17行:
  
  
<div class="code_type">签名方法示例PHP</div>
+
 
 +
<div class="code_type">签名方法示例(PHP)</div>
 
<pre class="brush:js">
 
<pre class="brush:js">
 
public static function getSign($data_list, $key, $filter_k_list = ["sign", "sign_type", "access_token",], $filter_v_list = ["",]) {
 
public static function getSign($data_list, $key, $filter_k_list = ["sign", "sign_type", "access_token",], $filter_v_list = ["",]) {
第53行: 第54行:
 
<table class="wiki_table" border="0" cellspacing="0" cellpadding="0" style="width:100%">
 
<table class="wiki_table" border="0" cellspacing="0" cellpadding="0" style="width:100%">
 
<tr>
 
<tr>
<th class="wiki_table_thfirst" style="width:180px">接口  
+
<th class="wiki_table_thfirst" style="width:180px">接口</th>
</th><th>说明
+
<th>说明</th>
</th></tr>
+
</tr>
 +
<tr>
 +
<td class="wiki_table_tdfirst">[[2/proxy/eshop/open/order/retailerGetSubList|order/retailerGetSubList]]</td>
 +
<td>获取子订单列表Token</td>
 +
</tr>
 +
<tr>
 +
<td class="wiki_table_tdfirst">[[2/proxy/eshop/open/order/retailerGetSub|order/retailerGetSub]]</td>
 +
<td>获取子订单详情</td>
 +
</tr>
 
<tr>
 
<tr>
<td class="wiki_table_tdfirst">[[Oauth2/authorize|OAuth2/authorize]]
+
<td class="wiki_table_tdfirst">[[2/proxy/eshop/open/order/retailerAddExpress|order/retailerAddExpress]]</td>
</td><td>请求授权Token
+
<td>提交发货</td>
</td></tr>
+
</tr>
 
<tr>
 
<tr>
<td class="wiki_table_tdfirst">[[Oauth2/access_token|OAuth2/access_token]]
+
<td class="wiki_table_tdfirst">[[2/proxy/eshop/open/order/retailerSetReceiverInfo|order/retailerSetReceiverInfo]]</td>
</td><td>获取授权过的access_token
+
<td>修改收货人信息</td>
</td></tr>
+
</tr>
 
<tr>
 
<tr>
<td class="wiki_table_tdfirst">[[Oauth2/get_token_info|OAuth2/get_token_info]]
+
<td class="wiki_table_tdfirst">[[2/proxy/eshop/open/order/retailerSetRetailerRemark|order/retailerSetRetailerRemark]]</td>
</td><td>授权信息查询接口
+
<td>修改商家备注信息</td>
</td></tr>
+
</tr>
 
</table>
 
</table>
 
</div>
 
</div>
第82行: 第91行:
 
<table class="wiki_table" border="0" cellspacing="0" cellpadding="0" style="width:100%">
 
<table class="wiki_table" border="0" cellspacing="0" cellpadding="0" style="width:100%">
 
<tr>
 
<tr>
<th class="wiki_table_thfirst" style="width:180px">接口  
+
<th class="wiki_table_thfirst" style="width:180px">接口</th>
</th><th>说明
+
<th>说明</th>
</th></tr>
+
</tr>
 
<tr>
 
<tr>
<td class="wiki_table_tdfirst">[[Oauth2/authorize|OAuth2/authorize]]
+
<td class="wiki_table_tdfirst">[[Oauth2/authorize|OAuth2/authorize]]</td>
</td><td>请求授权Token
+
<td>请求授权Token</td>
</td></tr>
+
</tr>
 
<tr>
 
<tr>
<td class="wiki_table_tdfirst">[[Oauth2/access_token|OAuth2/access_token]]
+
<td class="wiki_table_tdfirst">[[Oauth2/access_token|OAuth2/access_token]]</td>
</td><td>获取授权过的access_token
+
<td>获取授权过的access_token</td>
</td></tr>
+
</tr>
 
<tr>
 
<tr>
<td class="wiki_table_tdfirst">[[Oauth2/get_token_info|OAuth2/get_token_info]]
+
<td class="wiki_table_tdfirst">[[Oauth2/get_token_info|OAuth2/get_token_info]]</td>
</td><td>授权信息查询接口
+
<td>授权信息查询接口</td>
</td></tr>
+
</tr>
 
</table>
 
</table>
 
</div>
 
</div>

2022年9月5日 (一) 15:38的版本

电商服务商平台能力接口

提供给电商服务商的平台能力,目前包含订单能力接口、商品能力接口。


电商服务商接口验证签名

调用电商服务商接口需带上验证签名的sign参数,其生成方法为:将调用接口的参数,过滤掉不参与签名的参数后,按照键名进行升序排序,之后转换为URL查询字符串(querystring),并在结尾拼接上秘钥(appkey 对应的 app secret),最后将得到的字符串进行md5,得到最终的sign值。


不参与签名的参数,参数名为sign、sign_type、access_token的参数,和参数值为空字符串的参数。


签名方法示例(PHP)
public static function getSign($data_list, $key, $filter_k_list = ["sign", "sign_type", "access_token",], $filter_v_list = ["",]) {
    // 过滤不参与签名的参数
    foreach ($data_list as $k => $v) {
        if (in_array($k, $filter_k_list, true) || in_array($v, $filter_v_list, true)) {
            unset($data_list[$k]);
        }
    }
    // 进行排序
    ksort($data_list);
    // 转换为查询字符串,注意过滤前后空格
    $parameter = [];
    foreach ($data_list as $k => $v) {
        $parameter[] = $k . "=" . trim($v);
    }
    $string = implode("&", $parameter);
    // 拼接密钥
    $stringKey = $string . $key;
    // 进行MD5得到最终签名
    $sign = md5($stringKey);
    return $sign;
}


订单能力接口

订单业务相关的接口,详细见接口列表:

接口 说明
order/retailerGetSubList 获取子订单列表Token
order/retailerGetSub 获取子订单详情
order/retailerAddExpress 提交发货
order/retailerSetReceiverInfo 修改收货人信息
order/retailerSetRetailerRemark 修改商家备注信息


商品能力接口

商品业务相关的接口,详细见接口列表:

接口 说明
OAuth2/authorize 请求授权Token
OAuth2/access_token 获取授权过的access_token
OAuth2/get_token_info 授权信息查询接口


附录