Tmall发送码asp验证sing(自有码开发)
<%
'
'查询通知应答类
'============================================================================
'api说明:
'getKey()/setKey(),获取/设置密钥
'getParameter()/setParameter(),获取/设置参数值
'getAllParameters(),获取所有参数
'isTenpaySign(),是否财付通签名,true:是 false:否
'getDebugInfo(),获取debug信息
'
'============================================================================
'
Class TmallResponseHandler
'密钥
Private key
'应答的参数
Private parameters
'debug信息
Private debugInfo
'初始构造函数
Private Sub class_initialize()
key = ""
Set parameters = Server.CreateObject("Scripting.Dictionary")
debugInfo = ""
parameters.RemoveAll
'GET
For Each k In Request.QueryString
v = Request.QueryString(k)
setParameter k,v
Next
'POST
For Each k In Request.Form
v = Request(k)
setParameter k,v
Next
End Sub
'获取密钥
Public Function getKey()
getKey = key
End Function
'设置密钥
Public Function setKey(key_)
key = key_
End Function
'获取参数值
Public Function getParameter(parameter)
getParameter = parameters.Item(parameter)
End Function
'设置参数值
Public Sub setParameter(parameter, parameterValue)
If parameters.Exists(parameter) = True Then
parameters.Remove(parameter)
End If
parameters.Add parameter, parameterValue
End Sub
'获取所有请求的参数,返回Scripting.Dictionary
Public Function getAllParameters()
getAllParameters = parameters
End Function
'是否Tmall签名
'true:是 false:否
Public Function isTamllSign()
timestamp = getParameter("timestamp")
order_id = getParameter("order_id")
mobile = getParameter("mobile")
num = getParameter("num")
method = getParameter("method")
taobao_sid = getParameter("taobao_sid")
seller_nick = getParameter("seller_nick")
item_title = getParameter("item_title")
send_type = getParameter("send_type")
consume_type = getParameter("consume_type")
sms_template = getParameter("sms_template")
valid_start = getParameter("valid_start")
valid_ends = getParameter("valid_ends")
num_iid = getParameter("num_iid")
outer_iid = getParameter("outer_iid")
sub_outer_iid = getParameter("sub_outer_iid")
sku_properties = getParameter("sku_properties")
token = getParameter("token")
total_fee = getParameter("total_fee")
weeks = getParameter("weeks")
left_num = getParameter("left_num")
'sign 不在能当道待加密的串里
signPars = Array("consume_type="&consume_type, "item_title="&item_title, "left_num="&left_num,"method="&method, "mobile=" & mobile,"num="&num, "num_iid="&num_iid, "order_id="&order_id,"outer_iid="&outer_iid, "seller_nick="&seller_nick, "send_type="&send_type, "sku_properties="&sku_properties , "sms_template="&sms_template, "sub_outer_iid="&sub_outer_iid,"taobao_sid="&taobao_sid, "timestamp="×tamp, "token="&token, "total_fee="&total_fee,"valid_ends="&valid_ends, "valid_start="&valid_start, "weeks=" & weeks)
Count=ubound(signPars)
'For i = Count TO 0 Step -1
' minmax = signPars( 0 )
' minmaxSlot = 0
' For j = 1 To i
' mark = (signPars( j ) > minmax)
' If mark Then
' minmax = signPars( j )
' minmaxSlot = j
' End If
' Next
' If minmaxSlot <> i Then
' temp = signPars( minmaxSlot )
' signPars( minmaxSlot ) = signPars( i )
' signPars( i ) = temp
' End If
' Next
For j = 0 To Count Step 1
value = SPLIT(signPars( j ), "=")
If value(1)<>"" then
param= param&value(0)&value(1)
End If
Next
inputkey = key¶m
Dim sign
sign= UCase(ASP_MD5(inputkey))
Dim tmallSign
tmallSign = UCase(getParameter("sign"))
'debugInfo
debugInfo = " => sign:" & sign & " TmallSign:" & tmallSign &" md5 "&ASP_MD5(inputkey)&" md5str "&inputkey
isTamllSign = (sign = tmallSign)
End Function
'获取debug信息
Function getDebugInfo()
getDebugInfo = debugInfo
End Function
End Class
%>
Tmall发送码asp验证sing(自有码开发)的更多相关文章
- NodeJS 微信公共号开发 - 响应微信发送的Token验证(山东数漫江湖)
背景 使用 NodeJS 进行微信公共号开发,首先需要响应微信发送的Token验证,官方文档 填写服务器配置 登录微信公共平台,在开发下的基本配置打开该页面. 依次填写接口的 URL.自定义的 Tok ...
- asp.net mvc源码分析-DefaultModelBinder 自定义的普通数据类型的绑定和验证
原文:asp.net mvc源码分析-DefaultModelBinder 自定义的普通数据类型的绑定和验证 在前面的文章中我们曾经涉及到ControllerActionInvoker类GetPara ...
- asp.net mvc源码分析-ModelValidatorProviders 客户端的验证
几年写过asp.net mvc源码分析-ModelValidatorProviders 当时主要是考虑mvc的流程对,客户端的验证也只是简单的提及了一下,现在我们来仔细看一下客户端的验证. 如图所示, ...
- 初入码田--ASP.NET MVC4 Web应用开发之一 实现简单的登录
初入码田--ASP.NET MVC4 Web应用之创建一个空白的MVC应用程序 初入码田--ASP.NET MVC4 Web应用开发之二 实现简单的增删改查 2016-07-24 一.创建T4模板,建 ...
- OpenID Connect Core 1.0(四)使用授权码流验证(上)
3.1 使用授权码流验证(Authentication using the Authorization Code Flow) 本节描述如何使用授权码流执行验证.当使用授权码流时,会从令牌终结点返回的所 ...
- C# 动态生成word文档 [C#学习笔记3]关于Main(string[ ] args)中args命令行参数 实现DataTables搜索框查询结果高亮显示 二维码神器QRCoder Asp.net MVC 中 CodeFirst 开发模式实例
C# 动态生成word文档 本文以一个简单的小例子,简述利用C#语言开发word表格相关的知识,仅供学习分享使用,如有不足之处,还请指正. 在工程中引用word的动态库 在项目中,点击项目名称右键-- ...
- 一个由正则表达式引发的血案 vs2017使用rdlc实现批量打印 vs2017使用rdlc [asp.net core 源码分析] 01 - Session SignalR sql for xml path用法 MemCahe C# 操作Excel图形——绘制、读取、隐藏、删除图形 IOC,DIP,DI,IoC容器
1. 血案由来 近期我在为Lazada卖家中心做一个自助注册的项目,其中的shop name校验规则较为复杂,要求:1. 英文字母大小写2. 数字3. 越南文4. 一些特殊字符,如“&”,“- ...
- ASP.NET MVC 源码分析(一)
ASP.NET MVC 源码分析(一) 直接上图: 我们先来看Core的设计: 从项目结构来看,asp.net.mvc.core有以下目录: ActionConstraints:action限制相关 ...
- ASP.NET Core[源码分析篇] - Authentication认证
原文:ASP.NET Core[源码分析篇] - Authentication认证 追本溯源,从使用开始 首先看一下我们通常是如何使用微软自带的认证,一般在Startup里面配置我们所需的依赖认证服务 ...
随机推荐
- bzoj 2743 树状数组离线查询
我们按照询问的右端点排序,然后对于每一个位置,记录同颜色 上一个出现的位置,每次将上上位置出现的+1,上次出现的-1,然后 用树状数组维护就好了 /************************** ...
- 威胁远胜“心脏出血”?国外新爆Bash高危安全漏洞
这几天Linux用户们可能不能愉快地玩耍了,红帽(Redhat)安全团队昨天爆出一个危险的Bash Shell漏洞.其带来的威胁可能比早前披露的“心脏出血”漏洞更大更强! [OpenSSL心脏出血漏洞 ...
- linux 访问ntfs分区
打开ntfs-3g的下载点http://www.tuxera.com/community/ntfs-3g-download/ ,将最新稳定(当前最新版本为ntfs-3g-2011.1.15)下载到Ce ...
- Unity3D 使用 Editor 脚本,自定义 脚本的属性面板
1. 先有一个普通的 继承自 MonoBehaviour 的脚本. 2. 创建一个 Editor 文件夹, 写 关于 UnityEditor 的脚本 都要放在这个文件夹下,不然会编译出错. 具体的实现 ...
- EditText 属性
android:layout_gravity="center_vertical" 设置控件显示的位置:默认top,这里居中显示,还有bottom android:hint=&quo ...
- 强大的grep命令
1.作用 Linux系统中grep命令是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹 配的行打印出来.grep全称是Global Regular Expression Print,表示全 ...
- SQL技术内幕-5 比较特殊 insert into 数据的写法
---比较特殊,第一次看到这种写法,记录下来 create table Student --学生成绩表 ( id int, --主键 Grade int, --班级 Score int --分数 ) ...
- hdu 4345 Permutation 记忆化搜索
思路:实际上求的是和小于等于n的质数的种类数!!! 代码如下: #include<iostream> #include<stdio.h> #include<algorit ...
- E文阅读
Lesson 9 A cold welcome 冷遇 What does 'a cold welcome' refer to?On Wednesday evening, we went to the ...
- regexp_substr在oracle9i的替换方案
regexp_substr()方法在oracle9i尚不存在,是从oracle10g开始新增,如下为替换解决方法. SELECT regexp_substr('|83~GT67XVFU0RCVIV|6 ...