淘宝API 中文sign问题

showbao 2012-08-27 11:02:14
备注为英文时能正常调用,备注为中文的时候出错:<?xml version="1.0" encoding="utf-8" ?><error_response><code>25</code><msg>Invalid signature</msg></error_response><!--top050061.cm4-->


望各位知道的大哥指点下,问题在什么地方????


Public Function TRADES_MemoUpdate(ByVal AppKey As String, ByVal AppSevret As String, ByVal Session As String, _
ByVal Tid As String, Optional ByVal Memo As String = "", Optional ByVal Flag As Long = 0, Optional ByVal Reset As Boolean = False) As String
'本函数:修改一笔交易备注
Dim TaobaoAPIBasic As New TaobaoAPI_BasicModule.BasicClass
Dim sURL, sTmp, Sign, strStatus, Api_Type As String
Dim Url_Str As String
Api_Type = Trim(APITypeStr(8))'//taobao.trade.memo.update

Url_Str = Url_Str & "×tamp=" & Format(Now, "yyyy-MM-dd HH:mm:ss") ' UCase(TaobaoAPIBasic.GB2UTF8(Format(Now, "yyyy-MM-dd HH:mm:ss")))
Url_Str = Url_Str & "&v=2.0"

TRADES_MemoUpdate = ""

If Trim(AppKey) = "" Then
TRADES_MemoUpdate = "[ERR_XXTS]" & "不能缺少AppKey!"
Exit Function
Else
Url_Str = Url_Str & "&app_key=" & AppKey
End If

Url_Str = Url_Str & "&method=" & Api_Type
Url_Str = Url_Str & "&partner_id=top-apitools"
Url_Str = Url_Str & "&session=" & Session
Url_Str = Url_Str & "&format=xml"


Url_Str = Url_Str & "&memo=" & UCase(TaobaoAPIBasic.GB2UTF8(Memo))
' Url_Str = Url_Str & "&flag=" & Flag
' Url_Str = Url_Str & "&reset=true"


If Trim(Tid) = "" Then
TRADES_MemoUpdate = "[ERR_XXTS]" & "不能缺少Tid!"
Exit Function
Else
Url_Str = Url_Str & "&tid=" & Tid
End If

sTmp = StringSort(Url_Str) '把字符串按淘宝规则排序
Sign = UCase(TaobaoAPIBasic.GenMD5(AppSevret & sTmp)) 'MD5(Secret & sTmp) '生成淘宝sign
sURL = "http://gw.api.taobao.com/router/rest?" & "sign=" & Sign & Url_Str '生成后的淘宝URL

TRADES_MemoUpdate = PostURL(sURL, "")


End Function
...全文
367 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
showbao 2012-08-27
  • 打赏
  • 举报
回复
拼接后的链接:http://gw.api.taobao.com/router/rest?sign=BC088B0BE2037455C73269D0CF980413×tamp=2012-08-27 23:13:14&v=2.0&app_key=21073568&method=taobao.trade.memo.update&partner_id=top-apitools&session=6102015c2203a5e7d18c7e01f415134560982vfg58919&format=xml&memo=%E6%81%B6%E6%84%8F%E6%8B%8D&tid=210968764682894

备注内容:恶意拍

1,451

社区成员

发帖
与我相关
我的任务
社区描述
VB 控件
社区管理员
  • 控件
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧