-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff45720
commit 4a83d30
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,53 @@ | ||
CSOB Transaction authorizator | ||
============================= | ||
|
||
![Integrity check](https://github.com/baraja-core/csob-payment-authorizator/workflows/Integrity%20check/badge.svg) | ||
|
||
Find transactions in mail box, parse and call authorization logic. | ||
|
||
Install | ||
------- | ||
|
||
By Composer: | ||
|
||
```shell | ||
composer require baraja-core/csob-payment-authorizator | ||
``` | ||
|
||
And create service by Neon: | ||
|
||
```yaml | ||
services: | ||
- Baraja\CsobPaymentChecker\CsobPaymentAuthorizator(%tempDir%, %csob.imapPath%, %csob.login%, %csob.password%) | ||
|
||
parameters: | ||
csob: | ||
imapPath: xxx | ||
login: xxx | ||
password: xxx | ||
``` | ||
Usage | ||
----- | ||
In presenter use it very simply: | ||
```php | ||
/** @var CsobPaymentAuthorizator $csob **/ | ||
$csob = $this->context->getByType(CsobPaymentAuthorizator::class); | ||
|
||
// Or simply: | ||
|
||
$csob = new Baraja\CsobPaymentChecker\CsobPaymentAuthorizator(...); | ||
|
||
// Check account and authorize new orders | ||
|
||
$unauthorizedVariables = []; | ||
|
||
$csob->authOrders( | ||
$unauthorizedVariables, | ||
function (Transaction $transaction): void { | ||
// Do something... | ||
} | ||
); | ||
``` |