bluetools/moneybird_php_api — pull request #11 by ruudk (2012-04-17 11:39:02+00:00)
Title: Fixed sendInvoice method so that it will update the invoice object after sending

You don't get the invoice_id when you send the invoice. You'll have to fetch the invoice again. This is a bit ridiculous because the /send_invoice API endpoint gives you this information.

saveInvoice($invoice);

$invoice->markAsSent();

echo $invoice->invoice_id; // unknown

$invoice = $api->getInvoice($invoice->id);

echo $invoice->invoice_id; // gives a valid value
?>

So this PR updates the invoice object with the latest information.

This should probably be done everywhere but I don't need that ATM.