Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
integration with webkassa.kz
This package developed for Elefantoteam, for using in future projects
NOTE: After clone this repository you should run command:
chmod ug+x.githooks/pre-commit
git config core.hooksPath .githooks
install via pip:
pip install elefanto-webkassa
install via poetry:
poetry add elefanto-webkassa
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))
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.
FAQs
Unknown package
We found that elefanto-webkassa demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.