How can we programmatically change the status of an invoice to Paid
for an order with an offline payment method (eg bank transfer or cash)?
I have tried using the following capture method but this still leaves the invoice as Pending
:
$order->load($_POST['order']);
$order->getPayment()->capture();
$order->save();
So how can we update an invoice with an offline payment method to Paid
?