Skip to main content

FreeKassa Python SDK

Project description

FreeKassa Python SDK

FreeKassa Logo

Описание

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}")

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

fkassa-0.0.2.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fkassa-0.0.2-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file fkassa-0.0.2.tar.gz.

File metadata

  • Download URL: fkassa-0.0.2.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for fkassa-0.0.2.tar.gz
Algorithm Hash digest
SHA256 cef00fbc37ce70090fe60e14d0e1ac414dc098fe2d563ec278f9a836272382da
MD5 c0c94361b7aef0f68b014f917da51d5e
BLAKE2b-256 5c693a5291d905f46481ab371ef9ae631db491697c7725620e85499552e4b9a2

See more details on using hashes here.

File details

Details for the file fkassa-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: fkassa-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for fkassa-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1723c56baac48547275c75bda4af5367c6847b86a9be140ac7d4b2b5c8792f0b
MD5 709e712ac534c568357354c20d99830a
BLAKE2b-256 da0fced7926daca7193b5dc3104e7b6037d0fce25e948eec930e8ce0c841e039

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page