Paynet Software Development Kit
Installation
pip install paynet-sdk
Installation to Django
Add 'paynet' in to your settings.py
INSTALLED_APPS = [
...
'paynet',
...
]
Add 'paynet' credentials inside to settings.py
Paynet configuration settings.py
PAYNET_USERNAME = "your-paynet-username"
PAYNET_PASSWORD = "your-paynet-password"
PAYNET_ACCOUNT_FIELD = "order_id"
PAYNET_ACCOUNT_MODEL = "order.models.Order"
Create a new View that about handling call backs
from paynet.views import PaynetWebhook
class PaynetWebhookAPIView(PaynetWebhook):
def successfully_payment(self, params):
"""
successfully payment method process you can ovveride it
"""
print(f"payment successful params: {params}")
def cancelled_payment(self, params):
"""
cancelled payment method process you can ovveride it
"""
print(f"payment cancelled params: {params}")
Add a payme path to core of urlpatterns:
from django.urls import path
from django.urls import include
from your_app.views import PaynetWebhookAPIView
urlpatterns = [
...
path("payment/paynet/update/", PaynetWebhookAPIView.as_view()),
...
]
Run migrations
python3 manage.py makemigrations && python manage.py migrate
🎉 Congratulations you have been integrated paynet with django, keep reading docs. After successfull migrations check your admin panel and see results what happened.
Metadata
Release files for paynet-sdk 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| paynet_sdk-0.0.1.tar.gz | 8.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| paynet_sdk-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.2 kB
Release files / paynet_sdk-0.0.1.tar.gz
| Download URL | paynet_sdk-0.0.1.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed432006f61a88c9180092994490edb9ac3f3b2749cb33fb8aa51d0069e33682
|
|
BLAKE2b-256 checksum How to use checksums |
62b58623c79c221c27d44441ca848dc2108512861cd306455f01b09b17e54a50
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|
Release files / paynet_sdk-0.0.1-py3-none-any.whl
| Download URL | paynet_sdk-0.0.1-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ac296da638b97207c4ad4ee357ed1db9e778a585ea2f72ff60891ce5a46e011f
|
|
BLAKE2b-256 checksum How to use checksums |
6e53f3aa2c30c89412f5c122bb7679eb148c229756b6653cd5d7862b3672abed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|