Skip to main content

No project description provided

Project description

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.1.tar.gz (8.5 kB view details)

Uploaded Source

File details

Details for the file paynet-pkg-0.1.tar.gz.

File metadata

  • Download URL: paynet-pkg-0.1.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.11.2 readme-renderer/43.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.8.20

File hashes

Hashes for paynet-pkg-0.1.tar.gz
Algorithm Hash digest
SHA256 8dc75a81e49d1222a35fd2a60634c10eee9caa90f8ca2411bcfd9305a6761ab3
MD5 1e59a3c4c9b7dfbebf11787e0dd55426
BLAKE2b-256 77370670314ab3d4071fb0d2e3d2b4d1311837c6cd2cb77e10f70d15762e3bb3

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