Skip to content

Commit a21665e

Browse files
committed
MAGETWO-90106: Paypal cannot place the order when Payment Action = Order
1 parent ef3033f commit a21665e

File tree

7 files changed

+9
-5
lines changed

7 files changed

+9
-5
lines changed

app/code/Magento/Paypal/Block/Adminhtml/Order/View.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Magento\Framework\Exception\LocalizedException;
1818

1919
/**
20-
* Adminhtml sales order view
20+
* Adminhtml sales order view.
2121
* @api
2222
*/
2323
class View extends OrderView

app/code/Magento/Paypal/Controller/Adminhtml/Express/Authorization.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
class Authorization extends Order
3333
{
3434
/**
35-
* Authorization level of a basic admin session
35+
* Authorization level of a basic admin session.
3636
* @see _isAllowed()
3737
*/
3838
const ADMIN_RESOURCE = 'Magento_Paypal::authorization';

app/code/Magento/Paypal/Plugin/OrderCanInvoice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(Express $express)
3838
* @return bool
3939
* @throws \Magento\Framework\Exception\LocalizedException
4040
*/
41-
public function afterCanInvoice(Order $order, $result): bool
41+
public function afterCanInvoice(Order $order, bool $result): bool
4242
{
4343
if ($this->express->isOrderAuthorizationAllowed($order->getPayment())) {
4444
return false;

app/code/Magento/Paypal/Plugin/ValidatorCanInvoice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(Express $express)
4343
* @throws LocalizedException
4444
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4545
*/
46-
public function afterValidate(CanInvoice $subject, $result, OrderInterface $order): array
46+
public function afterValidate(CanInvoice $subject, bool $result, OrderInterface $order): array
4747
{
4848
if ($this->express->isOrderAuthorizationAllowed($order->getPayment())) {
4949
$result[] = __('An invoice cannot be created when none of authorization transactions available.');

app/code/Magento/Paypal/Test/Unit/Model/ExpressTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ public function testSetApiProcessableErrors()
130130

131131
/**
132132
* Tests order payment action.
133+
*
134+
* @return void
133135
*/
134136
public function testOrder()
135137
{

dev/tests/integration/testsuite/Magento/Paypal/Controller/Adminhtml/Express/AuthorizationTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ protected function setUp()
3939

4040
/**
4141
* Negative scenario for controller calls.
42+
*
43+
* @return void
4244
*/
4345
public function testNoOrderPassed()
4446
{
@@ -53,6 +55,7 @@ public function testNoOrderPassed()
5355
* @magentoConfigFixture current_store payment/paypal_express/payment_action Order
5456
* @magentoDataFixture Magento/Paypal/_files/order_express_payment_action_order.php
5557
* @magentoDbIsolation enabled
58+
* @return void
5659
*/
5760
public function testAuthorization()
5861
{

dev/tests/integration/testsuite/Magento/Paypal/_files/order_express_payment_action_order.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
76
declare(strict_types=1);
87

98
use Magento\Sales\Model\Order;

0 commit comments

Comments
 (0)