Skip to main content

YooKassa API SDK Python Library

Project description

YooKassa API Python Client Library

Build Status Latest Stable Version Total Downloads License

Russian | English

This product is used for managing payments under The YooKassa API For usage by those who implemented YooKassa using the API method.

Features

  • Version 3.x supports Python >=3.7. To work on earlier versions of Python, use versions of yookassa 2.x
  • Changing the directory/file structure affected some package imports. When switching from the version of yookassa 2.x, check the imports in your project:
    • yookassa.domain.models.airlineyookassa.domain.models.payment_data.request.airline
    • yookassa.domain.models.authorization_detailsyookassa.domain.models.payment_data.response.authorization_details
    • yookassa.domain.models.receipt_customeryookassa.domain.models.receipt_data.receipt_customer
    • yookassa.domain.models.receipt_itemyookassa.domain.models.receipt_data.receipt_item
    • yookassa.domain.models.receipt_item_supplieryookassa.domain.models.receipt_data.receipt_item_supplier
    • yookassa.domain.models.recipientyookassa.domain.models.payment_data.recipient
    • yookassa.domain.models.refund_sourceyookassa.domain.models.refund_data.refund_source
  • Settings.get_account_settings() now returns the Me object. To support compatibility, object fields can be accessed as an array - me.account_id = me['account_id']
  • The me.fiscalization_enabled field is deprecated, but it is still supported. The me.fiscalization object has been added instead..

Requirements

  1. Python >=3.7
  2. pip

Installation

Under console using pip

  1. Install pip.
  2. In the console, run the following command:
pip install --upgrade yookassa

Under console using easy_install

  1. Install easy_install.
  2. In the console, run the following command:
easy_install --upgrade yookassa

Commencing work

  1. Import module
import yookassa
  1. Configure a Client
from yookassa import Configuration

Configuration.configure('<Account Id>', '<Secret Key>')

or

from yookassa import Configuration

Configuration.account_id = '<Account Id>'
Configuration.secret_key = '<Secret Key>'

or via oauth

from yookassa import Configuration

Configuration.configure_auth_token('<Oauth Token>')

If you agree to participate in the development of the SDK, you can submit data about your framework, cms or module:

from yookassa import Configuration
from yookassa.domain.common.user_agent import Version

Configuration.configure('<Account Id>', '<Secret Key>')
Configuration.configure_user_agent(
    framework=Version('Django', '2.2.3'),
    cms=Version('Wagtail', '2.6.2'),
    module=Version('Y.CMS', '0.0.1')
)
  1. Call the required API method. More details in our documentation for the YooKassa API

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

yookassa-3.4.1.tar.gz (116.1 kB view details)

Uploaded Source

File details

Details for the file yookassa-3.4.1.tar.gz.

File metadata

  • Download URL: yookassa-3.4.1.tar.gz
  • Upload date:
  • Size: 116.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.0

File hashes

Hashes for yookassa-3.4.1.tar.gz
Algorithm Hash digest
SHA256 1377b4b54d2e0c68dce64876d2a4b9f57f122ba35857a9ead9b69cea2dd9cb05
MD5 a765294ad722e22cb20415086e1d4280
BLAKE2b-256 5cd92855c3cb1fd51caf8a9d0500f213c7aa5f4eee5bbe924a25d042e42e30ee

See more details on using hashes here.

Supported by

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