Code Monkey home page Code Monkey logo

eliteu-payments's Introduction

eliteu payments

Introduction

eliteu-payments是一个django app,我们把它当作一个支付回调的中转站。当你的网站接入多个第三方支付时,只需要一个支付的回调url,eliteu-payments会把支付类型及支付平台的返回信息全部传递给该url。

Installation

pip install git+https://github.com/e-ducation/eliteu-payments

Usage

设置回调url

  • alipay
from payments.alipay.alipay import create_direct_pay_by_user
create_direct_pay_by_user(trade_id, body, subject, total_fee, http_host,
                          extra_common_param=extra_common_param)
# extra_common_param为alipay的回调url
  • alipay-app

    设置passback_params参数值为回调url

  • wechatpay, wechatpay-app, wechatpay-h5

    设置attach参数值为回调url

urls.py

# 在你的项目的主urls.py下添加eliteu-payments的urls
urlpatterns += [
    url(r'', include('payments.urls')),
]

settings.py

根据支付类型在settings.py配置支付基本信息

  • alipay
ALIPAY_INFO = {
    "basic_info":{
        "KEY": "",
        "PARTNER": "",
        "SELLER_EMAIL": ""
    },
    "other_info":{
        "INPUT_CHARSET": "",
        "INPUT_DIRECT_CHARSET": "",
        "SIGN_TYPE": "",
        "RETURN_URL": "",
        "NOTIFY_URL": "",
        "PAY_RESULT_URL": "",
        "REFUND_NOTIFY_URL": "",
        "SHOW_URL": "",
        "ERROR_NOTIFY_URL": "",
        "TRANSPORT": "",
        "DEFAULT_BANK": "",
        "IT_B_PAY": "",
        "REFUND_URL": ""
    }
}
  • alipay-app
ALIPAY_APP_INFO = {
    "basic_info":{
        "APP_ID": "",
        "APP_PRIVATE_KEY": "",
        "ALIPAY_RSA_PUBLIC_KEY": ""
    },
    "other_info":{
        "SIGN_TYPE": "",
        "NOTIFY_URL": ""
    }
}
  • wechatpay
WECHAT_PAY_INFO = {
    "basic_info":{
        "APPID": "",
        "APPSECRET": "",
        "MCHID": "",
        "KEY": "",
        "ACCESS_TOKEN": ""
    },
    "other_info":{
        "BUY_COURSES_SUCCESS_TEMPLATE_ID": "",
        "BUY_COURSES_SUCCESS_HREF_URL": "",
        "COIN_SUCCESS_TEMPLATE_ID": "",
        "COIN_SUCCESS_HREF_URL": "",
        "SERVICE_TEL": "",
        "NOTIFY_URL": "",
        "JS_API_CALL_URL": "",
        "SSLCERT_PATH": "",
        "SSLKEY_PATH": ""
    }
}
  • wechatpay-app
WECHAT_APP_PAY_INFO = {
    "basic_info":{
        "APPID": "",
        "APPSECRET": "",
        "MCHID": "",
        "KEY": "",
        "ACCESS_TOKEN": ""
    },
    "other_info":{
        "NOTIFY_URL": ""
    }
}
  • wechatpay-h5
WECHAT_H5_PAY_INFO = {
    "basic_info":{
        "APPID": "",
        "APPSECRET": "",
        "MCHID": "",
        "KEY": "",
        "ACCESS_TOKEN": ""
    },
    "other_info":{
        "SERVICE_TEL": "",
        "NOTIFY_URL": "",
        "JS_API_CALL_URL": "",
        "SSLCERT_PATH": "",
        "SSLKEY_PATH": "",
        "SPBILL_CREATE_IP": ""
    }
}

License

The code in this repository is licensed under AGPL unless otherwise noted.

Please see LICENSE for details.

How To Contribute

Contributions are very welcome.

Please read How To Contribute for details.

eliteu-payments's People

Contributors

zyl-xxxx avatar gitfengri avatar xavierchan avatar liuxing3169 avatar

Watchers

 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.