点金计划MD5值计算?

小游戏 企业微信 微信支付 小程序 文章 2020-07-30 21:15 2091 0 全屏看文

AI助手支持GPT4.0

点金计划MD5值计算?

根据文档描述

点金计划页面打开时,页面上方的 iframe 框架会请求服务商填写的商家小票链接,会在链接后附

上:“特约商户号(sub_mch_id)”、“商户订单号(out_trade_no)”、“md5 校验码

(check_code)”三个字段的信息,方便服务商快速定位到具体订单的同时,也保证链接的可靠

性。

a)  增加参数后的链接格式为:

服务商链接?sub_mch_id=特约商户号&out_trade_no=商户订单号&check_code=

b)  举例:

若服务商配置的链接为 https://www.qq.com,特约商户号为 1234567,商户订单号为

ABCDEFG,则请求的链接为

https://www.qq.com?sub_mch_id=1234567&out_trade_no=ABCDEFG&check_code=

39f0876dd58e4eb61b66250f69d02705

2) 服务商校验 check_code

服务商获取到上述完整链接时,为了保证参数没有被篡改,需要做 MD5 校验。

a)  校验方式

通过链接上的“商户订单号”,到后台获取该订单对应的“微信订单号”,即 transaction_id,

并拼在原有链接后(需去除 check_code,即:服务商链接?sub_mch_id=特约商户号

&out_trade_no=商户订单号&transaction_id=),进行 MD5 计算。

b)  举例

若 transaction_id 为 abcdefg,则 MD5 值为:

String my_check_code =

MD5(“https://www.qq.com?sub_mch_id=1234567&out_trade_no=ABCDEFG&transactio

n_id=abcdefg”);

若 my_check_code 与最初链接参数中的 check_code 相等,说明该链接未被篡改,可正常跳转

到商家小票内容,否则服务商需展示错误提示页


计算出来的MD5与返回的MD5不一致,是什么原因?有人遇到过吗,怎么解决的

According to the description of the document, when the page of the deposit plan opens, the iframe framework at the top of the page will ask the service provider to fill in the link with a link: "sub"_ mch_ ID) "and" merchant order number (out) "_ trade_ No "," MD5 check code (check)_ The information in the three fields is convenient for service providers to quickly locate specific orders and ensure the reliability of links. a) The link format after adding parameters is: Service Provider Link? Sub_ mch_ Id = merchant ID & out_ trade_ No = merchant order number & check_ Code = b) example: if the link configured by the service provider is https://www.qq.com , the merchant ID is 1234567, and the merchant order number is ABCDEFG, then the requested link is https://www.qq.com?sub_ mch_ id=1234567&out_ trade_ no=ABCDEFG&check_ Code = 39f0876dd58e4eb61b66250f69d02705 2) service provider check_ When the code service provider obtains the above complete link, it needs to do MD5 verification in order to ensure that the parameters are not tampered with. a) Through the "merchant order number" on the link, the "wechat order number" corresponding to the order can be obtained in the background, that is, transaction_ ID, and spell it after the original link (check needs to be removed_ Code: Service Provider Link? Sub_ mch_ Id = merchant ID & out_ trade_ No = merchant order number & Transaction_ Id =) for MD5 calculation. b) For example, if transaction_ If Id is ABCDEFG, the MD5 value is: String my_ check_ code = MD5(“ https://www.qq.com?sub_ mch_ id=1234567&out_ trade_ no=ABCDEFG&transactio n_ Id = ABCDEFG); if my_ check_ Code and check in the initial link parameter_ If the code is equal, it means that the link has not been tampered with and can jump to the content of the merchant ticket normally. Otherwise, the service provider needs to display an error prompt page. What is the reason for the inconsistency between the calculated MD5 and the returned MD5? Did anyone encounter it? How did you solve it

回答:

jf.wang:

助手都是干嘛的,不理人的?

-EOF-

AI助手支持GPT4.0