Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Garpix Order

from garpix_order.models import BaseOrder, BaseOrderItem, BasePayment


class Order(BaseOrder):
    pass


class Service(BaseOrderItem):
    def pay(self):
        pass


class Invoice(BasePayment):
    pass

BaseOrder - основной класс заказа.

items - метод для получения связанных OrderItem.

items_amount - метод для получения суммы оплаты.

BaseOrderItem - части заказа. В один заказ можно положить несколько сущностей.

pay - метод вызовет у всех BaseOrderItem, когда оплачивается заказ.

full_amount - метод возвращает полную сумма заказа.

Invoice - Основная модель для отслеживания статуса оплаты (транзакция). Содержит status с типом FSM.

Эквайринг Сбер

BaseSberPayment Абстрактная модель для платежей Сбера. Для работы необходимо создать свою модель-наследник, затем указать путь до нее в settings.py, например:

SBER_PAYMENT_MODEL = 'path.to.your.app.models.SberPaymentModel'

Методы для создания платежа, получение его данных от провайдера и callback находятся в garpix_order.services.sber.SberService.

Логирование ошибок при запросах к эквайрингу (на данный момент поддерживается только в SberService)

Пример добавления логирования в settings.py с использованием библиотеки python-json-logger:

pip install python-json-logger
from garpix_order.logging.filters import PaymentAuthDataFilter


LOGGING = {
    "version": 1,
    "disable_existing_loggers": False,
    "filters": {
        "payment_auth_data_filter": {
            "()": PaymentAuthDataFilter,
        }
    },
    "formatters": {
        "json": {
            "format": "%(asctime)s %(levelname)s %(message)s %(module)s",
            "datefmt": "%Y-%m-%dT%H:%M:%SZ",
            "class": "pythonjsonlogger.jsonlogger.JsonFormatter",
        }
    },
    "handlers": {
        "stdout": {
            "class": "logging.StreamHandler",
            "stream": "ext://sys.stdout",
            "formatter": "json",
            "filters": ["payment_auth_data_filter"],
        }
    },
    "loggers": {"garpix_order.services.sber": {"handlers": ["stdout"], "level": "INFO", "propagate": False}},
}

Metadata

Release files for garpix-order 1.0.0rc9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for garpix-order 1.0.0rc9
File Size Uploaded Provenance Actions
garpix_order-1.0.0rc9.tar.gz 56.0 kB Without provenance Details for garpix_order-1.0.0rc9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for garpix-order 1.0.0rc9
File Interpreter ABI Platform Actions
garpix_order-1.0.0rc9-py3-none-any.whl Python 3 none any Details for garpix_order-1.0.0rc9-py3-none-any.whl

Total release size: 151.4 kB

Release files / garpix_order-1.0.0rc9.tar.gz

Download URL garpix_order-1.0.0rc9.tar.gz
Size 56.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d7f9ec08756df9e86b1cfb5fb39d1064a7473b49f25f3661a4233845b432015a
BLAKE2b-256 checksum
How to use checksums
6f5efb09c7c3d2b9128867329fbbf9567a6d8cfc48926b942a80d458dd1cccf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/6.0.0 pkginfo/1.9.6 requests/2.28.2 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/3.8.19

Release files / garpix_order-1.0.0rc9-py3-none-any.whl

Download URL garpix_order-1.0.0rc9-py3-none-any.whl
Size 95.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff40a4186f0bac37041a77791a34090edc121cebe9c05b1b0f608980089ae8c2
BLAKE2b-256 checksum
How to use checksums
c288a5f1840e3447384702de2fbde5155c7ba843feed7c1be89e1c53e0e95a52
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/6.0.0 pkginfo/1.9.6 requests/2.28.2 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/3.8.19

Security for garpix-order 1.0.0rc9

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page