Skip to content

Commit

Permalink
-remove auth password parameter for payment uri
Browse files Browse the repository at this point in the history
*client test
+recurrent payment (csv only)
+recurrent tests
*refactoring signature
*refactoring http manager (providerError support csv)
*refactoring client
*soft fixes
+strict dependence on guzzle 6.3 (guzzle/guzzle#1973)
*fix readme and example
+example useRecurrentPayment
+fix for PR
  • Loading branch information
gitkv committed Jul 17, 2018
1 parent d1c7f63 commit 4ef7931
Show file tree
Hide file tree
Showing 25 changed files with 1,374 additions and 225 deletions.
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Also, this SDK integrated with [Payum](https://github.com/Payum/Payum) library a

Features:
* payment (method `pay`)
* recurrent (method `recurrent`)
* cancel (method `unblock`)
* receive results
* callback (method for verify incoming signature)
Expand All @@ -42,7 +43,6 @@ TODO:
* translate to English comments and system (error) messages
* validation
* implement method `card`
* implement method `recurrent`
* implement method `confirm`

## Install
Expand Down Expand Up @@ -99,6 +99,31 @@ $uniteller->payment([
])->go();
```

### Recurrent payment

```php
<?php
use Tmconsulting\Uniteller\Recurrent\RecurrentBuilder;

$builder = (new RecurrentBuilder())
->setOrderIdp(mt_rand(10000, 99999))
->setSubtotalP(15)
->setParentOrderIdp(00000) // order id of any past payment
->setParentShopIdp($uniteller->getShopId()); // optional

$results = $uniteller->recurrent($builder);
```

or use plain array

```php
<?php
$results = $uniteller->recurrent([
'Order_IDP' => mt_rand(10000, 99999),
// ... other parameters
]);
```

### Cancel payment

```php
Expand Down Expand Up @@ -148,7 +173,7 @@ Receive incoming parameters from gateway and verifying signature.

```php
<?php
if (! $uniteller->getSignature()->verify('signature_from_post_params', ['all_parameters_from_post'])) {
if (! $uniteller->getSignaturePayment()->verify('signature_from_post_params', ['all_parameters_from_post'])) {
return 'invalid_signature';
}
```
Expand Down
29 changes: 27 additions & 2 deletions README_RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ PHP (5.6+) SDK для интеграции с интернет-эквайрин

Реализовано:
* оплата (метод `pay`)
* рекуррентные платежи (метод `recurrent`)
* отмена (метод `unblock`)
* получение результатов
* callback (проверка сигнатуры)
Expand All @@ -41,7 +42,6 @@ PHP (5.6+) SDK для интеграции с интернет-эквайрин
* прикрутить валидацию, используя декораторы
* добавить билдер для метода `results`
* метод `card`
* метод `recurrent`
* метод `confirm`

## Установка
Expand Down Expand Up @@ -100,6 +100,31 @@ $uniteller->payment([
])->go();
```

### Рекуррентный платеж

```php
<?php
use Tmconsulting\Uniteller\Recurrent\RecurrentBuilder;

$builder = (new RecurrentBuilder())
->setOrderIdp(mt_rand(10000, 99999))
->setSubtotalP(15)
->setParentOrderIdp(00000) // id заказа магазина из ранее оплаченных в uniteller
->setParentShopIdp($uniteller->getShopId()); // не обязательно задавать, если родительский платеж из того же магазина

$results = $uniteller->recurrent($builder);
```

или

```php
<?php
$results = $uniteller->recurrent([
'Order_IDP' => mt_rand(10000, 99999),
// ...
]);
```

### Отмена платежа

```php
Expand Down Expand Up @@ -151,7 +176,7 @@ var_dump($results);

```php
<?php
if (! $uniteller->getSignature()->verify('signature_from_post_params', ['all_parameters_from_post'])) {
if (! $uniteller->getSignaturePayment()->verify('signature_from_post_params', ['all_parameters_from_post'])) {
return 'invalid_signature';
}
```
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"require": {
"php": ">=5.6",
"php-http/httplug": "^1.1",
"php-http/guzzle6-adapter": "^1.1"
"php-http/guzzle6-adapter": "^1.1",
"guzzlehttp/guzzle": "^6.3"
},
"require-dev": {
"symfony/var-dumper": "^3.2",
Expand Down
Loading

0 comments on commit 4ef7931

Please sign in to comment.