Skip to content

Commit da79b9c

Browse files
Chhandak.BaruaChhandak.Barua
authored andcommitted
ACP2E-3233: Admin can still place order even without payment method
1 parent 313c221 commit da79b9c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/code/Magento/Payment/Plugin/AdminSetPaymentMethod.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ public function __construct(
2929
* Checkout LayoutProcessor before process plugin.
3030
*
3131
* @param Create $subject
32-
* @param $data
32+
* @param array $data
3333
* @return void
3434
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3535
*/
36-
public function beforeImportPostData(Create $subject, $data)
36+
public function beforeImportPostData(Create $subject, array $data)
3737
{
38-
if (!isset($data['payment_method']) && !isset($this->request->getParam('payment')['method'])) {
38+
if (!isset($data['payment_method'])
39+
&& ($_POST)
40+
&& !isset($this->request->getParam('payment')['method'])) {
3941
$subject->setPaymentMethod('');
4042
}
4143
}

0 commit comments

Comments
 (0)