Skip to content

Commit 206988a

Browse files
committed
MAGETWO-38894: Create config for New Payment
- CR
1 parent 224674d commit 206988a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app/code/Magento/Sales/Model/Order/Payment.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public function place()
256256

257257
$orderState = Order::STATE_NEW;
258258
$orderStatus = $methodInstance->getConfigData('order_status');
259-
$isCustomerNotified = null;
259+
$isCustomerNotified = $order->getCustomerNoteNotify();
260260

261261
// Do order payment validation on payment method level
262262
$methodInstance->validate();
@@ -267,9 +267,11 @@ public function place()
267267
$stateObject = new \Magento\Framework\Object();
268268
// For method initialization we have to use original config value for payment action
269269
$methodInstance->initialize($methodInstance->getConfigData('payment_action'), $stateObject);
270-
$orderState = $stateObject->getState() ?: $orderState;
271-
$orderStatus = $stateObject->getStatus() ?: $orderStatus;
272-
$isCustomerNotified = $stateObject->getIsNotified();
270+
$orderState = $stateObject->getData('state') ?: $orderState;
271+
$orderStatus = $stateObject->getData('status') ?: $orderStatus;
272+
$isCustomerNotified = $stateObject->hasData('is_notified')
273+
? $stateObject->getData('is_notified')
274+
: $isCustomerNotified;
273275
} else {
274276
$orderState = Order::STATE_PROCESSING;
275277
$this->processAction($action, $order);
@@ -278,8 +280,6 @@ public function place()
278280
}
279281
}
280282

281-
$isCustomerNotified = $isCustomerNotified === null ? $order->getCustomerNoteNotify() : $isCustomerNotified;
282-
283283
if (!in_array($orderStatus, $order->getConfig()->getStateStatuses($orderState))) {
284284
$orderStatus = $order->getConfig()->getStateDefaultStatus($orderState);
285285
}

0 commit comments

Comments
 (0)