Skip to content

Commit 257eb00

Browse files
Merge branch '2.4-develop' into escapekey-issue-onprompt-close
2 parents c14fbed + 5c5b60c commit 257eb00

File tree

90 files changed

+5331
-801
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+5331
-801
lines changed

app/code/Magento/Braintree/Gateway/Command/CaptureStrategyCommand.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
2222

2323
/**
24-
* Class CaptureStrategyCommand
24+
* Braintree capture implementation.
25+
*
2526
* @SuppressWarnings(PHPMD)
2627
*/
2728
class CaptureStrategyCommand implements CommandInterface
@@ -84,7 +85,7 @@ class CaptureStrategyCommand implements CommandInterface
8485
* @param FilterBuilder $filterBuilder
8586
* @param SearchCriteriaBuilder $searchCriteriaBuilder
8687
* @param SubjectReader $subjectReader
87-
* @param BraintreeAdapterFactory $braintreeAdapterFactory,
88+
* @param BraintreeAdapterFactory $braintreeAdapterFactory
8889
* @param BraintreeSearchAdapter $braintreeSearchAdapter
8990
*/
9091
public function __construct(
@@ -112,9 +113,9 @@ public function execute(array $commandSubject)
112113
{
113114
/** @var \Magento\Payment\Gateway\Data\PaymentDataObjectInterface $paymentDO */
114115
$paymentDO = $this->subjectReader->readPayment($commandSubject);
115-
116116
$command = $this->getCommand($paymentDO);
117-
$this->commandPool->get($command)->execute($commandSubject);
117+
118+
return $this->commandPool->get($command)->execute($commandSubject);
118119
}
119120

120121
/**
@@ -128,11 +129,8 @@ private function getCommand(PaymentDataObjectInterface $paymentDO)
128129
$payment = $paymentDO->getPayment();
129130
ContextHelper::assertOrderPayment($payment);
130131

131-
// if auth transaction does not exist then execute authorize&capture command
132+
// if capture transaction does not exist then execute capture command
132133
$existsCapture = $this->isExistsCaptureTransaction($payment);
133-
if (!$payment->getAuthorizationTransaction() && !$existsCapture) {
134-
return self::SALE;
135-
}
136134

137135
// do capture for authorization transaction
138136
if (!$existsCapture && !$this->isExpiredAuthorization($payment, $paymentDO->getOrder())) {

0 commit comments

Comments
 (0)