Skip to content

Commit

Permalink
Release 4.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
edgaraswallee committed Sep 20, 2021
1 parent 7e4b77e commit b458422
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 4.0.9
- Allow to mark payment status as paid from status reminded

# 4.0.8
- Checkout form auto submission implemented when iFrame returns no input fields

Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG_de-DE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 4.0.9
- Erlaube, den Zahlungsstatus als bezahlt ab Status erinnert zu markieren

# 4.0.8
- Automatische Übermittlung des Checkout-Formulars implementiert, wenn iFrame keine Eingabefelder zurückgibt

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ tail -f var/log/wallee_payment*.log

## Documentation

[Documentation](https://plugin-documentation.wallee.com/wallee-payment/shopware-6/4.0.8/docs/en/documentation.html)
[Documentation](https://plugin-documentation.wallee.com/wallee-payment/shopware-6/4.0.9/docs/en/documentation.html)

## License

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@
"wallee/sdk": "3.0.1"
},
"type": "shopware-platform-plugin",
"version": "4.0.8"
"version": "4.0.9"
}
2 changes: 1 addition & 1 deletion docs/en/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h2>Documentation</h2> </div>
</a>
</li>
<li>
<a href="https://github.com/wallee-payment/shopware-6/releases/tag/4.0.8/">
<a href="https://github.com/wallee-payment/shopware-6/releases/tag/4.0.9/">
Source
</a>
</li>
Expand Down
89 changes: 89 additions & 0 deletions src/Migration/Migration1605701049StateMachineEntity.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?php declare(strict_types=1);

namespace WalleePayment\Migration;

use Doctrine\DBAL\Connection;
use Shopware\Core\Framework\Migration\MigrationStep;
use Shopware\Core\Framework\Uuid\Uuid;
use Shopware\Core\System\StateMachine\Aggregation\StateMachineState\StateMachineStateDefinition;
use Shopware\Core\System\StateMachine\Aggregation\StateMachineTransition\StateMachineTransitionDefinition;
use Shopware\Core\System\StateMachine\StateMachineDefinition;

/**
* Class Migration1605701049StateMachineEntity
*
* @package WalleePayment\Migration
*/
class Migration1605701049StateMachineEntity extends MigrationStep
{

/**
* get creation timestamp
*
* @return int
*/
public function getCreationTimestamp(): int
{
return 1605701049;
}

/**
* update non-destructive changes
*
* @param \Doctrine\DBAL\Connection $connection
*/
public function update(Connection $connection): void
{
try {
// Enable mark transaction as paid when it's on status reminded
$table = StateMachineDefinition::ENTITY_NAME;
$stateMachineId = $connection->fetchColumn(
"SELECT id FROM `$table` WHERE `technical_name` = :technical_name",
[
'technical_name' => 'order_transaction.state',
]
);

$table = StateMachineStateDefinition::ENTITY_NAME;
$remindedStateId = $connection->fetchColumn(
"SELECT id FROM `$table` WHERE `technical_name` = :technical_name AND `state_machine_id` = :state_machine_id",
[
'technical_name' => 'reminded',
'state_machine_id' => $stateMachineId,
]
);

$paidStateId = $connection->fetchColumn(
"SELECT id FROM `$table` WHERE `technical_name` = :technical_name AND `state_machine_id` = :state_machine_id",
[
'technical_name' => 'paid',
'state_machine_id' => $stateMachineId,
]
);

$id = Uuid::randomBytes();
$connection->insert(StateMachineTransitionDefinition::ENTITY_NAME,
[
'id' => $id,
'action_name' => 'paid',
'state_machine_id' => $stateMachineId,
'from_state_id' => $remindedStateId,
'to_state_id' => $paidStateId,
'created_at' => date('Y-m-d H:i:s')
]
);
} catch (\Exception $exception) {
// column probably exists
}
}

/**
* update destructive changes
*
* @param \Doctrine\DBAL\Connection $connection
*/
public function updateDestructive(Connection $connection): void
{
// implement update destructive
}
}

0 comments on commit b458422

Please sign in to comment.