项目作者: baraja-core

项目描述 :
高级语言: PHP
项目地址: git://github.com/baraja-core/csob-payment-authorizator.git
创建时间: 2020-06-11T14:10:21Z
项目社区:https://github.com/baraja-core/csob-payment-authorizator

开源协议:MIT License

下载


CSOB Transaction authorizator

Integrity check

Find transactions in mail box, parse and call authorization logic.

📦 Installation & Basic Usage

This package can be installed using Package Manager which is also part of the Baraja Sandbox. If you are not using it, you have to install the package manually following this guide.

A model configuration can be found in the common.neon file inside the root of the package.

To manually install the package call Composer and execute the following command:

  1. $ composer require baraja-core/csob-payment-authorizator

In the projects common.neon you have to define the database credentials. A fully working example of configuration can be found in the common.neon file inside this package.

You can define the configuration simply using parameters (stored in the super-global array parameters).

For example:

  1. services:
  2. - Baraja\CsobPaymentChecker\CsobPaymentAuthorizator(%tempDir%, %csob.imapPath%, %csob.login%, %csob.password%)
  3. parameters:
  4. csob:
  5. imapPath: xxx
  6. login: xxx
  7. password: xxx

⚙️ Usage

In presenter use it very simply:

  1. /** @var CsobPaymentAuthorizator $csob **/
  2. $csob = $this->context->getByType(CsobPaymentAuthorizator::class);
  3. // Or simply:
  4. $csob = new Baraja\CsobPaymentChecker\CsobPaymentAuthorizator(...);
  5. // Check account and authorize new orders
  6. $unauthorizedVariables = [];
  7. $csob->authOrders(
  8. $unauthorizedVariables,
  9. function (Transaction $transaction): void {
  10. // Do something...
  11. }
  12. );

📄 License

baraja-core/csob-payment-authorizator is licensed under the MIT license. See the LICENSE file for more details.