Skip to main content

No project description provided

Project description

Paynet Software Development Kit

Support Group on Telegram

Installation

pip install paynet-pkg

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.

Project details


Download files

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

Source Distribution

paynet_pkg-0.3.tar.gz (8.3 kB view details)

Uploaded Source

File details

Details for the file paynet_pkg-0.3.tar.gz.

File metadata

  • Download URL: paynet_pkg-0.3.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.12.0 readme-renderer/44.0 requests/2.32.3 requests-toolbelt/1.0.0 urllib3/2.2.3 tqdm/4.67.1 importlib-metadata/8.5.0 keyring/25.5.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.12.4

File hashes

Hashes for paynet_pkg-0.3.tar.gz
Algorithm Hash digest
SHA256 278eef85e7f8dd7156ab3fec3d0a91934b892cd9267614cdd3024c96a15e2909
MD5 47a3793f8b8a2591f8abb614f9ca202d
BLAKE2b-256 57014430b83f70bff089919b327660614cec5a72877eb40a1d038de5cd5aded7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page