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
35d88798
Commit
35d88798
authored
Jul 26, 2017
by
Giorgos Adam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable translations for Adyen cronjob, useful for order confirmation email sending for Magento 2.1
parent
506825ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
Model/Cron.php
Model/Cron.php
+17
-1
No files found.
Model/Cron.php
View file @
35d88798
...
...
@@ -25,6 +25,8 @@ 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
;
class
Cron
{
...
...
@@ -162,6 +164,11 @@ class Cron
*/
protected
$_adyenOrderPaymentCollectionFactory
;
/**
* @var ObjectManagerInterface
*/
protected
$_objectManager
;
/**
* Cron constructor.
*
...
...
@@ -177,6 +184,7 @@ class Cron
* @param Api\PaymentRequest $paymentRequest
* @param Order\PaymentFactory $adyenOrderPaymentFactory
* @param Resource\Order\Payment\CollectionFactory $adyenOrderPaymentCollectionFactory
* @param ObjectManagerInterface $objectManager
*/
public
function
__construct
(
\Magento\Framework\App\Config\ScopeConfigInterface
$scopeConfig
,
...
...
@@ -190,7 +198,8 @@ class Cron
\Adyen\Payment\Model\Resource\Billing\Agreement\CollectionFactory
$billingAgreementCollectionFactory
,
\Adyen\Payment\Model\Api\PaymentRequest
$paymentRequest
,
\Adyen\Payment\Model\Order\PaymentFactory
$adyenOrderPaymentFactory
,
\Adyen\Payment\Model\Resource\Order\Payment\CollectionFactory
$adyenOrderPaymentCollectionFactory
\Adyen\Payment\Model\Resource\Order\Payment\CollectionFactory
$adyenOrderPaymentCollectionFactory
,
ObjectManagerInterface
$objectManager
)
{
$this
->
_scopeConfig
=
$scopeConfig
;
$this
->
_adyenLogger
=
$adyenLogger
;
...
...
@@ -204,6 +213,7 @@ class Cron
$this
->
_adyenPaymentRequest
=
$paymentRequest
;
$this
->
_adyenOrderPaymentFactory
=
$adyenOrderPaymentFactory
;
$this
->
_adyenOrderPaymentCollectionFactory
=
$adyenOrderPaymentCollectionFactory
;
$this
->
_objectManager
=
$objectManager
;
}
/**
...
...
@@ -212,6 +222,12 @@ 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
);
}
$this
->
_order
=
null
;
// execute notifications from 2 minute or earlier because order could not yet been created by magento
...
...
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