Skip to main content

No project description provided

Project description

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.

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_sdk-0.0.1.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paynet_sdk-0.0.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file paynet_sdk-0.0.1.tar.gz.

File metadata

  • Download URL: paynet_sdk-0.0.1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for paynet_sdk-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ed432006f61a88c9180092994490edb9ac3f3b2749cb33fb8aa51d0069e33682
MD5 4b4430a43cb70327594c7782b88f8594
BLAKE2b-256 62b58623c79c221c27d44441ca848dc2108512861cd306455f01b09b17e54a50

See more details on using hashes here.

File details

Details for the file paynet_sdk-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: paynet_sdk-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for paynet_sdk-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ac296da638b97207c4ad4ee357ed1db9e778a585ea2f72ff60891ce5a46e011f
MD5 8e350f5db9aac1cb255b3ee696d98c7d
BLAKE2b-256 6e53f3aa2c30c89412f5c122bb7679eb148c229756b6653cd5d7862b3672abed

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