File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -366,6 +366,7 @@ public function order(InfoInterface $payment, $amount)
366
366
$ payment ,
367
367
['amount ' => $ amount ]
368
368
);
369
+
369
370
return $ this ;
370
371
}
371
372
@@ -379,6 +380,7 @@ public function authorize(InfoInterface $payment, $amount)
379
380
$ payment ,
380
381
['amount ' => $ amount ]
381
382
);
383
+
382
384
return $ this ;
383
385
}
384
386
@@ -406,6 +408,7 @@ public function refund(InfoInterface $payment, $amount)
406
408
$ payment ,
407
409
['amount ' => $ amount ]
408
410
);
411
+
409
412
return $ this ;
410
413
}
411
414
@@ -418,6 +421,7 @@ public function cancel(InfoInterface $payment)
418
421
'cancel ' ,
419
422
$ payment
420
423
);
424
+
421
425
return $ this ;
422
426
}
423
427
@@ -430,6 +434,7 @@ public function void(InfoInterface $payment)
430
434
'void ' ,
431
435
$ payment
432
436
);
437
+
433
438
return $ this ;
434
439
}
435
440
@@ -442,6 +447,7 @@ public function acceptPayment(InfoInterface $payment)
442
447
'accept_payment ' ,
443
448
$ payment
444
449
);
450
+
445
451
return $ this ;
446
452
}
447
453
@@ -454,7 +460,8 @@ public function denyPayment(InfoInterface $payment)
454
460
'deny_payment ' ,
455
461
$ payment
456
462
);
457
- return false ;
463
+
464
+ return $ this ;
458
465
}
459
466
460
467
/**
Original file line number Diff line number Diff line change @@ -1020,9 +1020,15 @@ public function deny($isOnline = true)
1020
1020
{
1021
1021
$ transactionId = $ isOnline ? $ this ->getLastTransId () : $ this ->getTransactionId ();
1022
1022
1023
- $ result = $ isOnline ?
1024
- $ this ->getMethodInstance ()->setStore ($ this ->getOrder ()->getStoreId ())->denyPayment ($ this ) :
1025
- (bool )$ this ->getNotificationResult ();
1023
+ if ($ isOnline ) {
1024
+ /** @var \Magento\Payment\Model\Method\AbstractMethod $method */
1025
+ $ method = $ this ->getMethodInstance ();
1026
+ $ method ->setStore ($ this ->getOrder ()->getStoreId ());
1027
+
1028
+ $ result = $ method ->denyPayment ($ this );
1029
+ } else {
1030
+ $ result = (bool )$ this ->getNotificationResult ();
1031
+ }
1026
1032
1027
1033
if ($ result ) {
1028
1034
$ invoice = $ this ->_getInvoiceForTransactionId ($ transactionId );
You can’t perform that action at this time.
0 commit comments