Mark a Commerce Order as Paid, via a custom plugin
Your best bet would be to create a transaction for the full amount:

$transaction = Plugin::getInstance()-&gt;transactions-&gt;createTransaction($order);
$transaction-&gt;status = \craft\commerce\records\Transaction::STATUS_SUCCESS;
$transaction-&gt;type = \craft\commerce\records\Transaction::TYPE_PURCHASE;
Plugin::getInstance()-&gt;transactions-&gt;saveTransaction($transaction);
$order-&gt;updateOrderPaidTotal();