Minor fixes for checking payment values

This commit is contained in:
David Bomba 2022-01-26 17:30:43 +11:00
parent dedc689e58
commit 0b2a8eac1a
3 changed files with 4 additions and 5 deletions

View File

@ -92,9 +92,7 @@ class PaymentController extends Controller
{
$gateway = CompanyGateway::findOrFail($request->input('company_gateway_id'));
$payment_hash = PaymentHash::whereRaw('BINARY `hash`= ?', [$request->payment_hash])->first();
$payment_hash = PaymentHash::where('hash', $request->payment_hash)->first();
$invoice = Invoice::with('client')->find($payment_hash->fee_invoice_id);
$client = $invoice->client->exists() ? $invoice->client : auth()->user()->client;

View File

@ -74,6 +74,7 @@ class PaymentAppliedValidAmount implements Rule
}
}
return $payment_amounts >= $invoice_amounts;
// nlog("{round($payment_amounts,3)} >= {round($invoice_amounts,3)}");
return round($payment_amounts,3) >= round($invoice_amounts,3);
}
}

View File

@ -28,7 +28,7 @@ Route::get('error', 'ClientPortal\ContactHashLoginController@errorPage')->name('
Route::get('client/payment/{contact_key}/{payment_id}', 'ClientPortal\InvitationController@paymentRouter')->middleware(['domain_db','contact_key_login']);
Route::get('client/ninja/{contact_key}/{company_key}', 'ClientPortal\NinjaPlanController@index')->name('client.ninja_contact_login')->middleware(['domain_db']);
Route::group(['middleware' => ['auth:contact', 'locale', 'check_client_existence','domain_db'], 'prefix' => 'client', 'as' => 'client.'], function () {
Route::group(['middleware' => ['auth:contact', 'locale', 'domain_db'], 'prefix' => 'client', 'as' => 'client.'], function () {
Route::get('dashboard', 'ClientPortal\DashboardController@index')->name('dashboard'); // name = (dashboard. index / create / show / update / destroy / edit
Route::get('plan', 'ClientPortal\NinjaPlanController@plan')->name('plan'); // name = (dashboard. index / create / show / update / destroy / edit