Closed

Description
Preconditions (*)
- Magento 2.2.8
- Braintree setup to authorize only
Steps to reproduce (*)
- Add 2+ products to cart
- Order products as guest using Credit Card
- In order admin, invoice for 1 item, This should go through fine
- Invoice again for 1 more item. Error will occur
Expected result (*)
- Second invoice should go through same as the first
Actual result (*)
- Second invoice does not go through
It looks like the capture strategy that is selected is VAULT_CAPTURE
but this cannot work for guests, as their card details are not stored and therefore $paymentToken = $extensionAttributes->getVaultPaymentToken();
returns null
I believe the capture strategy should be CAPTURE
but if this is used, the checks done in CaptureStrategyCommand
class won't pick this strategy.
Looks like the logic
if (!$existsCapture && !$this->isExpiredAuthorization($payment, $paymentDO->getOrder())) {
return self::CAPTURE;
}
is wrong, but if i force this strategy, further errors are encountered, with a response saying the transaction status in Braintree needs to be authorized
but it'll likely be on submitted_for_settlement
because the initial invoice was raised.