Python Yandex.Money API SDK
Requirements
Python 2.7 or Python 3.x
pip
Links
Getting started
Installation
Install it with pip install yandex-money-sdk
Paste from yandex_money.api import Wallet, ExternalPayment to your source code
Payments from the Yandex.Money wallet
Using Yandex.Money API requires following steps
Obtain token URL and redirect user’s browser to Yandex.Money service. Note: client_id, redirect_uri, client_secret are constants that you get, when register app in Yandex.Money API.
scope = ['account-info', 'operation-history'] # etc.. auth_url = Wallet.build_obtain_token_url(client_id, redirect_uri, scope)After that, user fills Yandex.Money HTML form and user is redirected back to REDIRECT_URI?code=CODE.
You should immediately exchange CODE with ACCESS_TOKEN.
access_token = Wallet.get_access_token(client_id, code, redirect_uri, client_secret=None)Now you can use Yandex.Money API.
account_info = api.account_info() balance = account_info['balance'] # and so on request_options = { "pattern_id": "p2p", "to": "410011161616877", "amount_due": "0.02", "comment": "test payment comment from yandex-money-python", "message": "test payment message from yandex-money-python", "label": "testPayment", "test_payment": true, "test_result": "success" }; request_result = api.request(request_options) # check status process_payment = api.process({ "request_id": request_result['request_id'], }) # check result if process_payment['status'] == "success": # show success page else: # something went wrong
Running tests
Clone this repo.
Create tests/constants.python file with ACCESS_TOKEN and CLIENT_ID constants.
Install tox
Run tox in repo root directory
Metadata
Release files for yandex-money-sdk 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| yandex-money-sdk-0.1.3.tar.gz | 5.3 kB | Without provenance | Details for yandex-money-sdk-0.1.3.tar.gz |
Release files / yandex-money-sdk-0.1.3.tar.gz
| Download URL | yandex-money-sdk-0.1.3.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be15d5a733e1c92038e40ca789e85aa103e0e3123f5127d0ce071fd97c692d25
|
|
BLAKE2b-256 checksum How to use checksums |
1d1d4a55bd569e64702e1c26a6b91517470fa498bef436232fcf99fa4f3b5a98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for yandex-money-sdk 0.1.3
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.