Skip to main content

Paycomuz

Project description

alt text

Downloads alt text alt text alt text

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 = {
    "PAYCOM_ENV": False,  # test host
    "TOKEN": "token",  # token
    "SECRET_KEY": "password",  # password
    "ACCOUNTS": {
        "KEY_1": "order_id",
        "KEY_2": None  # or "type"
    }
}

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

Create paycom user

python manage.py create_paycom_user

view.py

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

class CheckOrder(Paycom):
    def check_order(self, amount, account):
        return self.ORDER_FOUND

class TestView(MerchantAPIView):
    VALIDATE_CLASS = CheckOrder

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

create_transaction.py

from paycomuz import Paycom
paycom = Paycom()

# Create Card
amount = 5000.00
card = paycom.create_cards(card_number='8600 4954 7331 6478', expire='03/20', amount=amount, save=False)
print(card)
token = card['token']

# Create Transaction
result = paycom.create_transaction(token=token, order_id=1, amount=amount)
print(result)

AUTHOR @begyy AUTHOR @jSardor

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-2.0.tar.gz (6.4 kB view hashes)

Uploaded Source

Built Distribution

PaycomUz-2.0-py3-none-any.whl (10.5 kB view hashes)

Uploaded Python 3

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