最新微信退款结果通知解密(php版)

微信无密退款-通知接口返回内容解密     微信退款通知接口说明:  https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=9_16&index=11重点:       Java本身限制密钥的长度最多128位,而AES256需要的密钥长度是256位,因此需要到Java官网上下载一个java Cryptography Extension (JCE) Unlimite... 阅读详情

微信官方给出的退款通知解密方法如下:

(1)对加密串A做base64解码,得到加密串B

(2)对商户key做md5,得到32位小写key* ( key设置路径:微信商户平台(pay.weixin.qq.com)-->账户设置-->API安全-->密钥设置 )

(3)用key*对加密串B做AES-256-ECB解密

以下是自己亲测可用的解密方法

<?php
header("content-type:text/xml; charset=UTF-8"); 
function refund_decrypt($str, $key) {
        $str = base64_decode($str);
        $str = mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $str, MCRYPT_MODE_ECB);
        $block = mcrypt_get_block_size('rijndael_128', 'ecb');
        $pad = ord($str[($len = strlen($str)) - 1]);
        $len = strlen($str);
        $pad = ord($str[$len - 1]);
        return substr($str, 0, strlen($str) - $pad);
}
$str="微信同步的加密串req_info";
$key=MD5('商户key');
$data=refund_decrypt($str, $key);
echo $data;
?>
注:对加密串req_info做base64解码会出现乱码,但不影响最终的解密

解密结果如下:

<root>
<out_refund_no><![CDATA[201710101830454723]]></out_refund_no>
<out_trade_no><![CDATA[201710101830454723]]></out_trade_no>
<refund_account><![CDATA[REFUND_SOURCE_UNSETTLED_FUNDS]]></refund_account>
<refund_fee><![CDATA[200]]></refund_fee>
<refund_id><![CDATA[50000204292017101001977770763]]></refund_id>
<refund_recv_accout><![CDATA[支付用户零钱]]></refund_recv_accout>
<refund_request_source><![CDATA[API]]></refund_request_source>
<refund_status><![CDATA[SUCCESS]]></refund_status>
<settlement_refund_fee><![CDATA[200]]></settlement_refund_fee>
<settlement_total_fee><![CDATA[200]]></settlement_total_fee>
<success_time><![CDATA[2017-10-10 18:33:31]]></success_time>
<total_fee><![CDATA[200]]></total_fee>
<transaction_id><![CDATA[4200000011201710107264086890]]></transaction_id>
</root>



微信支付退款通知解密 微信支付退款通知解密 aes256 ecb pk7 立即下载

相关推荐

PHP微信退款通知解密最新,支持openssl

强调下:是PHP PHP PHP! mcrypt | openssl 二种形式自选,注意开启对应扩展。另外高版本如php7已逐渐废弃mcrypt

php5.6 微信退款回调处理(AES-256-ECB+PKCS7Padding)

微信退款的回调中有个字段是req_info。该字段微信官方给的解密方法是: 解密步骤如下:  (1)对加密串A做base64解码,得到加密串B (2)对商户key做md5,得到32位小写key* ( key设置路径:微信商户平台(pay.weixin.qq.com)--&gt;账户设置--&gt;API安全--&gt;密钥设置 ) (3)用key*对加密串B做AES-256-ECB解密(P...

awesomeQ的专栏 2498

最新微信退款通知解密

最新微信退款通知解密 微信退款 AES256 PK7 ECB加密解密

微信支付退款回调处理 php

退款回调xml $xml = ‘<return_code>SUCCESS</return_code><![CDATA[appid]]><mch_id><![CDATA[mch_id]]></mch_id><nonce_str><![CDATA[9fc60c175092f315a5c299d1bff79e49]]></nonce_str><req_info><![CDATA[vQCd1

mrs_qian的博客 777

微信支付退款通知解密-java-亲测可用版

微信支付退款通知解密-java-亲测可用版 (1)对加密串A做base64解码,得到加密串B (2)对商户key做md5,得到32位小写key* (3)用key*对加密串B做AES-256-ECB解密 包含需要替换的jar包,1.6、1.7、1.8

微信退款回调加密信息-加密解密类

微信退款回调加密信息-加密解密类,经测试有效,记得导入包

php处理微信退款回调,加密串解密

退款回调官方说明文档:https://pay.weixin.qq.com/wiki/doc/api/H5.php?chapter=9_16&index=10 1.接收回调数据 function xmlToArray($xml) { libxml_disable_entity_loader(true); return json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement'

手可摘星河 1422

(UE5 5.2)HISM Mobile DrawInstance在渲染层的实现浅分析

在 (UE4 4.27) UHierarchicalInstancedStaticMesh(HISM)原理分析 这篇博客大致介绍HISM组件从游戏线程到渲染线程的重建KD-Tree和剔除并提交DrawCall逻辑,但是没有分析渲染层的大致数据结构和实现. 可以看出FHierarchicalStaticMeshSceneProxy 实际存储Instance数组数据来自于FInstancedStaticMeshSceneProxy FHierarchicalStaticMeshSceneProxy只是以FClu

qq_29523119的博客 2725

php微信退款回调通知,最新微信退款结果通知解密(php版)

微信官方给出的退款通知解密方法如下:(1)对加密串A做base64解码,得到加密串B(2)对商户key做md5,得到32位小写key* ( key设置路径:微信商户平台(pay.weixin.qq.com)-->账户设置-->API安全-->密钥设置 )(3)用key*对加密串B做AES-256-ECB解密以下是自己亲测可用的解密方法header("content-type:te...

weixin_30416493的博客 609

CANoe信号传输故障排查指南

本文提供了全面的CANoe信号传输故障排查指南,涵盖从硬件连接、通道配置到软件脚本与数据库加载的全链路诊断。针对常见的通道指示灯不亮、信号无法发送及ECU握手失败等问题,给出了基于CANoe工具和CAPL脚本的详细排查步骤与解决方案,帮助工程师系统化定位并解决实车测试中的通信故障。

ice55的博客 258

Reeds-Shepp曲线公式推导及代码实现-第三部分(共三部分)

根据原始起点的坐标和航向,将上一小节计算出来的局部进行整体的平移和旋转(与归一化的步骤刚好相反),最终得到全局路径的轨迹。根据计算出来的路径,选择路径最短的轨迹(也可根据我们实际的需要定制选优规则),作为最终的轨迹输出。Reeds-Shepp曲线公式推导及代码实现-第一部分(共三部分)Reeds-Shepp曲线公式推导及代码实现-第二部分(共三部分)的值进行等步长插值,得到每段轨迹对应的生成一系列插值距离列表。根据上一步生成的插值距离列表的值,计算其对应的局部位姿值。后,我们需要根据字段类型(

jianmo的博客 1089

java 微信申请退款,退款回调通知,解密,V2版

下载微信官方提供的SDK,转https://blog.youkuaiyun.com/qq_40506288/article/details/110918650博客查看下载流程 微信退款说明,官方提供:https://pay.weixin.qq.com/wiki/doc/api/external/jsapi.php?chapter=9_4 代码 这个类请转值:https://blog.youkuaiyun.com/qq_40506288/article/details/110918650 @Autowired priva..

树叶single 3756

ArcGIS Pro样式导入全攻略:从.style到.stylx的完整转换流程(附常见问题解决)

本文详细解析了ArcGIS Pro中从旧版.style文件导入并转换为新版.stylx格式的完整流程。针对用户在迁移过程中常见的样式库为空、符号匹配失败、显示异常等问题,提供了清晰的排查思路与解决方案,帮助用户高效完成样式库的升级与迁移,确保制图工作的连续性。

raspberrypi5的博客 517

php 微信退款,异步通知实现

需要注意的事项: 1.微信退款到零钱要求必传证书,需要到https://pay.weixin.qq.com 账户中心-&amp;amp;amp;amp;amp;amp;gt;账户设置-&amp;amp;amp;amp;amp;amp;gt;API安全-&amp;amp;amp;amp;amp;amp;gt;下载证书,然后修改代码中的证书路径 2.该文件需放到支付授权目录下,可以在微信支付商户平台-&amp;amp;amp;amp;amp;amp;gt;产品中心-&am

行者有疆哉 1973

48、量子系统中的信源编码

本文深入探讨了量子系统中的信源编码理论与应用,详细介绍了盲编码与可见编码、定长编码与变长编码四种主要信源编码方案。文章从经典信源编码出发,对比分析了量子场景下的压缩特性,并系统性地阐述了量子定长信源编码的构建方法及相关定理证明。同时,讨论了通用量子定长信源编码的设计思路及其在实际应用中的优势与挑战。通过理论分析与实验进展的结合,为量子信息存储、传输和处理提供了重要的理论基础和技术支持。

m2n3b4v5c6的博客 100

Unity 佳能SDK 及数据获取

3. 把CameraControl 下面只要是绿色的 .cs 文件都复制到Unity 中。1. 填写信息跟官方申请SDK,大概1-2个工作日会邮件回复你。2. 将SDK这两个文件放到 Unity Plugins文件夹。

我知道你很急,但是路要一步步走 1477

微信支付退款成功回调结果的解密

微信退款成功后,会向用户指定的地址发送一个请求,参数是微信退款的状态,成功,失败都有回复,但是数据是加密的 网上的很多说解密的,但是那些解密的函数已数被php弃用了 //可逆加密 function encrypt($data, $key) { $prep_code = serialize($data); $block = mcrypt_get_block_size('des'...

hjh15827475896的博客 6332

滚雪球学Java(01):Java是什么?| 入门指南

🏆本文收录于「滚雪球学Java」专栏,专业攻坚指数级提升,助你一臂之力,带你早日登顶🚀,欢迎大家关注&&收藏!持续更新中,up!up!up!!

**My Coding Family** 627

微信退款通知XML数据处理,以及req_info的解密(php版)

微信官方退款结果通知文档 第一步:处理post传过来的xml数据 $key = '微信支付的密钥'; //post传过来的数据,这里是测试demo $string = "<xml> <return_code>SUCCESS</return_code> <appid><![CDATA[wx9456sdf465sd5234]]></appid> <mch_id><![CDATA[15654s65d01]]><

weixin_42595949的博客 1718

使用R语言实战:构建Logistic回归模型

Logistic回归是一种基于概率的分类算法,它用于预测离散的结果变量(也称为响应变量或因变量)。与线性回归不同,Logistic回归的输出是一个概率值,通常在0和1之间。这使得它非常适合处理二分类问题。市场营销:预测客户是否会购买某个产品。医学研究:预测疾病的发生与否。信用风险评估:预测个人申请贷款的违约风险。社会科学:预测个人对某个政策的态度。

2301_79331230的博客 1140

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

对微信退款结果通知接口的说明和req_info字段解析(JAVA)

微信支付的申请退款接口,可以设置notify_url参数,这个参数代表微信退款成功后调用商户自己的接口,当微信调用这个接口时,代表款项正式退给了付款方。 根据观察,如果是微信零钱支付,调用申请退款接口后是秒退,如果是微信绑定的银行卡或信用卡支付,大概几分钟后到账。 微信退款申请接口文档: https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?cha...

lkforce 7215

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

php微信退款结果通知,微信支付退款结果通知解密

微信支付退款结果通知解密步骤如下:第一步,对商户密钥key进行MD5加密,得到32位小写加密串StringAkey设置路径:微信商户平台(pay.weixin.qq.com)-->账户设置-->API安全-->密钥设置第二步,使用StringA作为key,对参数加密串进行AES-256(ECB模式,PKCS7Padding)解密,得到加密前参数。第一步很好理解, 第二步微信并没有...

weixin_35202718的博客 605

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

【微信退款】Java实现微信APP退款和JSAPI退款流程

前言 微信JSAPI支付,微信APP支付,微信退款,支付宝手机网站支付,支付宝APP支付,支付宝退款,我都放到个人公众号:JAVA大贼船。觉得个人以后开发会用到的可以关注一下哦!少走点弯路… 官方文档 APP申请退款和JSAPI申请退款可以共用,各自的文档基本一样 微信APP申请退款文档 https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=9_4&index=6 微信JSAPI申请退款文档 https://pay.weixin.qq.

Mr_aaao的博客 2143

微信退款异步通知获得的req_infoAES加密和解密方法以及常见的问题

在接触到微信退款时了解到AES解密 微信退款异步通知接口地址 https://pay.weixin.qq.com/wiki/doc/api/H5.php?chapter=9_16&amp;index=10 里面提到对于req_info 解密的方法如下: (1)对加密串A做base64解码,得到加密串B (2)对商户key做md5,得到32位小写key* ( key设置路径:微信商户平台(...

qq_34793634的博客 3624

php 微信退款接口,微信支付退款通知接口API AES解密

如果觉得还行,大家给个star,fork一下哦,3KS使用方法:微信退款通知解密,消息回复帮助类此类实现了微信退款通知消息的解密及回复过程,处理自己的业务逻辑需要实现\libs\wxpay\WxpayRefundNotifyHelper::handelInternal()方法即可。调用方式:在微信回调接口调用1.引入类:require_once 'WxpayRefundNotifyHelper.p...

weixin_31720227的博客 205
上一篇: php中记录日志的几种方法
下一篇: php日常问题汇总
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值