Fixes for Stripe exceptions

This commit is contained in:
David Bomba 2021-08-15 15:30:46 +10:00
parent e17cd1ba2e
commit 5f0efcffc5
3 changed files with 8 additions and 3 deletions

View File

@ -795,6 +795,10 @@ class InvoiceController extends BaseController
public function downloadPdf($invitation_key)
{
$invitation = $this->invoice_repo->getInvitationByKey($invitation_key);
if(!$invitation)
return response()->json(["message" => "no record found"], 400);
$contact = $invitation->contact;
$invoice = $invitation->invoice;

View File

@ -89,8 +89,8 @@ class StripePaymentDriver extends BaseDriver
if(strlen($this->company_gateway->getConfigField('account_id')) > 1)
$this->stripe_connect_auth = ["stripe_account" => $this->company_gateway->getConfigField('account_id')];
throw new \Exception('Stripe Connect has not been configured');
else
throw new \Exception('Stripe Connect has not been configured');
}
else
{

View File

@ -65,7 +65,8 @@ class HandleReversal extends AbstractService
/* Generate a credit for the $total_paid amount */
$notes = 'Credit for reversal of '.$this->invoice->number;
$credit = false;
if ($total_paid > 0) {
$credit = CreditFactory::create($this->invoice->company_id, $this->invoice->user_id);