Skip to main content

alipay for django

Project description


Quick start

  1. Install:

    pip install django_alipay2
  2. Add “alipay” to your INSTALLED_APPS setting like this:

  3. [Optional] Include the alipay URLconf in your project like this:

    url(r'^alipay/', include('alipay.urls')),
  4. Migrate:

    python migrate
  5. Add config ‘ALIPAY’ to like this:

    # account below is for sandbox
    ALIPAY = {
        'pid': '2088101122136241',
        'key': '760bdzec6y9goq7ctyx96ezkz78287de',
        'seller_email': '',
        'gateway': '',
        'server_url': 'http://localhost:8000'
    # you may add an 'api_provider' to support multiple seller
    ALIPAY = {
        'api_provider': 'some_package.sub_package.get_alipay_alipay'  # input:seller_email, output:AlipayAPI
  6. Create alipay redirect:

    import uuid
    payment = AlipayPayment.objects.create(
        user=None, # 可以指定user
        # reference_id='1' # 可选
    return redirect('alipay_redirect', out_no=payment.out_no)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django-alipay2-0.13.3.tar.gz (13.5 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page