From 3b4afd4537d773bcdd81a21f9284da5cb20f6973 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 7 Nov 2021 17:12:51 +1100 Subject: [PATCH] Minor fixes for check data --- app/Console/Commands/CheckData.php | 4 ++-- app/PaymentDrivers/BaseDriver.php | 1 - app/Services/Payment/PaymentService.php | 2 +- routes/api.php | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 97b442b5b207..4189e0d8ca60 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -447,8 +447,8 @@ class CheckData extends Command payments.id = paymentables.payment_id WHERE paymentable_type = 'App\\Models\\Credit' AND paymentables.deleted_at is NULL - AND payments.client_id = 85; - ") ); + AND payments.client_id = ?; + "), [$client->id] ); return $results; } diff --git a/app/PaymentDrivers/BaseDriver.php b/app/PaymentDrivers/BaseDriver.php index 504679626341..cfdd0151acfd 100644 --- a/app/PaymentDrivers/BaseDriver.php +++ b/app/PaymentDrivers/BaseDriver.php @@ -233,7 +233,6 @@ class BaseDriver extends AbstractPaymentDriver } - $payment = PaymentFactory::create($this->client->company->id, $this->client->user->id); $payment->client_id = $this->client->id; $payment->company_gateway_id = $this->company_gateway->id; diff --git a/app/Services/Payment/PaymentService.php b/app/Services/Payment/PaymentService.php index 39df23ef77ff..2412a4838907 100644 --- a/app/Services/Payment/PaymentService.php +++ b/app/Services/Payment/PaymentService.php @@ -112,7 +112,7 @@ class PaymentService /* Iterate through the invoices and apply credits to them */ collect($payment_hash->invoices())->each(function ($payable_invoice) use ($payment_hash) { - $invoice = Invoice::find($this->decodePrimaryKey($payable_invoice->invoice_id)); + $invoice = Invoice::withTrashed()->find($this->decodePrimaryKey($payable_invoice->invoice_id)); $amount = $payable_invoice->amount; diff --git a/routes/api.php b/routes/api.php index 78fa89b232cd..0e2f9d4760cf 100644 --- a/routes/api.php +++ b/routes/api.php @@ -216,7 +216,7 @@ Route::match(['get', 'post'], 'payment_notification_webhook/{company_key}/{compa ->middleware(['guest']) ->name('payment_notification_webhook'); -Route::post('api/v1/postmark_webhook', 'PostMarkController@webhook')->middleware(['throttle:5000,1']); +Route::post('api/v1/postmark_webhook', 'PostMarkController@webhook')->middleware(['throttle:10000,1']); Route::get('token_hash_router', 'OneTimeTokenController@router'); Route::get('webcron', 'WebCronController@index'); Route::post('api/v1/get_migration_account', 'HostedMigrationController@getAccount')->middleware('guest');