Commerce 2.x doesn't fully support partial captures - it does support full captures, full or partial refunds.

The trick is to create duplicate of an existing payment on capturePayment() call for the remaining amount.

Comments

zaporylie created an issue. See original summary.

zaporylie’s picture

Status: Active » Needs review
StatusFileSize
new1.29 KB

This should do.

zaporylie’s picture

Manual testing proved that patch is in fact working, but before it gets committed automated tests must be added (preferably Kernel). Tests must cover:
- capturing on the partial amount
- capturing on full amount
- capturing without providing amount (remaining)

zaporylie’s picture

StatusFileSize
new15.93 KB

Added tests from #3

zaporylie’s picture

StatusFileSize
new16.1 KB

Coding standards fix.

  • zaporylie committed f963269 on 8.x-4.x
    Issue #3045050 by zaporylie: Create payment entity copy when partially...
zaporylie’s picture

Status: Needs review » Fixed

Pushed to 8.x-4.x

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.