Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove duplicated check is payment invoiceable
Method `InvoiceGenerator->renderInvoiceMailAttachment()` was checking if user or admin disabled invoicing for account. This is redundant (and not needed in this case). Few lines later is called `InvoiceGenerator->generate()` which contains `isPaymentInvoiceable()` check. Side effect: Sending invoice in case it was generated before user disabled invoicing. Previous condition would stop this email. But invoice was already generated (link stored in `$payment->invoice_id`). If invoice exists, it should be mailed to user. --- Added handling (where it was missing) for exceptions thrown by `InvoiceGenerator->renderInvoiceMailAttachment()`. - `PaymentNotInvoiceableException` is not logged in `PaymentInvoiceProviderManager` (and rest of places) because this is valid state. Some payments are not invoiceable, some users disabled invoicing. This shouldn't be logged as error. - `InvoiceGenerationException` is always logged. In most of the cases neither of these exceptions should stop processing. Eg. email should be sent (about new subscription or recurrent payment). It just will be sent without attachment. --- Not catching/logging exceptions in `SendInvoiceCommand`. This command is always run manually and exception message & trace are accessible (and helpful) directly in command output. --- remp/crm#1267
- Loading branch information