about
Home page
integration with webkassa.kz
This package developed for Elefantoteam, for using in future projects
For contributors
NOTE: After clone this repository you should run command:
chmod ug+x.githooks/pre-commit
git config core.hooksPath .githooks
For users
setup
install via pip:
pip install elefanto-webkassa
install via poetry:
poetry add elefanto-webkassa
Configs
add it to installed apps in django settings.py:
INSTALLED_APPS = (
...,
'webkassa',
)
now add this to your settings.py:
WEBKASSA_CONFIG = {
'api_key': 'YOUR_WEBKASSA_API_KEY',
'encryption_key': 'SOME_ECRYPTION_KEY',
'url': 'WEBKASSA_API_URL',
}
Note
you can generate encryption_key by this command in python shell
import base64
import os
base64.urlsafe_b64encode(os.urandom(32))
Usage
after configure project, you should run migrate
python manage.py migrate
then go to admin page, find Webkassa accounts in WEBKASSA app and add new account
now you can use package
from webkassa.services.manager import WebKassaManager
...
data = {
'OperationType': int,
'Positions': [
{
'Count': int,
'Price': float,
'TaxPercent': int,
'TaxType': int,
'PositionName': str,
'PositionCode': str,
'Discount': int,
'Markup': int,
'SectionCode': str,
'UnitCode': int,
...
}
],
'Payments': [
{
'Sum': float,
'PaymentType': int
}
],
'TicketModifiers': [
{
'Sum': int,
'Text': str,
'Type': int,
'TaxType': int,
'TaxPercent': int,
'Tax': float
}
],
'Change': int,
'RoundType': int,
'CustomerEmail': str,
'ExternalOrderNumber': str,
'ExternalCheckNumber': str,
...
}
manager = WebKassaManager(email='<Account email>', cashbox_unique_number='<Cashbox number>')
ticket = manager.get_check(data)
ticket is instance of webkassa.models.Check, you can add it as OneToOneField on your payment model
Note
ExternalOrderNumber should be pk of your payment instance, and will be unique to avoid ticket duplicates
You can find list of tickets from admin page Checks in WEBKASSA
Also you can find error logs for integration. If for some reason error depends on package functionality please tell Джони ага 😜 or give him solution.
Metadata
Release files for elefanto-webkassa 0.4.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| elefanto_webkassa-0.4.5.tar.gz | 11.0 kB | Without provenance | Details for elefanto_webkassa-0.4.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| elefanto_webkassa-0.4.5-py3-none-any.whl | Python 3 | none | any | Details for elefanto_webkassa-0.4.5-py3-none-any.whl |
Total release size: 25.4 kB
Release files / elefanto_webkassa-0.4.5.tar.gz
| Download URL | elefanto_webkassa-0.4.5.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c0d9cee714558e396e644a168f4d04a32ec9187a6912b42fc5b0154d4751034b
|
|
BLAKE2b-256 checksum How to use checksums |
3b1ff47e5077c1c32c0402fce8e407642e3825adbd4576d164c4a55f58dae097
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.3 Darwin/22.5.0
|
Release files / elefanto_webkassa-0.4.5-py3-none-any.whl
| Download URL | elefanto_webkassa-0.4.5-py3-none-any.whl |
|---|---|
| Size | 14.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5281464fd67fd022bd75e98d1603a3d7ca13540521fef79447b1580dd2b92828
|
|
BLAKE2b-256 checksum How to use checksums |
764a9ca9ce99f0028af9b4931f0d45e8fd52e57e8c5859a5b26757e01d9dfad0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.3 Darwin/22.5.0
|
Security for elefanto-webkassa 0.4.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.