Asp.Net Core3.0 微信转账到零钱
参考文档:
微信付款到零钱开发文档:https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_2
用于向微信用户个人付款,目前支持向指定微信用户的openid付款。
1.付款转账
接口调用请求说明
请求url:https://api.mch.weixin.qq.com/mmpaymkttransfers/promotion/transfers
是否需要证书:是(证书及使用说明详见 商户证书)
请求方式:POST
代码只是简单实现转账功能,仅供参考,请勿在生产环境使用,否则可能造成资金风险。
/// <summary>
/// 微信转账
/// </summary>
/// <param name="inputData"></param>
/// <param name="timeOut"></param>
/// <returns></returns>
public static WxPayData Transfers(WxPayData inputData, int timeOut = 6)
{
var url = "https://api.mch.weixin.qq.com/mmpaymkttransfers/promotion/transfers"; inputData.SetValue("nonce_str", WxPayApi.GenerateNonceStr());//随机字符串
inputData.SetValue("sign", inputData.MakeSign());//签名
string xml = inputData.ToXml();
var start = DateTime.Now;
string response = HttpService.Post(xml, url, true, timeOut); var end = DateTime.Now;
int timeCost = (int)((end - start).TotalMilliseconds); WxPayData result = new WxPayData();
result.FromXml(response); ReportCostTime(url, timeCost, result);//测速上报 return result;
}
//转账
public class TransfersPay
{
public string openid { get; set; }
public int amount { get; set; }
public string partner_trade_no { get; set; }
public string re_user_name { get; set; }
public string spbill_create_ip { get; set; }
public WxPayData GetTransfersApiParameters()
{
WxPayData apiParam = new WxPayData();
apiParam.SetValue("mch_appid", _appid);//公众账号ID
apiParam.SetValue("mchid", _mchid);//商户号
apiParam.SetValue("partner_trade_no", partner_trade_no);
apiParam.SetValue("openid", openid);
apiParam.SetValue("check_name", "NO_CHECK");
apiParam.SetValue("amount", amount);
apiParam.SetValue("desc", "提现");
//apiParam.SetValue("spbill_create_ip", spbill_create_ip);
//apiParam.SetValue("re_user_name", re_user_name);
return apiParam;
}
}
Asp.Net Core3.0 微信转账到零钱的更多相关文章
- 2019年第一天——使用Visual Studio 2019 Preview创建第一个ASP.Net Core3.0的App
一.前言: 全文翻译自:https://www.talkingdotnet.com/creating-first-asp-net-core-3-0-app-visual-studio-2019/ Vi ...
- asp.net core3.0 mvc 用 autofac
好久没有写文章了,最近在用.net core3.0,一些开发中问题顺便记录: 1.首先nuget引入 Autofac Autofac.Extensions.DependencyInjection 2. ...
- asp.net 5.0微信支付
(原文出自:http://lib.csdn.net/article/wechat/46329) 微信支付官方坑太多,我们来精简 我把官方的代码,打包成了 an.wxapi.dll. 里面主要替换了下注 ...
- Postman 调试请求Asp.Net Core3.0 WebApi几种常见的Get/Post/Put/Delete请求
这里就直接截图了,如下(很简单的操作): 1:Get几种请求 2:Post 3:Put 4:Delete 最后,虽然简单,代码还是给放一下(这里只是抛砖引玉的作用,自己可以根据自身的业务需要来做进一 ...
- ASP.NET Core3.0 中的运行时编译
运行时编译 通过 Razor 文件的运行时编译补充生成时编译. 当 .cshtml 文件的内容发生更改时,ASP.NET Core MVC 将重新编译 Razor 文件 . 通过 Razor 文件的运 ...
- 如何使用Serilog.AspNetCore记录ASP.NET Core3.0的MVC属性
这是Serilog系列的第三篇文章. 第1部分-使用Serilog RequestLogging减少日志详细程度 第2部分-使用Serilog记录所选的终结点属性 第3部分-使用Serilog.Asp ...
- Asp.net Core3.0 跨域配置
原文:http://www.zilaohu.cn/Jie/Detail_Jie?ID=78840a04-55b8-4988-80b2-f964fd822d63 下面配置后:被拒绝的域请求后,可以进入方 ...
- 探索Asp net core3中的 项目文件、Program.cs和通用host(译)
引言 原文地址 在这篇博客中我将探索一些关于Asp.net core 3.0应用的基础功能--.csproj 项目文件和Program源文件.我将会描述他们从asp.net core 2.X在默认模版 ...
- 微信支付更新功能,商户转账到零钱 php版 (2022-10-12更新)
<?php class WechatMerchantTransfer { /** * @notes 商家转账到零钱 * @param $batch_no //提现订单号 * @param $le ...
- PHP实现微信提现V3版本2022-5更新接口:商家转账到零钱
微信官方又更新了接口... V3版本的微信商家转账到零钱的接口---俗称提现接口 注意事项 一:开通条件:需满足入驻满90天,连续正常交易30天,保持正常健康交易.二:分为页面发起和api接口操作,均 ...
随机推荐
- uniapp h5 和 小程序互相传值
小程序端 <template> <div> <web-view :webview-styles="webviewStyles" :src=" ...
- WinForm(C/S)项目中使用矢量字体(FontAwsome、Elegant)图标
1.介绍 字体图标在Web应用中最为常见,字体图标是矢量的,矢量图意味着每个图标都能在所有大小的屏幕上完美呈现,可以随时更改大小和颜色,而且不失真.字体图标常见的有Font Awesome和Elega ...
- 谈谈Python中的接口与抽象基类
接触Python比较早的朋友可能都有这样的体会,Python语言虽然也支持面向对象的编程方式, 但是,不像那些纯面向对象的语言(比如Java和.NET)那样严格和规范. 随着项目的规模逐步扩大之后,想 ...
- SQL Server Profiler的trc文件生成阻止
很奇葩,sqlserver自动生成trc文件,每分钟一个,重启服务器也没用. 解决思路: 查询现在正在跑的trace进程 select * from sys.fn_trace_getinfo(0); ...
- Advanced .NET Remoting: 第 9 章 3.在 Remoting 中传递额外的运行时信息
Advanced .NET Remoting:第 9 章 3.传递运行时信息 前面使用的接收器 ( Sink ) 是 IClientChannelSinks 与 IServerChannelSinks ...
- How to Disable SELinux in Ubuntu Server/Desktop
https://www.configserverfirewall.com/ubuntu-linux/disable-selinux-ubuntu/ In this tutorial I will ex ...
- .NET 中的线程安全数据结构
目录 1. ConcurrentQueue 2. ConcurrentStack 3. ConcurrentBag 4. ConcurrentDictionary<TKey, TValue> ...
- docker容器内使用sudo 报错bash: sudo: command not found
解决办法: 先查看linux系统版本: cat /proc/version 1.RedHat系主要有RedHat,Fedora,CentOs等: RedHat系列的包管理工具是yum,执行 yum i ...
- Qt/C++监控推流设备推流/延迟极低/实时性极高/rtsp/rtmp推流/hls/flv/webrtc拉流/调整分辨率降低带宽
一.前言 算下来这个推流的项目作品写了有四年多了,最初第一个版本只有文件点播的功能,用的纯QTcpSocket通信实现,属于比较简单的功能.由于文件点播只支持文件形式的推流,不支持网络流或者本地设备采 ...
- C Primer Plus 第6版 第五章 编程练习参考答案
编译环境VS Code+WSL GCC 源码在文末下载 /*第1题*************************/ #include<stdio.h> #define MIN_TO_H ...