1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Adjust BTCPay for scoping

This commit is contained in:
David Bomba 2024-06-27 14:52:38 +10:00
parent 4909e1a31e
commit 7288e5b641
4 changed files with 12 additions and 20 deletions

View File

@ -54,13 +54,6 @@ class PostUpdate extends Command
info('finished migrating');
$output = [];
// exec('vendor/bin/composer install --no-dev -o', $output);
info(print_r($output, 1));
info('finished running composer install ');
try {
// Artisan::call('optimize');
Artisan::call('config:clear');

View File

@ -131,9 +131,11 @@ class BTCPayPaymentDriver extends BaseDriver
$this->payment_hash = PaymentHash::whereRaw('BINARY `hash`= ?', [$btcpayRep->metadata->InvoiceNinjaPaymentHash])->firstOrFail();
$StatusId = Payment::STATUS_PENDING;
if ($this->payment_hash->payment_id == null) {
//$_invoice = collect($this->payment_hash->data->invoices)->first();
$_invoice = Invoice::query()->where('number', $btcpayRep->metadata->orderId)->first();
$this->client = Client::find($_invoice->client_id);
$_invoice = Invoice::with('client')->withTrashed()->find($this->payment_hash->fee_invoice_id);
$this->client = $_invoice->client;
$dataPayment = [
'payment_method' => $this->payment_method,
'payment_type' => PaymentType::CRYPTO,
@ -144,7 +146,7 @@ class BTCPayPaymentDriver extends BaseDriver
$payment = $this->createPayment($dataPayment, $StatusId);
} else {
/** @var \App\Models\Payment $payment */
$payment = Payment::find($this->payment_hash->payment_id);
$payment = Payment::withTrashed()->find($this->payment_hash->payment_id);
$StatusId = $payment->status_id;
}
switch ($btcpayRep->type) {

View File

@ -127,8 +127,6 @@ class UpdateInvoicePayment
return;
}
if (strlen($invoice->number) > 1 && str_starts_with($invoice->number, "####")) {
$invoice->number = '';
}
@ -140,7 +138,6 @@ class UpdateInvoicePayment
->save();
}
/* Updates the company ledger */
$this->payment
->ledger()

12
composer.lock generated
View File

@ -14820,16 +14820,16 @@
},
{
"name": "turbo124/beacon",
"version": "v2.0.1",
"version": "v2.0.2",
"source": {
"type": "git",
"url": "https://github.com/turbo124/beacon.git",
"reference": "cc0b6754a1a4ee36a531fe3364d8e5d2b7d5cc7a"
"reference": "95f3de3bdcbb786329cd7050f319520588920466"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/turbo124/beacon/zipball/cc0b6754a1a4ee36a531fe3364d8e5d2b7d5cc7a",
"reference": "cc0b6754a1a4ee36a531fe3364d8e5d2b7d5cc7a",
"url": "https://api.github.com/repos/turbo124/beacon/zipball/95f3de3bdcbb786329cd7050f319520588920466",
"reference": "95f3de3bdcbb786329cd7050f319520588920466",
"shasum": ""
},
"require": {
@ -14876,9 +14876,9 @@
"turbo124"
],
"support": {
"source": "https://github.com/turbo124/beacon/tree/v2.0.1"
"source": "https://github.com/turbo124/beacon/tree/v2.0.2"
},
"time": "2024-06-27T01:19:25+00:00"
"time": "2024-06-27T01:23:05+00:00"
},
{
"name": "twig/intl-extra",