|
21 | 21 | use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
|
22 | 22 |
|
23 | 23 | /**
|
24 |
| - * Class CaptureStrategyCommand |
| 24 | + * Braintree capture implementation. |
| 25 | + * |
25 | 26 | * @SuppressWarnings(PHPMD)
|
26 | 27 | */
|
27 | 28 | class CaptureStrategyCommand implements CommandInterface
|
@@ -84,7 +85,7 @@ class CaptureStrategyCommand implements CommandInterface
|
84 | 85 | * @param FilterBuilder $filterBuilder
|
85 | 86 | * @param SearchCriteriaBuilder $searchCriteriaBuilder
|
86 | 87 | * @param SubjectReader $subjectReader
|
87 |
| - * @param BraintreeAdapterFactory $braintreeAdapterFactory, |
| 88 | + * @param BraintreeAdapterFactory $braintreeAdapterFactory |
88 | 89 | * @param BraintreeSearchAdapter $braintreeSearchAdapter
|
89 | 90 | */
|
90 | 91 | public function __construct(
|
@@ -128,11 +129,8 @@ private function getCommand(PaymentDataObjectInterface $paymentDO)
|
128 | 129 | $payment = $paymentDO->getPayment();
|
129 | 130 | ContextHelper::assertOrderPayment($payment);
|
130 | 131 |
|
131 |
| - // if auth transaction does not exist then execute authorize&capture command |
| 132 | + // if capture transaction does not exist then execute capture command |
132 | 133 | $existsCapture = $this->isExistsCaptureTransaction($payment);
|
133 |
| - if (!$payment->getAuthorizationTransaction() && !$existsCapture) { |
134 |
| - return self::SALE; |
135 |
| - } |
136 | 134 |
|
137 | 135 | // do capture for authorization transaction
|
138 | 136 | if (!$existsCapture && !$this->isExpiredAuthorization($payment, $paymentDO->getOrder())) {
|
|
0 commit comments