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
b800473e
Commit
b800473e
authored
Nov 14, 2017
by
Robin Westra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added sending of invoice emails if enabled in backend
parent
e63b0b71
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
Model/Cron.php
Model/Cron.php
+15
-4
No files found.
Model/Cron.php
View file @
b800473e
...
...
@@ -25,6 +25,7 @@ namespace Adyen\Payment\Model;
use
Magento\Framework\Webapi\Exception
;
use
Magento\Sales\Model\Order\Email\Sender\OrderSender
;
use
Magento\Sales\Model\Order\Email\Sender\InvoiceSender
;
use
Magento\Framework\App\Area
;
use
Magento\Framework\App\AreaList
;
use
Magento\Framework\Phrase\Renderer\Placeholder
;
...
...
@@ -71,6 +72,11 @@ class Cron
*/
protected
$_orderSender
;
/**
* @var InvoiceSender
*/
protected
$_invoiceSender
;
/**
* @var \Magento\Framework\DB\TransactionFactory
*/
...
...
@@ -180,6 +186,7 @@ class Cron
* @param \Magento\Sales\Model\OrderFactory $orderFactory
* @param \Adyen\Payment\Helper\Data $adyenHelper
* @param OrderSender $orderSender
* @param InvoiceSender $invoiceSender
* @param \Magento\Framework\DB\TransactionFactory $transactionFactory
* @param Billing\AgreementFactory $billingAgreementFactory
* @param Resource\Billing\Agreement\CollectionFactory $billingAgreementCollectionFactory
...
...
@@ -195,6 +202,7 @@ class Cron
\Magento\Sales\Model\OrderFactory
$orderFactory
,
\Adyen\Payment\Helper\Data
$adyenHelper
,
OrderSender
$orderSender
,
InvoiceSender
$invoiceSender
,
\Magento\Framework\DB\TransactionFactory
$transactionFactory
,
\Adyen\Payment\Model\Billing\AgreementFactory
$billingAgreementFactory
,
\Adyen\Payment\Model\Resource\Billing\Agreement\CollectionFactory
$billingAgreementCollectionFactory
,
...
...
@@ -209,6 +217,7 @@ class Cron
$this
->
_orderFactory
=
$orderFactory
;
$this
->
_adyenHelper
=
$adyenHelper
;
$this
->
_orderSender
=
$orderSender
;
$this
->
_invoiceSender
=
$invoiceSender
;
$this
->
_transactionFactory
=
$transactionFactory
;
$this
->
_billingAgreementFactory
=
$billingAgreementFactory
;
$this
->
_billingAgreementCollectionFactory
=
$billingAgreementCollectionFactory
;
...
...
@@ -1440,12 +1449,14 @@ class Cron
$this
->
_setPaymentAuthorized
();
$invoiceAutoMail
=
(
bool
)
$this
->
_getConfigData
(
'send_invoice_update_mail'
,
'adyen_abstract'
,
$this
->
_order
->
getStoreId
()
$invoiceAutoMail
=
(
bool
)
$this
->
_scopeConfig
->
isSetFlag
(
\Magento\Sales\Model\Order\Email\Container\InvoiceIdentity
::
XML_PATH_EMAIL_ENABLED
,
\Magento\Store\Model\ScopeInterface
::
SCOPE_STORE
,
$this
->
_order
->
getStoreId
()
);
if
(
$invoiceAutoMail
)
{
$
invoice
->
sendEmail
(
);
$
this
->
_invoiceSender
->
send
(
$invoice
);
}
}
else
{
$this
->
_adyenLogger
->
addAdyenNotificationCronjob
(
'It is not possible to create invoice for this order'
);
...
...
@@ -1587,4 +1598,4 @@ class Cron
$path
=
'payment/'
.
$paymentMethodCode
.
'/'
.
$field
;
return
$this
->
_scopeConfig
->
getValue
(
$path
,
\Magento\Store\Model\ScopeInterface
::
SCOPE_STORE
,
$storeId
);
}
}
\ No newline at end of file
}
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