ydaniels / django-cryptocurrency-payment Goto Github PK
View Code? Open in Web Editor NEWSimple and flexible app for accepting cryptocurrency payment with no much hassle
License: MIT License
Simple and flexible app for accepting cryptocurrency payment with no much hassle
License: MIT License
Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.
I tried to make use of the tasks.update_payment_status()
Paste the command(s) you ran and the output.
Traceback (most recent call last):
File "/home/michaellyon/flexvest/env/lib/python3.9/site-packages/apscheduler/executors/base.py", line 125, in run_job
retval = job.func(*job.args, **job.kwargs)
File "/home/michaellyon/flexvest/taskManager/run_tasks.py", line 54, in test3
tasks.update_payment_status()
File "/home/michaellyon/flexvest/env/lib/python3.9/site-packages/cryptocurrency_payment/tasks.py", line 16, in update_payment_status
crypto_task.update_crypto_currency_payment_status()
File "/home/michaellyon/flexvest/env/lib/python3.9/site-packages/cryptocurrency_payment/tasks.py", line 88, in update_crypto_currency_payment_status
status, value = self.backend_obj.confirm_address_payment(
File "/home/michaellyon/flexvest/env/lib/python3.9/site-packages/merchant_wallet/backends/btc.py", line 178, in confirm_address_payment
return NO_HASH_ADDRESS_BALANCE, None
NameError: name 'NO_HASH_ADDRESS_BALANCE' is not defined
Job "test3 (trigger: interval[0:03:00], next run at: 2021-09-05 23:51:07 UTC)" raised an exception
Traceback (most recent call last):
File "/home/michaellyon/flexvest/env/lib/python3.9/site-packages/apscheduler/executors/base.py", line 125, in run_job
retval = job.func(*job.args, **job.kwargs)
File "/home/michaellyon/flexvest/taskManager/run_tasks.py", line 54, in test3
tasks.update_payment_status()
File "/home/michaellyon/flexvest/env/lib/python3.9/site-packages/cryptocurrency_payment/tasks.py", line 16, in update_payment_status
crypto_task.update_crypto_currency_payment_status()
File "/home/michaellyon/flexvest/env/lib/python3.9/site-packages/cryptocurrency_payment/tasks.py", line 88, in update_crypto_currency_payment_status
status, value = self.backend_obj.confirm_address_payment(
File "/home/michaellyon/flexvest/env/lib/python3.9/site-packages/merchant_wallet/backends/btc.py", line 178, in confirm_address_payment
return NO_HASH_ADDRESS_BALANCE, None
NameError: name 'NO_HASH_ADDRESS_BALANCE' is not defined
Not sure if Bitpay and Coinbase Commerce APIs would fit into this library or if they each deserve their own django libraries (separate might be better). But it would be nice to tie in these APIs into django more easily. Similar to how dj-stripe exists for Stripe. There are others besides these APIs that I did not mention that may also be worthwhile.
How do i make sure that payments are received?
Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.
Latest version as at April 2021
Django 3
Python 3.9.1
Parrot Security
I tried to implement the create_payment method and I kept getting "local variable 'newkey' referenced before assignment" error message.
payment = create_new_payment(crypto='BITCOIN', #Cryptocurrency from your backend settings
fiat_amount=10, #Amount of actual item in fiat
fiat_currency='USD', #Fiat currency used to convert to crypto amount
payment_title="tESTING", #Title associated with payment
payment_description="tESTING", #Description associated with payment
related_object=None, #Generic linked object for this payment -> crypto_payments = GenericRelation(CryptoCurrencyPayment)
user=request.user, #User of this payment for non-anonymous payment
parent_payment=None, #Obvious
address_index=None,# Use a particular address index for this payment
reuse_address=None)
This is more of a question/feature request if it does not already exist.
How do you configure in settings and views acceptance of multiple cryptocurrencies?
Something like this:
Bitcoin (BTC): <Address>
Bitcoin Cash (BCH): <Address>
Litecoin (LTC): <Address>
Ethereum (ETH): <Address>
etc.
Maybe give the user the option to choose which out of the 4 above they want to pay with?
Otherwise, for something like a one time donation, what would the difference be if someone just lists all the addresses on the HTML page? I guess this library is best used for subscription payments with crypto as an alternative to stripe, correct?
File "C:\Users\Junior\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner
self.run()
File "C:\Users\Junior\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run
self._target(*self._args, **self.kwargs)
File "C:\Users\Junior\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\Junior\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run
autoreload.raise_last_exception()
File "C:\Users\Junior\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception
raise exception[1]
File "C:\Users\Junior\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management_init.py", line 398, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\Junior\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "C:\Users\Junior\AppData\Local\Programs\Python\Python310\lib\site-packages\django_init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\Junior\AppData\Local\Programs\Python\Python310\lib\site-packages\django\apps\registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "C:\Users\Junior\AppData\Local\Programs\Python\Python310\lib\site-packages\django\apps\config.py", line 247, in create
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: Cannot import 'test_app'. Check that 'cryptocurrency_payment.test_utils.test_app.apps.TestAppConfig.name' is correct.
Hello I am a big fan of this project and wanted to add it to my test online store website that I am developing. After some digging I found out that the URLs use django's 2.0 system and I was wondering if anyone got them working in higher django version or can guide me on how to "upgrade" them.
Thanks for your time
-Alex
Some people do not have actual cryptocurrency coins they could spend to test django-cryptocurrency-payments with. Is there a way to test django-cryptocurrency-payments with the testnet or perhaps private blockchains? This way, people could test django-cryptocurrency-payment without worrying about spending a significant chunk of their actual fiat money. If there is a way to do this, please add instructions to the docs or to this issue thread.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.