FreeKassa Python SDK
Описание
FreeKassa Python SDK — это библиотека для интеграции с API FreeKassa, позволяющая легко управлять платежами, заказами и выплатами. С помощью этого SDK вы сможете быстро создать платежные ссылки, получать информацию о заказах и управлять своим балансом.
Установка
pip install fkassa
Использование
Инициализация
Для начала работы с библиотекой, вам необходимо инициализировать класс FreeKassa с вашими учетными данными:
from fkassa import FreeKassa
free_kassa = FreeKassa(
shop_id=12345,
api_key='your_api_key',
secret_word_1='your_secret_word'
)
Создание ссылки на оплату
Чтобы создать ссылку на оплату, используйте метод create_payment_link:
payment_link = free_kassa.create_payment_link(
order_id='order_001',
amount=100.0,
currency='RUB'
)
print(f"Ссылка на оплату: {payment_link}")
Получение списка заказов
Вы можете получить список заказов с помощью метода get_orders:
orders_response = free_kassa.get_orders()
for order in orders_response.orders:
print(f"Заказ ID: {order.id}, Статус: {order.status}")
Создание заказа
Для создания нового заказа используйте метод create_order:
order_response = free_kassa.create_order(
order_id='order_002',
amount=150.0,
currency='USD',
email='customer@example.com'
)
print(f"Созданный заказ ID: {order_response.fk_id}, Ссылка: {order_response.url}")
Проверка статуса платежной системы
Чтобы проверить доступность платежной системы, используйте метод check_payment_system_status:
status_response = free_kassa.check_payment_system_status(PaymentSystem.SBP)
if status_response.type == "success":
print("Платежная система доступна.")
else:
print(f"Ошибка: {status_response.description}")
Metadata
Release files for fkassa 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fkassa-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for fkassa-0.0.4-py3-none-any.whl |
Release files / fkassa-0.0.4-py3-none-any.whl
| Download URL | fkassa-0.0.4-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8bcca1a6993599ea255b056e1e7baf45c2e776fbb4e21f5af807c63c08752d21
|
|
BLAKE2b-256 checksum How to use checksums |
a48fae062445ec53f55f4e273bded574f4786c7c8d9f359d07d136f9b887a4bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.5
|
Security for fkassa 0.0.4
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.