contributte / eet
此包已被放弃且不再维护。未建议替代包。
EET集成到Nette
v0.1.0
2020-04-01 00:38 UTC
Requires
- php: >=7.1
- filipsedivy/php-eet: ^4.1
- nette/di: ^3.0
Requires (Dev)
- ninjify/nunjuck: ^0.2.0
- ninjify/qa: ^0.9.0
- phpstan/phpstan-deprecation-rules: ^0.11
- phpstan/phpstan-nette: ^0.11
- phpstan/phpstan-shim: ^0.11
- phpstan/phpstan-strict-rules: ^0.11
This package is auto-updated.
Last update: 2023-12-13 08:50:15 UTC
README
网站 🚀 contributte.org | 联系 👨🏻💻 f3l1x.io | Twitter 🐦 @contributte
免责声明
⚠️ | 该项目不再维护。 |
---|
Composer | contributte/eet |
---|---|
版本 | |
PHP | |
许可证 |
使用
要安装 contributte/eet 的最新版本,请使用 Composer。
composer require contributte/eet
文档
设置
安装包
composer require contributte/eet
注册扩展
extensions: eet: Contributte\EET\DI\EETExtension eet: certificate: path: %appDir%/../eet.p12 password: my-password
配置
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
使用
客户端使用
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()); } } }
开发
此包由以下作者维护。
请考虑支持 contributte 开发团队。也感谢您使用此包。