Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Adyen Magento2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shared Libs
Adyen Magento2
Commits
7a0a413b
Commit
7a0a413b
authored
Jul 26, 2017
by
Giorgos Adam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Injecting directly the AreaList and identifying if translation loading is needed
parent
35d88798
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
Model/Cron.php
Model/Cron.php
+11
-9
No files found.
Model/Cron.php
View file @
7a0a413b
...
...
@@ -26,7 +26,9 @@ namespace Adyen\Payment\Model;
use
Magento\Framework\Webapi\Exception
;
use
Magento\Sales\Model\Order\Email\Sender\OrderSender
;
use
Magento\Framework\App\Area
;
use
Magento\Framework\ObjectManagerInterface
;
use
Magento\Framework\App\AreaList
;
use
Magento\Framework\Phrase\Renderer\Placeholder
;
use
Magento\Framework\Phrase
;
class
Cron
{
...
...
@@ -165,9 +167,9 @@ class Cron
protected
$_adyenOrderPaymentCollectionFactory
;
/**
* @var
ObjectManagerInterface
* @var
AreaList
*/
protected
$_
objectManager
;
protected
$_
areaList
;
/**
* Cron constructor.
...
...
@@ -184,7 +186,7 @@ class Cron
* @param Api\PaymentRequest $paymentRequest
* @param Order\PaymentFactory $adyenOrderPaymentFactory
* @param Resource\Order\Payment\CollectionFactory $adyenOrderPaymentCollectionFactory
* @param
ObjectManagerInterface $objectManager
* @param
AreaList $areaList
*/
public
function
__construct
(
\Magento\Framework\App\Config\ScopeConfigInterface
$scopeConfig
,
...
...
@@ -199,7 +201,7 @@ class Cron
\Adyen\Payment\Model\Api\PaymentRequest
$paymentRequest
,
\Adyen\Payment\Model\Order\PaymentFactory
$adyenOrderPaymentFactory
,
\Adyen\Payment\Model\Resource\Order\Payment\CollectionFactory
$adyenOrderPaymentCollectionFactory
,
ObjectManagerInterface
$objectManager
AreaList
$areaList
)
{
$this
->
_scopeConfig
=
$scopeConfig
;
$this
->
_adyenLogger
=
$adyenLogger
;
...
...
@@ -213,7 +215,7 @@ class Cron
$this
->
_adyenPaymentRequest
=
$paymentRequest
;
$this
->
_adyenOrderPaymentFactory
=
$adyenOrderPaymentFactory
;
$this
->
_adyenOrderPaymentCollectionFactory
=
$adyenOrderPaymentCollectionFactory
;
$this
->
_
objectManager
=
$objectManager
;
$this
->
_
areaList
=
$areaList
;
}
/**
...
...
@@ -223,9 +225,9 @@ class Cron
public
function
processNotification
()
{
// needed for Magento < 2.2.0 https://github.com/magento/magento2/pull/8413
$
areaList
=
$this
->
_objectManager
->
get
(
\Magento\Framework\App\AreaList
::
class
);
if
(
$
areaList
)
{
$areaList
->
getArea
(
Area
::
AREA_CRONTAB
)
->
load
(
Area
::
PART_TRANSLATE
);
$
renderer
=
Phrase
::
getRenderer
(
);
if
(
$
renderer
instanceof
Placeholder
)
{
$
this
->
_
areaList
->
getArea
(
Area
::
AREA_CRONTAB
)
->
load
(
Area
::
PART_TRANSLATE
);
}
$this
->
_order
=
null
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment