Unofficial Robokassa API
Project description
Robokassa API
You can use this simple library for create a link or use that for checks a signatures.
Example:
- Firstly, create Robokassa instance. If you use this in sandbox mode for test robokassa,
you need to paste a pair of test keys.
Also, don't forget check what
is_testargument equalsTrue.
from robokassa import Robokassa, HashAlgorithm
robokassa = Robokassa(
merchant_login="my_login",
password1="super_secret_test_password1",
password2="super_secret_test_password2",
algorithm=HashAlgorithm.sha512,
is_test=True
)
- After that, you can generate a link to payment page
Write a necessary params for a link. You can use
additional params. Choose default prefix of params.
It can be shp, Shp or SHP, don't specify
=symbol. Method automatically generate additional params. Next, you can use any params like in example:user_data,product_id.
my_payment_link = robokassa.payment.link.generate_by_script(
out_sum=1000,
inv_id=0,
description="It's my description",
success_url="https://example.com",
success_url_method="POST",
default_prefix="shp",
user_data="important_user_data",
product_id="790ec274-20af-4972-b5d6-c8698d64fb52"
)
- Check signature when you received robokassa notification in result, success or fail urls.
signature_is_success = robokassa.payment.check.result_url_signature_is_valid(
result_signature=("f31b7e1a669ee8686f14be357e5ed2144"
"1aca28893fa5b80032ad7f57af07fca80"
"2c5f23abb2628ec2d7826af43c8919d7d"
"06b4c6881e774b7dc8a056339a8cf"),
inv_id=0,
out_sum=1000,
shp_user_data="important_user_data",
shp_product_id="790ec274-20af-4972-b5d6-c8698d64fb52"
)
if signature_is_success:
print("Nice!")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
robokassa-0.3.3.tar.gz
(9.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
robokassa-0.3.3-py3-none-any.whl
(15.7 kB
view details)
File details
Details for the file robokassa-0.3.3.tar.gz.
File metadata
- Download URL: robokassa-0.3.3.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.12.3 Linux/5.15.153.1-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f172aaadf0b8c538faee78e9a09e7306d8f8ccffb3069ce2765f5e288c0b1ad
|
|
| MD5 |
9f741fa0c402ea1cbf4c200f78bda39e
|
|
| BLAKE2b-256 |
2c392a3e51fc79dc50e54d870f621d7406fc6e966a0c1967a2740fdafa131965
|
File details
Details for the file robokassa-0.3.3-py3-none-any.whl.
File metadata
- Download URL: robokassa-0.3.3-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.12.3 Linux/5.15.153.1-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03cf1d7ca0140acea0bd029fae60c2a015c87c9a32eda700c5c93fbf6fd4683a
|
|
| MD5 |
3033a0a53262f94384142ed8b3cd6815
|
|
| BLAKE2b-256 |
d842b7b18deb3a5c2b78f85a36dda1e3e13493f74806c9e26fd8d0a3b2b58ff6
|