-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Saferpay's transaction log show page
- Loading branch information
1 parent
1852ef9
commit cee8e17
Showing
14 changed files
with
215 additions
and
8 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
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
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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
{{ ('commerce_weavers_saferpay.ui.type_' ~ _context.data)|trans }} |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{% extends '@SyliusAdmin/layout.html.twig' %} | ||
|
||
{% block title %}{{ 'commerce_weavers_saferpay.ui.transaction_logs'|trans }} {{ parent() }}{% endblock %} | ||
|
||
{% block content %} | ||
<div id="header" class="ui stackable two column grid"> | ||
<div class="column"> | ||
<h1 class="ui header"> | ||
<i class="circular cube icon"></i> | ||
<div class="content"> | ||
<span>{{ 'commerce_weavers_saferpay.ui.transaction_log'|trans }}</span> | ||
<div class="sub header">{{ transaction_log.id }}</div> | ||
</div> | ||
</h1> | ||
{% import '@SyliusAdmin/Macro/breadcrumb.html.twig' as breadcrumb %} | ||
|
||
{% set breadcrumbs = [ | ||
{ label: 'sylius.ui.administration'|trans, url: path('sylius_admin_dashboard') }, | ||
{ label: 'commerce_weavers_saferpay.ui.transaction_logs'|trans, url: path('commerce_weavers_saferpay_admin_transaction_log_index') }, | ||
{ label: resource.name|default(resource.id) } | ||
] %} | ||
|
||
{{ breadcrumb.crumble(breadcrumbs) }} | ||
</div> | ||
</div> | ||
|
||
<div class="ui stackable grid"> | ||
<div class="eight wide column"> | ||
<div class="ui segment"> | ||
<h4 class="ui dividing header">{{ 'commerce_weavers_saferpay.ui.type'|trans }}</h4> | ||
<p {{ sylius_test_html_attribute('log-type') }}>{{ ('commerce_weavers_saferpay.ui.type_' ~ transaction_log.type)|trans }}</p> | ||
|
||
<h4 class="ui dividing header">{{ 'commerce_weavers_saferpay.ui.occurred_at'|trans }}</h4> | ||
<p>{{ transaction_log.occurredAt|date('Y-m-d H:i:s') }}</p> | ||
|
||
<h4 class="ui dividing header">{{ 'commerce_weavers_saferpay.ui.description'|trans }}</h4> | ||
<p {{ sylius_test_html_attribute('description') }}>{{ transaction_log.description }}</p> | ||
|
||
<h4 class="ui dividing header">{{ 'commerce_weavers_saferpay.ui.payment_id'|trans }}</h4> | ||
<p>{{ transaction_log.payment.id }} ({{ 'sylius.ui.order'|trans }}: #{{ transaction_log.payment.order.number }})</p> | ||
</div> | ||
</div> | ||
<div class="eight wide column"> | ||
<div class="ui segment"> | ||
<h4 class="ui dividing header">{{ 'commerce_weavers_saferpay.ui.context'|trans }}</h4> | ||
<pre {{ sylius_test_html_attribute('context') }}>{{ transaction_log.context|json_encode(constant('JSON_PRETTY_PRINT'))|trim|raw }}</pre> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} |
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
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\CommerceWeavers\SyliusSaferpayPlugin\Behat\Page\Admin\TransactionLog; | ||
|
||
use Behat\Mink\Element\NodeElement; | ||
use Sylius\Behat\Page\Admin\Crud\IndexPage as BaseIndexPage; | ||
|
||
class IndexPage extends BaseIndexPage implements IndexPageInterface | ||
{ | ||
public function openLogDetailsByOrderNumberAndDescription(string $orderNumber, string $description): void | ||
{ | ||
$row = $this->getRow($orderNumber, $description); | ||
$row->clickLink('Show'); | ||
} | ||
|
||
private function getRow(string $orderNumber, string $description): NodeElement | ||
{ | ||
$tableAccessor = $this->getTableAccessor(); | ||
$table = $this->getElement('table'); | ||
|
||
return $tableAccessor->getRowWithFields($table, ['orderNumber' => $orderNumber, 'description' => $description]); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
tests/Behat/Page/Admin/TransactionLog/IndexPageInterface.php
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\CommerceWeavers\SyliusSaferpayPlugin\Behat\Page\Admin\TransactionLog; | ||
|
||
use Sylius\Behat\Page\Admin\Crud\IndexPageInterface as BaseIndexPageInterface; | ||
|
||
interface IndexPageInterface extends BaseIndexPageInterface | ||
{ | ||
public function openLogDetailsByOrderNumberAndDescription(string $orderNumber, string $description): void; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\CommerceWeavers\SyliusSaferpayPlugin\Behat\Page\Admin\TransactionLog; | ||
|
||
use FriendsOfBehat\PageObjectExtension\Page\SymfonyPage; | ||
|
||
class ShowPage extends SymfonyPage implements ShowPageInterface | ||
{ | ||
public function getDescription(): string | ||
{ | ||
return $this->getElement('description')->getText(); | ||
} | ||
|
||
public function getLogType(): string | ||
{ | ||
return $this->getElement('log-type')->getText(); | ||
} | ||
|
||
public function getContext(): string | ||
{ | ||
return $this->getElement('context')->getText(); | ||
} | ||
|
||
public function getRouteName(): string | ||
{ | ||
return 'commerce_weavers_saferpay_admin_transaction_log_show'; | ||
} | ||
|
||
protected function getDefinedElements(): array | ||
{ | ||
return array_merge(parent::getDefinedElements(), [ | ||
'context' => '[data-test-context]', | ||
'description' => '[data-test-description]', | ||
'log-type' => '[data-test-log-type]', | ||
]); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
tests/Behat/Page/Admin/TransactionLog/ShowPageInterface.php
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tests\CommerceWeavers\SyliusSaferpayPlugin\Behat\Page\Admin\TransactionLog; | ||
|
||
use FriendsOfBehat\PageObjectExtension\Page\SymfonyPageInterface; | ||
|
||
interface ShowPageInterface extends SymfonyPageInterface | ||
{ | ||
public function getDescription(): string; | ||
|
||
public function getLogType(): string; | ||
|
||
public function getContext(): string; | ||
} |
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
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
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