Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ Python 2.6+ или 3.3+
В случае успеха возвращает объект типа ``Transaction``.


| **Выплата по токену** (`описание <https://cloudpayments.ru/Docs/Api#topup>`__)

.. code:: python

topup(self, token, amount, account_id, currency)

``currency`` — одна из констант, определенных в классе ``Currency``

В случае успеха возвращает объект типа ``Transaction``.


| **Подтверждение оплаты** (`описание <http://cloudpayments.ru/Docs/Api#confirm>`__)

.. code:: python
Expand Down
13 changes: 13 additions & 0 deletions cloudpayments/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,19 @@ def refund(self, transaction_id, amount):
if not response['Success']:
raise CloudPaymentsError(response)

def topup(self, token, amount, account_id, currency):
params = {
'Token': token,
'Amount': amount,
'AccountId': account_id,
'Currency': currency
}
response = self._send_request('payments/cards/topup', params)

if not response['Success']:
raise CloudPaymentsError(response)


def find_payment(self, invoice_id):
params = {'InvoiceId': invoice_id}
response = self._send_request('payments/find', params)
Expand Down