Skip to content

Commit 83dfe8c

Browse files
committed
MC-29527: Support sale operation by Magento payment provider gateway
1 parent 9125aa6 commit 83dfe8c

File tree

15 files changed

+954
-321
lines changed

15 files changed

+954
-321
lines changed

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

Lines changed: 4 additions & 6 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(
@@ -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)