Skip to content

Commit

Permalink
Fix tests, update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
trejjam authored and f3l1x committed Jan 13, 2021
1 parent b9d3c5d commit 556a4e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions .docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ comgate:
### Create payment
```php
use Brick\Money\Money;
use Contributte\Comgate\Entity\Codes\PaymentMethodCode;
use Contributte\Comgate\Entity\Payment;
use Contributte\Comgate\Gateway\PaymentService;
Expand All @@ -43,19 +44,18 @@ final class Payments
/** @var PaymentService */
private $paymentService;

public function createPayment(array $data): array
public function createPayment(array $data): array
{
$payment = Payment::of(
$data['price'] ?? 50,
$data['currency'] ?? 'CZK',
Money::of($data['price'] ?? 50, $data['currency'] ?? 'CZK'),
$data['label'] ?? 'Test item',
$data['refId'] ?? 'order101',
$data['email'] ?? 'dev@contributte.org',
PaymentMethodCode::ALL
);

$res = $this->paymentService->create($payment);

// $res->isOk();
return $res->getData();
}
Expand All @@ -76,10 +76,10 @@ final class Payments
/** @var PaymentService */
private $paymentService;

public function getStatus(string $transaction): array
public function getStatus(string $transaction): array
{
$res = $this->paymentService->status(PaymentStatus::of($transaction));

// $res->isOk();
return $res->getData();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/cases/Manual/payments.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php declare(strict_types = 1);

use Brick\Money\Money;
use Contributte\Comgate\DI\ComgateExtension;
use Contributte\Comgate\Entity\Codes\PaymentMethodCode;
use Contributte\Comgate\Entity\Payment;
Expand Down Expand Up @@ -39,8 +40,7 @@ function createPayment(): void
$payments = $container->getByType(PaymentService::class);

$payment = Payment::of(
50,
'CZK',
Money::of(50, 'CZK'),
'Test item',
'test001',
'dev@contributte.org',
Expand Down

0 comments on commit 556a4e5

Please sign in to comment.