1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02: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'); info('finished migrating');
$output = [];
// exec('vendor/bin/composer install --no-dev -o', $output);
info(print_r($output, 1));
info('finished running composer install ');
try { try {
// Artisan::call('optimize'); // Artisan::call('optimize');
Artisan::call('config:clear'); 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(); $this->payment_hash = PaymentHash::whereRaw('BINARY `hash`= ?', [$btcpayRep->metadata->InvoiceNinjaPaymentHash])->firstOrFail();
$StatusId = Payment::STATUS_PENDING; $StatusId = Payment::STATUS_PENDING;
if ($this->payment_hash->payment_id == null) { if ($this->payment_hash->payment_id == null) {
//$_invoice = collect($this->payment_hash->data->invoices)->first();
$_invoice = Invoice::query()->where('number', $btcpayRep->metadata->orderId)->first(); $_invoice = Invoice::with('client')->withTrashed()->find($this->payment_hash->fee_invoice_id);
$this->client = Client::find($_invoice->client_id);
$this->client = $_invoice->client;
$dataPayment = [ $dataPayment = [
'payment_method' => $this->payment_method, 'payment_method' => $this->payment_method,
'payment_type' => PaymentType::CRYPTO, 'payment_type' => PaymentType::CRYPTO,
@ -144,7 +146,7 @@ class BTCPayPaymentDriver extends BaseDriver
$payment = $this->createPayment($dataPayment, $StatusId); $payment = $this->createPayment($dataPayment, $StatusId);
} else { } else {
/** @var \App\Models\Payment $payment */ /** @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; $StatusId = $payment->status_id;
} }
switch ($btcpayRep->type) { switch ($btcpayRep->type) {

View File

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

12
composer.lock generated
View File

@ -14820,16 +14820,16 @@
}, },
{ {
"name": "turbo124/beacon", "name": "turbo124/beacon",
"version": "v2.0.1", "version": "v2.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/turbo124/beacon.git", "url": "https://github.com/turbo124/beacon.git",
"reference": "cc0b6754a1a4ee36a531fe3364d8e5d2b7d5cc7a" "reference": "95f3de3bdcbb786329cd7050f319520588920466"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/turbo124/beacon/zipball/cc0b6754a1a4ee36a531fe3364d8e5d2b7d5cc7a", "url": "https://api.github.com/repos/turbo124/beacon/zipball/95f3de3bdcbb786329cd7050f319520588920466",
"reference": "cc0b6754a1a4ee36a531fe3364d8e5d2b7d5cc7a", "reference": "95f3de3bdcbb786329cd7050f319520588920466",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -14876,9 +14876,9 @@
"turbo124" "turbo124"
], ],
"support": { "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", "name": "twig/intl-extra",