Minor adjustments for hosted platform

This commit is contained in:
David Bomba 2023-01-13 20:23:47 +11:00
parent da60b4dbf0
commit 77f330afe2

View File

@ -25,6 +25,7 @@ use App\Models\Payment;
use App\Models\PaymentHash; use App\Models\PaymentHash;
use App\Models\SystemLog; use App\Models\SystemLog;
use App\Services\Subscription\SubscriptionService; use App\Services\Subscription\SubscriptionService;
use App\Utils\Ninja;
use App\Utils\Number; use App\Utils\Number;
use App\Utils\Traits\MakesDates; use App\Utils\Traits\MakesDates;
use App\Utils\Traits\MakesHash; use App\Utils\Traits\MakesHash;
@ -195,13 +196,14 @@ class InstantPayment
$credit_totals = $first_invoice->client->getSetting('use_credits_payment') == 'always' ? $first_invoice->client->service()->getCreditBalance() : 0; $credit_totals = $first_invoice->client->getSetting('use_credits_payment') == 'always' ? $first_invoice->client->service()->getCreditBalance() : 0;
$starting_invoice_amount = $first_invoice->balance; $starting_invoice_amount = $first_invoice->balance;
/* Schedule a job to check the gateway fees for this invoice*/
if(Ninja::isHosted())
CheckGatewayFee::dispatch($first_invoice->id, $client->company->db)->delay(600);
if ($gateway) { if ($gateway) {
$first_invoice->service()->addGatewayFee($gateway, $payment_method_id, $invoice_totals)->save(); $first_invoice->service()->addGatewayFee($gateway, $payment_method_id, $invoice_totals)->save();
} }
/* Schedule a job to check the gateway fees for this invoice*/
CheckGatewayFee::dispatch($first_invoice->id, $client->company->db)->delay(600);
/** /**
* Gateway fee is calculated * Gateway fee is calculated
* by adding it as a line item, and then subtract * by adding it as a line item, and then subtract