Skip to content

Cannot do second partial invoice after first partial invoice #23946

Closed
@ghost

Description

Preconditions (*)

  1. Magento 2.2.8
  2. Braintree setup to authorize only

Steps to reproduce (*)

  1. Add 2+ products to cart
  2. Order products as guest using Credit Card
  3. In order admin, invoice for 1 item, This should go through fine
  4. Invoice again for 1 more item. Error will occur

Expected result (*)

  1. Second invoice should go through same as the first

Actual result (*)

  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue: Format is validGate 1 Passed. Automatic verification of issue format passed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions