File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,6 @@ private function processPayment($order)
141
141
if (! isset ($ additionalInfo ['moyasar_payment_id ' ])) {
142
142
$ paymentId = $ payment ->getEntityId ();
143
143
$ orderId = $ order ->getId ();
144
- $ this ->logger ->warning ("Payment ( $ paymentId) of Order ( $ orderId) does not have Moyasar payment ID " );
145
144
return ;
146
145
}
147
146
Original file line number Diff line number Diff line change 4
4
5
5
use Magento \Framework \Event \Observer ;
6
6
use Magento \Framework \Event \ObserverInterface ;
7
+ use Moyasar \Mysr \Model \Payment \MoyasarApplePay ;
8
+ use Moyasar \Mysr \Model \Payment \MoyasarCc ;
9
+ use Moyasar \Mysr \Model \Payment \MoyasarSadad ;
7
10
8
11
class BeforeOrderPlaceObserver implements ObserverInterface
9
12
{
10
13
public function execute (Observer $ observer )
11
14
{
15
+ $ methods = [
16
+ MoyasarApplePay::CODE ,
17
+ MoyasarCc::CODE ,
18
+ MoyasarSadad::CODE
19
+ ];
20
+
12
21
$ order = $ observer ->getOrder ();
13
- $ order ->setCanSendNewEmailFlag (false );
22
+ if (!$ order ) {
23
+ return ;
24
+ }
25
+
26
+ $ payment = $ order ->getPayment ();
27
+
28
+ if ($ payment && in_array ($ payment ->getMethod (), $ methods )) {
29
+ $ order ->setCanSendNewEmailFlag (false );
30
+ }
14
31
}
15
32
}
You can’t perform that action at this time.
0 commit comments