alipay for django
Project description
提供django下alipay直接支付接口
Quick start
Install:
pip install django_alipay2
Add “alipay” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'alipay', ][Optional] Include the alipay URLconf in your project urls.py like this:
url(r'^alipay/', include('alipay.urls')),Migrate:
python manage.py migrate
Add config ‘ALIPAY’ to settings.py like this:
ALIPAY = { 'sandbox': True, # use sandbox client if True 'pid': 'real alipay pid', 'key': 'real alipay key', 'seller': 'your_seller_email@domain.com', 'gateway': 'https://mapi.alipay.com/gateway.do?', 'SERVER_URL': 'http://my.server.com', # for alipay return and notify }Create alipay redirect:
import uuid payment = AlipayPayment.objects.create( out_no=uuid.uuid4(), subject='充值', body='1年365元', amount_total=0.01, user=None, # 可以指定user # reference_id='1' # 可选 ) return redirect('alipay_redirect', out_no=payment.out_no)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-alipay2-0.9.3.tar.gz
(9.7 kB
view details)
File details
Details for the file django-alipay2-0.9.3.tar.gz.
File metadata
- Download URL: django-alipay2-0.9.3.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
644c34a5823a903e37258de1183a84e9d2694d8f849363e599d67cefc0bbece2
|
|
| MD5 |
197de5275c5be30eb14a44021c70f4b0
|
|
| BLAKE2b-256 |
292449772e155ce835b720b3ff2bfd225349f6e2c3043ddbdc8f4d195febe4e5
|