Skip to content

Commit f7f4172

Browse files
author
Joan He
committed
Merge remote-tracking branch 'origin/MAGETWO-95745' into BugFixPR
2 parents c74b0bb + 64c8eee commit f7f4172

File tree

4 files changed

+15
-24
lines changed

4 files changed

+15
-24
lines changed

app/code/Magento/Checkout/Controller/Onepage/Success.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<?php
22
/**
3-
*
43
* Copyright © Magento, Inc. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
76
namespace Magento\Checkout\Controller\Onepage;
87

98
use Magento\Framework\App\Action\HttpGetActionInterface as HttpGetActionInterface;
109

10+
/**
11+
* Onepage checkout success controller class
12+
*/
1113
class Success extends \Magento\Checkout\Controller\Onepage implements HttpGetActionInterface
1214
{
1315
/**
@@ -26,7 +28,10 @@ public function execute()
2628
$resultPage = $this->resultPageFactory->create();
2729
$this->_eventManager->dispatch(
2830
'checkout_onepage_controller_success_action',
29-
['order_ids' => [$session->getLastOrderId()]]
31+
[
32+
'order_ids' => [$session->getLastOrderId()],
33+
'order' => $session->getLastRealOrder()
34+
]
3035
);
3136
return $resultPage;
3237
}

app/code/Magento/Paypal/Controller/Payflow/ReturnUrl.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
<?php
22
/**
3-
*
43
* Copyright © Magento, Inc. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
76
namespace Magento\Paypal\Controller\Payflow;
87

8+
use Magento\Framework\App\Action\HttpGetActionInterface;
99
use Magento\Framework\App\CsrfAwareActionInterface;
1010
use Magento\Framework\App\Request\InvalidRequestException;
1111
use Magento\Framework\App\RequestInterface;
1212
use Magento\Paypal\Controller\Payflow;
1313
use Magento\Paypal\Model\Config;
1414
use Magento\Sales\Model\Order;
1515

16-
class ReturnUrl extends Payflow implements CsrfAwareActionInterface
16+
/**
17+
* Paypal Payflow ReturnUrl controller class
18+
*/
19+
class ReturnUrl extends Payflow implements CsrfAwareActionInterface, HttpGetActionInterface
1720
{
1821
/**
1922
* @var array of allowed order states on frontend
@@ -68,7 +71,6 @@ public function execute()
6871
if ($order->getIncrementId()) {
6972
if ($this->checkOrderState($order)) {
7073
$redirectBlock->setData('goto_success_page', true);
71-
$this->_eventManager->dispatch('paypal_checkout_success', ['order' => $order]);
7274
} else {
7375
if ($this->checkPaymentMethod($order)) {
7476
$gotoSection = $this->_cancelPayment((string)$this->getRequest()->getParam('RESPMSG'));

app/code/Magento/Paypal/Test/Unit/Controller/Payflow/ReturnUrlTest.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66
namespace Magento\Paypal\Test\Unit\Controller\Payflow;
77

8-
use Magento\Framework\Event\ManagerInterface;
98
use Magento\Sales\Api\PaymentFailuresInterface;
109
use Magento\Checkout\Block\Onepage\Success;
1110
use Magento\Checkout\Model\Session;
@@ -97,11 +96,6 @@ class ReturnUrlTest extends \PHPUnit\Framework\TestCase
9796
*/
9897
private $paymentFailures;
9998

100-
/**
101-
* @var ManagerInterface|\PHPUnit_Framework_MockObject_MockObject
102-
*/
103-
private $eventManagerMock;
104-
10599
/**
106100
* @inheritdoc
107101
*/
@@ -158,16 +152,10 @@ protected function setUp()
158152
->disableOriginalConstructor()
159153
->getMock();
160154

161-
$this->eventManagerMock = $this->getMockBuilder(ManagerInterface::class)
162-
->disableOriginalConstructor()
163-
->getMock();
164-
165155
$this->context->method('getView')
166156
->willReturn($this->view);
167157
$this->context->method('getRequest')
168158
->willReturn($this->request);
169-
$this->context->method('getEventManager')
170-
->willReturn($this->eventManagerMock);
171159

172160
$this->returnUrl = $this->objectManager->getObject(
173161
ReturnUrl::class,
@@ -199,10 +187,6 @@ public function testExecuteAllowedOrderState($state)
199187
->with('goto_success_page', true)
200188
->willReturnSelf();
201189

202-
$this->eventManagerMock->expects($this->once())
203-
->method('dispatch')
204-
->with('paypal_checkout_success', $this->arrayHasKey('order'));
205-
206190
$result = $this->returnUrl->execute();
207191
$this->assertNull($result);
208192
}

app/code/Magento/Signifyd/etc/events.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
<event name="checkout_submit_all_after">
1010
<observer name="signifyd_place_order_observer" instance="Magento\Signifyd\Observer\PlaceOrder" />
1111
</event>
12-
<event name="paypal_express_place_order_success">
13-
<observer name="signifyd_place_order_paypal_express_observer" instance="Magento\Signifyd\Observer\PlaceOrder"/>
14-
</event>
1512
<event name="paypal_checkout_success">
1613
<observer name="signifyd_place_order_checkout_success_observer" instance="Magento\Signifyd\Observer\PlaceOrder" />
1714
</event>
15+
<event name="checkout_onepage_controller_success_action">
16+
<observer name="signifyd_place_order_checkout_success_observer" instance="Magento\Signifyd\Observer\PlaceOrder" />
17+
</event>
1818
</config>

0 commit comments

Comments
 (0)