1 Star 3 Fork 0

Wwb / wwb-paylink

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

宝付收款文档

API接口文档

宝付收款文档 说明
收款文档 https://docs.huishouqian.com/
付款文档 --

NUGET包

包类型 名称 版本 描述
nuget WWB.Paylink.BaoFooPay nuget 宝付收款,已实现基础支付和微信投诉
nuget WWB.Paylink.BaoFooTransfer nuget 宝付代付,已实现BF0040001 BF0040002 BF0040003 BF0040004

第一步 在appsettings.json添加宝付支付的选项

 "BaofooPayConfig": {
    "MerchantNo": "814000473149",
    "Key": "86a8eec5ae958e9948b7450439cc57e2",
    "PfxCertificate": "Cert\\814000473149_pri.pfx",
    "Password": "123456",
    "CerCertificate": "Cert\\MANDAO_814000473149_pub.cer",
    "Debug": true
  }

第二步 引入BaoFoo到项目中


 builder.Services.Configure<BaoFooPayOptions>(builder.Configuration.GetSection("BaofooPayConfig"));
 builder.Services.AddBaoFooPayClient();

第三步 支付API构造函数中引入IBaoFooPayClient和BaoFooPayOptions

    private readonly IBaoFooPayClient _client;
    private readonly IOptions<BaoFooPayOptions> _optionsAccessor;

    public PaymentController(IBaoFooPayClient client, IOptions<BaoFooPayOptions> optionsAccessor)
    {
        _client = client;
        _optionsAccessor = optionsAccessor;
    }

    /// <summary>
    /// 小程序支付
    /// </summary>
    /// <returns></returns>
    [HttpGet]
    public async Task<IActionResult> AppletPay()
    {
        var request = new AppletPayRequest()
        {
            TransNo = "DD" + DateTime.Now.ToString("yyyyMMddHHmmss"),
            PayType = TradeType.WECHAT_APPLET,
            OrderAmt = 1,
            GoodsInfo = "测试",
            RequestDate = DateTime.Now.ToString("yyyyMMddHHmmss"),
            ReturnUrl = "",
            PageUrl = "",
            Extend = "自定义字段",
            Memo = new AppletPayRequestMemo()
            {
                PayLimit = "balance",
                TimeExpire = "",
                AppId = "wxb63c89abb9243ad0",
                OpenId = "oUpF8uMuAJO_M2pxb1Q9zNjWeS6o",
                SpbillCreateIp = "172.22.11.2",
                Latitude = "",
                Longitude = "116.397128",
                AppVersion = "39.916527",
                AreaInfo = "",
                DeviceNo = "",
                DeviceType = ""
            }
        };

        var response = await _client.ExecuteAsync(request, _optionsAccessor.Value);

        return Ok(response);
    }

第四步 回调API构造函数中引入IBaoFooPayNotifyClient和BaoFooPayOptions


    private readonly IBaoFooPayNotifyClient _client;
    private readonly IOptions<BaoFooPayOptions> _optionsAccessor;

    public PaymentNotifyController(IBaoFooPayNotifyClient client, IOptions<BaoFooPayOptions> optionsAccessor)
    {
        _client = client;
        _optionsAccessor = optionsAccessor;
    }

    [HttpPost]
    public async Task<IActionResult> PayNotify()
    {
        try
        {
            var notify = await _client.ExecuteAsync<PaymentNotify>(HttpContext.Request, _optionsAccessor.Value);

            return Ok("Success");
        }
        catch (Exception ex) { }
        {
            return NoContent();
        }
    }
MIT License Copyright (c) 2021 my6521 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.

简介

wwb-paylink 是基于 .NET Core 、 ASP.NET Core 开发的第三方支付SDK集,它极大简化了API调用及通知的处理流程。目前支持惠收钱支付、宝付代付、汇聚支付。 展开 收起
C#
MIT
取消

发行版 (1)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
C#
1
https://gitee.com/my6521/wwb-paylink.git
git@gitee.com:my6521/wwb-paylink.git
my6521
wwb-paylink
wwb-paylink
main

搜索帮助

53164aa7 5694891 3bd8fe86 5694891