Skip to main content

Paycomuz

Project description

alt text

Downloads alt text Downloads Downloads

Requirements

pip install django
pip install djangorestframework
pip install PaycomUz 
pip install requests

# supported versions
python 3.5 +
django 2 +
djangorestframework 3.7 +
PaycomUz 2 +

settings.py

PAYCOM_SETTINGS = {
    "KASSA_ID": "KASSA ID",  # token
    "SECRET_KEY": "TEST KEY OR PRODUCTIN KEY",  # password
    "ACCOUNTS": {
        "KEY": "order_id"
    },
}

INSTALLED_APPS = [
    'rest_framework',
    'paycomuz',
    ...
]
python manage.py migrate

Create paycom user

python manage.py create_paycom_user

view.py

from paycomuz.views import MerchantAPIView
from paycomuz import Paycom
from django.urls import path

class CheckOrder(Paycom):
    def check_order(self, amount, account, *args, **kwargs):
        return self.ORDER_FOUND
        
   def successfully_payment(self, account, transaction, *args, **kwargs):
        print(account)

   def cancel_payment(self, account, transaction, *args, **kwargs):
        print(account)
      

class TestView(MerchantAPIView):
    VALIDATE_CLASS = CheckOrder

urlpatterns = [
    path('paycom/', TestView.as_view())
]

create_initialization.py

https://help.paycom.uz/uz/initsializatsiya-platezhey/otpravka-cheka-po-metodu-get

from paycomuz import Paycom
paycom = Paycom()
url = paycom.create_initialization(amount=5.00, order_id='197', return_url='https://example.com/success/')
print(url)

alt text

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

PaycomUz-3.1.tar.gz (8.9 kB view details)

Uploaded Source

File details

Details for the file PaycomUz-3.1.tar.gz.

File metadata

  • Download URL: PaycomUz-3.1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.11

File hashes

Hashes for PaycomUz-3.1.tar.gz
Algorithm Hash digest
SHA256 3a9c46e64e8906f2eea722acb79bb26153585a3e3ce0313c118c2e21e43ea41d
MD5 d2c83670af1db5a531ac9ca17a467764
BLAKE2b-256 97f903bc7e1fdf433969277bd1b64d62d8e038dd0601447d2dbb66a5faba80fe

See more details on using hashes here.

Supported by

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