Skip to content

Commit 4bf2718

Browse files
mstrzyzewskitmotyl
authored andcommitted
Allow orders that are not paid yet to be imported (#19) (#20)
* Allow orders that are not paid yet to be imported (#19) * Allow only orders with state new to be updated
1 parent 5040eec commit 4bf2718

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

Model/OrderImporter.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
*/
1919
class OrderImporter
2020
{
21-
const BOUGHT_TYPE = 'BOUGHT';
2221
const STATUS_FILLED_IN = 'FILLED_IN';
23-
const STATUS_BOUGHT = 'BOUGHT';
2422

2523
private $errorsCount = 0;
2624
private $createdIds = [];
@@ -128,7 +126,7 @@ public function execute()
128126
*/
129127
private function executeEvent(EventInterface $event)
130128
{
131-
if ($event->getType() !== 'READY_FOR_PROCESSING') {
129+
if ($event->getType() === self::STATUS_FILLED_IN) {
132130
return;
133131
}
134132

Model/OrderImporter/Updater.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Updater extends AbstractAction
2121
*/
2222
public function execute(OrderInterface $order, CheckoutFormInterface $checkoutForm)
2323
{
24-
if (in_array($order->getState(), [Order::STATE_CANCELED, Order::STATE_CLOSED, Order::STATE_COMPLETE])) {
24+
if ($order->getState() !== Order::STATE_NEW) {
2525
return;
2626
}
2727

0 commit comments

Comments
 (0)