File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
app/code/Magento/Paypal/Plugin Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -49,15 +49,19 @@ public function __construct(
4949 public function beforeExecute (Subject $ subject ): void
5050 {
5151 $ data = $ this ->request ->getParams ();
52- $ orderId = (string )$ data ['INVNUM ' ];
52+ if (!array_key_exists ('INVNUM ' , $ data )
53+ || !array_key_exists ('RESPMSG ' , $ data )
54+ || !array_key_exists ('RESULT ' , $ data )) {
55+ return ;
56+ }
5357
58+ $ orderId = (string )$ data ['INVNUM ' ];
5459 if (!$ orderId ) {
5560 return ;
5661 }
5762
5863 $ order = $ this ->orderFactory ->create ()->loadByIncrementId ($ orderId );
5964 $ payment = $ order ->getPayment ();
60-
6165 if (in_array ($ order ->getState (), $ this ->allowedOrderStates ) || $ payment ->getLastTransId ()
6266 || trim ((string )$ data ['RESPMSG ' ]) !== 'Approved ' || (int )$ data ['RESULT ' ] !== 0 ) {
6367 return ;
You can’t perform that action at this time.
0 commit comments