2 Star 11 Fork 1

Gui.H / WeChatPayV3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

WeChatPayV3

轻量高性能 微信支付apiV3库

有帮助的朋友不要吝啬你们的小星星哦~


项目架构

项目 nuget 描述
WeChatPayV3 Nuget 核心库,仅包含微信支付接口调用基础sdk,可以支持所有接口(需要自己创建对应接口的实体类)
WeChatPayV3.Api Nuget 依赖核心库,增加部分接口的实现,未实现的接口仍需需要基础库来实现
WeChatPayV3.Examples 调用示例demo

快速上手

  1. 安装nuget包 WeChatPayV3
  2. 调用 以订单查询为例
  // 实例化客户端
  var client = new WechatPayClient();
  // 根据微信官方文档编写TransactionsGetRequest请求实体类
  var request = new TransactionsGetRequest("订单号", "商户号");
  // 接口调用参数
  var options = new WechatOptions(appid, merch, cerpath, apiSecret);
  // 发起调用请求
  TransactionsGetResponse response = await client.ExecuteRequestAsync(request, options);
  1. 如果安装了nuget包 WeChatPayV3.Api,可简化为
  var api = new WeChatPayApi(appid, merch, cerpath, apiSecret);
  TransactionsGetResponse response = await api.TransactionsGet(new TransactionsGetRequest("订单号", "商户号"));
  1. 步骤2和3的区别主要是 2中的TransactionsGetRequest类和TransactionsGetResponse需要使用者自己创建类文件 3中因为WeChatPayV3.Api库已经实现了这两个类,并做了接口的封装,不需要自己创建额外的类文件

WeChatPayV3.Api 接口一览

WeChatPayV3.Api 中未实现的接口不代表本库不支持调用,只是需要使用者自己去创建为实现类的类文件通过调用WeChatPayV3基础库中的ExecuteRequestAsync方法即可

已的接口如下(未实现的接口仅需简单增加两个实体类)

接口名称 方法 状态
订单查询 TransactionsGet

作者时间精力有限,欢迎将代码合并到本仓库。

有什么问题请提交issue讨论

MIT License Copyright (c) 2021 Gui.H Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

WeChatPayV3 微信支付apiV3 展开 收起
C#
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C#
1
https://gitee.com/SpringHgui/WeChatPayV3.git
git@gitee.com:SpringHgui/WeChatPayV3.git
SpringHgui
WeChatPayV3
WeChatPayV3
main

搜索帮助