1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Merge pull request #8146 from turbo124/v5-develop

Minor adjustments for hosted platform
This commit is contained in:
David Bomba 2023-01-13 20:24:10 +11:00 committed by GitHub
commit 4aded440e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,7 @@ use App\Models\Payment;
use App\Models\PaymentHash;
use App\Models\SystemLog;
use App\Services\Subscription\SubscriptionService;
use App\Utils\Ninja;
use App\Utils\Number;
use App\Utils\Traits\MakesDates;
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;
$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) {
$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
* by adding it as a line item, and then subtract