mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #6459 from turbo124/v5-develop
Fixes for Stripe exceptions
This commit is contained in:
commit
b044be4db4
@ -795,6 +795,10 @@ class InvoiceController extends BaseController
|
|||||||
public function downloadPdf($invitation_key)
|
public function downloadPdf($invitation_key)
|
||||||
{
|
{
|
||||||
$invitation = $this->invoice_repo->getInvitationByKey($invitation_key);
|
$invitation = $this->invoice_repo->getInvitationByKey($invitation_key);
|
||||||
|
|
||||||
|
if(!$invitation)
|
||||||
|
return response()->json(["message" => "no record found"], 400);
|
||||||
|
|
||||||
$contact = $invitation->contact;
|
$contact = $invitation->contact;
|
||||||
$invoice = $invitation->invoice;
|
$invoice = $invitation->invoice;
|
||||||
|
|
||||||
|
@ -89,8 +89,8 @@ class StripePaymentDriver extends BaseDriver
|
|||||||
|
|
||||||
if(strlen($this->company_gateway->getConfigField('account_id')) > 1)
|
if(strlen($this->company_gateway->getConfigField('account_id')) > 1)
|
||||||
$this->stripe_connect_auth = ["stripe_account" => $this->company_gateway->getConfigField('account_id')];
|
$this->stripe_connect_auth = ["stripe_account" => $this->company_gateway->getConfigField('account_id')];
|
||||||
|
else
|
||||||
throw new \Exception('Stripe Connect has not been configured');
|
throw new \Exception('Stripe Connect has not been configured');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -65,7 +65,8 @@ class HandleReversal extends AbstractService
|
|||||||
|
|
||||||
/* Generate a credit for the $total_paid amount */
|
/* Generate a credit for the $total_paid amount */
|
||||||
$notes = 'Credit for reversal of '.$this->invoice->number;
|
$notes = 'Credit for reversal of '.$this->invoice->number;
|
||||||
|
$credit = false;
|
||||||
|
|
||||||
if ($total_paid > 0) {
|
if ($total_paid > 0) {
|
||||||
|
|
||||||
$credit = CreditFactory::create($this->invoice->company_id, $this->invoice->user_id);
|
$credit = CreditFactory::create($this->invoice->company_id, $this->invoice->user_id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user