django简单灵活的可插拔加密货币支付应用程序
django-cryptocurrency-payment的Python项目详细描述
^{1}$
django简单灵活的可插拔加密货币支付应用程序。硬币是可以消费和反映在高清钱包像银金矿
快速启动
安装Django加密货币支付:
pip install django-cryptocurrency-payment
将其添加到已安装的应用程序中:
^{pr2}$添加Django加密货币支付的URL模式:
fromcryptocurrency_paymentimporturlsascryptocurrency_payment_urlsurlpatterns=[...url(r'^',include(cryptocurrency_payment_urls)),#/payment/{pk}/...]
创建付款方式
fromcryptocurrency_payment.modelsimportcreate_new_paymentpayment=create_new_payment(crypto='BITCOIN',#Cryptocurrency from your settingsfiat_amount=10,#Amount of item in fiatfiat_currency='USD',#Fiat currency used to convert to crypto amountpayment_title=None,#Title associated with paymentpayment_description=None,#Description associated with paymentrelated_object=None,#Generic linked object for this payment -> crypto_payments = GenericRelation(CryptoCurrencyPayment)user=None,#User of this payment for non-anonymous paymentparent_payment=None,#Associate with previous paymentaddress_index=None,# Use an address generated from a particular index for this payment e.g same address can always be used for a particular userreuse_address=None),#Used previously paid address for this payment
任务
使用您最喜欢的django任务管理器,根据您的首选时间定期运行这些任务
cryptocurrency_payment.tasks.update_payment_statuscryptocurrency_payment.tasks.cancel_unpaid_paymentcryptocurrency_payment.tasks.refresh_payment_prices
特点
- 灵活的付款创建,可以链接到其他django对象
- 从区块链自动更新付款状态
- 如果未付款,则自动更新付款价格
- 如果付款不足,自动创建子付款
- 一段时间后取消未付款
- 允许匿名支付
- 支持更多加密货币后端
运行测试
代码真的有效吗?在
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install tox (myenv) $ tox
历史
{21{0.0美元- PyPI的第一个版本。在
- 项目
标签: