Skip to content

Commit

Permalink
Readme: added more examples
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Jul 6, 2016
1 parent c580738 commit 27d58a4
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions docs/v3.x/README-v3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 325,56 @@ Pro zrušení předautorizované platby budeme potřebovat `$paymentSessionId`.
$service->cancelPreAuthorized($paymentSessionId);
```

### Vlastní implementace

Pokud vám nějaká vlastnost chybí, můžete si většinu tříd podědit, případně složit přes `composition`.

#### Inheritance

```php
use Markette\Gopay\Service\RecurrentPaymentService;

final class MyRecurrentPaymentService extends RecurrentPaymentService
{

}
```

```yaml
extensions:
gopay: Markette\Gopay\DI\Extension

services:
gopay.service.payment: MyPaymentService
gopay.service.recurrentPayment: MyRecurrentPaymentService
gopay.service.preAuthorizedPayment: MyPreAuthorizedPaymentService
```
#### Composition
```php
use Markette\Gopay\Service\RecurrentPaymentService;

final class MyRecurrentPaymentService
{

/** @var RecurrentPaymentService */
private $gopay;

public function __construct(RecurrentPaymentService $gopay)
{
$this->gopay = $gopay;
}

}
```

```yaml
services:
- MyRecurrentPaymentService
```
-----
Příklad použití `gopay` služby si můžete prohlédnout v [ukázkovém presenteru](https://github.com/Markette/Gopay/blob/master/docs/v3.x/examples/GopayPresenter.php).

0 comments on commit 27d58a4

Please sign in to comment.