Git Product home page Git Product logo

quickpay's Introduction

QuickPay 组件

996.icu GitHub GitHub last commit GitHub code size in bytes

Build Server Platform Build Status
Azure Pipelines Windows Build Status
Azure Pipelines Linux Build Status
Package Version Downloads
QuickPay NuGet NuGet
QuickPay.AspNetCore.Mvc NuGet NuGet
QuickPay.SqlServer NuGet NuGet
QuickPay.Oracle NuGet NuGet
QuickPay.MySql NuGet NuGet
QuickPay.PostgreSql NuGet NuGet

简介

  • QuickPay 集成了微信,支付宝支付,能够通过简单的配置,简短的代码接入支付功能。
  • 微信支持功能: App支付 , H5支付 , JsApi(公众号)支付 , 扫码支付 , 刷卡支付
  • 支付宝支持功能: App支付 , 电脑网站支付 , 扫码支付 , 手机网站(H5)支付
  • 支持同一个网站下多个应用支付。

接入

  • QuickPay 组件依赖 DotCommon通用类库与部分相关的组件。因此初始化需要初始化 DotCommon 类库。

  • Nuget依赖包:Install-Package QuickPay

初始化代码:

public static IServiceProvider Initialize()
{
    IServiceCollection services = new ServiceCollection();
    services.AddLogging(c =>
    {
        c.AddLog4Net();
    })
    .AddDotCommon()
    .AddGenericsMemoryCache()
    .AddJson4Net()
    .AddWeChatFramework() //添加微信基础框架
    .AddQuickPay(option =>
    {
        option.ConfigSourceType = ConfigSourceType.FromConfigFile;
        option.ConfigFileName = "QuickPayConfig.xml";
        option.ConfigFileFormat=QuickPaySettings.ConfigFormat.Xml;
        option.EnabledAlipaySandbox=false; //是否启用支付宝沙盒
        option.EnabledWechatPaySandbox=false; //是否启用微信沙盒
    })
    .AddQuickPaySqlServer(o =>
    {
        o.DbConnectionString = "...数据库连接字符串...";
        o.PaymentTableName="QP_Payments";
        o.RefundTableName="QP_Refunds";
    });

    Mapper.Initialize(config =>
    {
        config.CreateQuickPayMaps();
    });
    var provider = services.BuildServiceProvider();
    //配置
    provider.ConfigureQuickPay();
    return provider;
}

配置文件初始化:

  • QuickPay支持两种方式的配置初始化,1.通过配置的Xml(参考) 2.通过初始化配置对象 3.通过数据库动态加载配置
  • 如果通过数据库动态加载配置,需要自定义实现 IAlipayConfigStore,IWeChatPayConfigStore 配置存储接口,并且需要把他们添加到依赖注入中去。可参考源码

示例代码

quickpay's People

Contributors

cocosip avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

quickpay's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.