Skip to main content

Sberbank payments service

Project description

Sberbank
========

Installation
-----------

1. Add "sberbank" to your INSTALLED_APPS settings:
```python
INSTALLED_APPS = [
...
'sberbank',
]
```

2. Add merchants params to your settings:
```python
MERCHANTS = {
%merchant_id%: {
'username': %merchant_username%,
'password': %merchant_password%,
'success_url': %default_success_url%
}
}
```

3. Add callback url to you urls.py:
```python
urlpatterns = [
...
url('/sberbank', include('sberbank.urls'))
]

```

Sberbank
========

Installation
-----------

1. Add "sberbank" to your INSTALLED_APPS settings:
```python
INSTALLED_APPS = [
...
'sberbank',
]
```

2. Add merchants params to your settings:
```python
MERCHANTS = {
%merchant_id%: {
'username': %merchant_username%,
'password': %merchant_password%,
'success_url': %default_success_url%
}
}
```

3. Add callback url to you urls.py:
```python
urlpatterns = [
...
url('/sberbank', include('sberbank.urls'))
]

```

4. Run `python manage.py migrate` to create models.

Usage
-----------
* Pay

```python
from sberbank.service import BankService

instance = BankService(%merchant_id%)
payment = instance.pay(amount=%amount%)
```
Response:

| name | type | example |
|----- | ---- | ------- |
| payment_id | UUID | UUID('8b7e1798-eb96-402d-ac0e-fa23042d05a7') |
| redirest_url | string | https://3dsec.sberbank.ru/payment/merchants/upravdoma/payment_ru.html?mdOrder=c12f8fae-447c-7853-c12f-8fae0000302b |

* Check payment status:

```python
from sberbank.service import BankService

instance = BankService(%merchant_id%)
status = instance.check_status(%payment_id%)
```
Response:

| name | type | example |
|----- | ---- | ------- |
| status | ENUM | <Status.CREATED: 0> |
| amount | decimal | 190.82 |
| created| datetime | datetime.datetime(2018, 1, 26, 9, 4, 1, 950122) |
| updated| datetime | datetime.datetime(2018, 1, 26, 9, 4, 1, 950122) |



Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

sberbank-0.34-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file sberbank-0.34-py3-none-any.whl.

File metadata

File hashes

Hashes for sberbank-0.34-py3-none-any.whl
Algorithm Hash digest
SHA256 b3033340e6c383c3c19fb6718dffc52ef239f874b67edc635083df3232d04c8a
MD5 9ce0fba00a21e885a61a23c4d2fe26ca
BLAKE2b-256 da4dd0881b50bc9d71a2d234b854ea68dd609a4f14177d039d5cbe68a3ccf383

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