Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
voronkovich committed Aug 15, 2018
1 parent cb33ade commit 7087aa6
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

PHP client for [Sberbank's acquiring](https://securepayments.sberbank.ru/wiki/doku.php/integration:api:start#%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D1%84%D0%B5%D0%B9%D1%81_rest) REST API.

## Requirements

- PHP 7.1 or above (Old version for PHP 5 you can find [here](https://github.com/voronkovich/sberbank-acquiring-client/tree/1.x))
- TLS 1.2 or above (more information you can find [here](https://civicrm.org/blog/yashodha/are-you-ready-for-tls-12-update-cant-escape-it))
- `php-json` extension installed

## Installation

```sh
Expand All @@ -21,6 +27,14 @@ use Voronkovich\SberbankAcquiring\Client;

$client = new Client(['userName' => 'username', 'password' => 'password']);
```
Alternatively you can use an authentication token:
```php
<?php

use Voronkovich\SberbankAcquiring\Client;

$client = new Client(['token' => 'sberbank-token']);
```

More advanced example:

Expand Down Expand Up @@ -75,6 +89,22 @@ $client = new Client(
]);
```

### Low level method "execute"

You can interact with the Sberbank REST API using a low level method `execute`:
```php
$client->execute('register.do', [
'orderNumber' => 1111,
'amount' => 10,
'returnUrl' => 'http://localhost/sberbank/success',
]);

$status = $client->execute('getOrderStatusExtended.do', [
'orderId' => '64fc8831-a2b0-721b-64fc-883100001553',
]);
```
But it's more convenient to use one of the shortcuts listed below.

### Creating a new order

[register.do](https://securepayments.sberbank.ru/wiki/doku.php/integration:api:rest:requests:register)
Expand Down

0 comments on commit 7087aa6

Please sign in to comment.