This package is abandoned and no longer maintained. No replacement package was suggested.

EET integration into Nette

v0.1.0 2020-04-01 00:38 UTC

This package is auto-updated.

Last update: 2023-12-13 08:50:15 UTC


README

68747470733a2f2f62616467656e2e6e65742f62616467652f737570706f72742f6769747465722f6379616e 68747470733a2f2f62616467656e2e6e65742f62616467652f737570706f72742f666f72756d2f79656c6c6f77 68747470733a2f2f62616467656e2e6e65742f62616467652f73706f6e736f722f646f6e6174696f6e732f463936383534

Website 🚀 contributte.org | Contact 👨🏻‍💻 f3l1x.io | Twitter 🐦 @contributte

Disclaimer

⚠️ This project is no longer being maintained.
Composer contributte/eet
Version
PHP
License

Usage

To install the latest version of contributte/eet use Composer.

composer require contributte/eet

Documentation

Setup

Install package

composer require contributte/eet

Register extension

extensions:
	eet: Contributte\EET\DI\EETExtension

eet:
	certificate:
		path: %appDir%/../eet.p12
		password: my-password

Configuration

eet:
	certificate:
		path: %appDir%/../eet.p12
		password: my-password

	dispatcher:
		# Dispatcher setting
		service: production / playground
		validate: true / false

	receipt:
		# Set default receipt values
		id_pokl: 19903
		dic_popl: CZ1234

Usage

Client usage

use Contributte\EET;
use FilipSedivy;
use Nette;

final class SomePresenter extends Nette\Application\UI\Presenter
{
	/** @var EET\Dispatcher */
	private $client;

	/** @var EET\ReceiptFactory */
	private $receiptFactory;

	public function injectClientFactory(EET\ClientFactory $factory)
	{
		$this->client = $factory->create();
	}

	public function injectReceiptFactory(EET\ReceiptFactory $factory)
	{
		$this->receiptFactory = $factory;
	}

	public function processPayment()
	{
		$receipt = $this->receiptFactory->create();
		$receipt->porad_cis = '1';
		$receipt->celk_trzba = 500;

		try {
			$this->client->send($receipt);

			$this->payment->eet->save_success($this->client->getFik(), $this->client->getPkp());

		} catch (FilipSedivy\EET\Exceptions\EET\ClientException $clientException) {
			$this->payment->eet->save_error($clientException->getPkp(), $clientException->getBkp());

		}  catch (FilipSedivy\EET\Exceptions\EET\ErrorException $errorException) {
			echo '(' . $errorException->getCode() . ') ' . $errorException->getMessage();

		} catch(FilipSedivy\EET\Exceptions\Receipt\ConstraintViolationException $constraintViolationException){
			echo implode('<br>', $constraintViolationException->getErrors());

		}
	}
}

Development

This package was maintained by these authors.

538058?v=3&s=80 5647591?s=80&v=4

Consider to support contributte development team. Also thank you for using this package.