Giter Club home page Giter Club logo

pypay's Introduction

pypay

Build Status codecov License

Ali Pay And Wechat Pay With Python.

项目移植于 yansongda/pay

功能

1、支付宝

2、微信

  • 公众号支付
  • H5 支付
  • APP 支付

开发环境配置

pip3 install pipenv
pipenv install

使用说明

微信

config = WechatConfig(
            appid='wxfxxxxxxxxxxxxxx',
            mch_id='137xxxxxxx',
            key='q1w2xxr4xxy6uxxxxxxxxxx',
            mode='dev'
        )

app_pay_biz = {
    'out_trade_no': '123456789',
    'total_fee': '201',
    'body': '支付测试',
    'spbill_create_ip': '8.8.8.8',
    'notify_url': 'http://baidu.com',
}

app_wechat = Pay.wechat(self.config, 'app')
app_wechat.pay(app_pay_biz)

所有异常

  • err\gatewayexception\InvalidGatewayException ,表示使用了除本 SDK 支持的支付网关。
  • err\gatewayexception\InvalidSignException ,表示验签失败。
  • err\gatewayexception\InvalidConfigException ,表示缺少配置参数,如,ali_public_key, private_key 等。
  • err\gatewayexception\GatewayException ,表示支付宝/微信服务器返回的数据非正常结果,例如,参数错误,对账单不存在等。

LICENSE

MIT

pypay's People

Contributors

huangxingx avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.