If the invoice is not retrieved from Stripe for whatever reason, the variable $stripeInvoice will not be set.
This results in return new Invoice($this, $stripeInvoice); failing.
Perhaps there should be a check in place (e.g. if (!isset($stripeInvoice)) { return null; }) to prevent an undefined variable error. Happy to put a PR together.
/**
* Find an invoice by ID.
*
* @param string $id
* @return \Laravel\Cashier\Invoice|null
*/
public function findInvoice($id)
{
try {
$stripeInvoice = StripeInvoice::retrieve(
$id, $this->stripeOptions()
);
} catch (Exception $exception) {
//
}
return new Invoice($this, $stripeInvoice);
}
Description:
If the invoice is not retrieved from Stripe for whatever reason, the variable
$stripeInvoice
will not be set.This results in
return new Invoice($this, $stripeInvoice);
failing.Perhaps there should be a check in place (e.g.
if (!isset($stripeInvoice)) { return null; }
) to prevent an undefined variable error. Happy to put a PR together.