From b0816231d6c0f2d93b275ef53fe3611bc6f20d8e Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 08:18:26 -0400 Subject: [PATCH 01/26] feat: integrate North Embedded Checkout for bidder payments --- .env.example | 4 + .../Controllers/NorthCheckoutController.php | 153 ++++++++++++++++++ app/Http/Controllers/PagesController.php | 5 +- config/services.php | 6 + resources/views/mywinnings_results.blade.php | 28 ++++ resources/views/north_checkout.blade.php | 74 +++++++++ routes/web.php | 5 + 7 files changed, 274 insertions(+), 1 deletion(-) create mode 100644 app/Http/Controllers/NorthCheckoutController.php create mode 100644 resources/views/north_checkout.blade.php diff --git a/.env.example b/.env.example index 8222755..07e08d4 100644 --- a/.env.example +++ b/.env.example @@ -39,3 +39,7 @@ OIDC_CLIENT_ID= OIDC_CLIENT_SECRET= OIDC_REDIRECT_URI="${APP_URL}/auth/social/oidc/callback" +NORTH_CHECKOUT_ID= +NORTH_PROFILE_ID= +NORTH_PRIVATE_API_KEY= + diff --git a/app/Http/Controllers/NorthCheckoutController.php b/app/Http/Controllers/NorthCheckoutController.php new file mode 100644 index 0000000..941d72d --- /dev/null +++ b/app/Http/Controllers/NorthCheckoutController.php @@ -0,0 +1,153 @@ +firstOrFail(); + + // Check if already checked out + if (Checkout::where('bidder_num', $bidder->idbidders)->exists()) { + return redirect('/mywinnings?bidder_number=' . $bidder->bidder_assigned_number)->with('error', 'Bidder has already checked out.'); + } + + $winnings = WinningBids::where('winning_bidder_num', $bidder->idbidders)->get(); + $total_cost = $winnings->sum('winning_cost'); + + if ($total_cost <= 0) { + return redirect('/mywinnings?bidder_number=' . $bidder->bidder_assigned_number)->with('error', 'No winnings found for this bidder.'); + } + + return view('north_checkout', [ + 'bidder' => $bidder, + 'total_cost' => $total_cost, + ]); + } + + public function createSession(Request $request, $bidder_id) + { + $bidder = Bidders::findOrFail($bidder_id); + $winnings = WinningBids::where('winning_bidder_num', $bidder->idbidders)->get(); + $total_cost = $winnings->sum('winning_cost'); + + $apiKey = config('services.north.private_api_key'); + $checkoutId = config('services.north.checkout_id'); + $profileId = config('services.north.profile_id'); + + if (!$apiKey || !$checkoutId || !$profileId) { + return response()->json(['error' => 'North configuration missing.'], 500); + } + + $response = Http::withHeaders([ + 'Authorization' => 'Bearer ' . $apiKey, + ])->post('https://checkout.north.com/api/sessions', [ + 'checkoutId' => $checkoutId, + 'profileId' => $profileId, + 'amount' => $total_cost, + ]); + + if ($response->failed()) { + Log::error('North Session Creation Failed: ' . $response->body()); + return response()->json(['error' => 'Failed to create checkout session.'], 500); + } + + return response()->json($response->json()); + } + + public function verify(Request $request, $bidder_id) + { + $bidder = Bidders::findOrFail($bidder_id); + $sessionToken = $request->query('sessionToken'); + if (!$sessionToken) { + return redirect('/mywinnings?bidder_number=' . $bidder->bidder_assigned_number)->with('error', 'Missing session token.'); + } + + $apiKey = config('services.north.private_api_key'); + $response = Http::withHeaders([ + 'Authorization' => 'Bearer ' . $apiKey, + ])->get('https://checkout.north.com/api/sessions/status', [ + 'sessionToken' => $sessionToken, + ]); + + if ($response->failed()) { + Log::error('North Session Verification Failed: ' . $response->body()); + return redirect('/mywinnings?bidder_number=' . $bidder->bidder_assigned_number)->with('error', 'Failed to verify payment status.'); + } + + $status = $response->json(); + + // The North API status check might return success/completed. + // Based on docs, we should check status. + if (isset($status['status']) && ($status['status'] === 'completed' || $status['status'] === 'success')) { + // Check if already checked out to avoid duplicates + $existingCheckout = Checkout::where('bidder_num', $bidder->idbidders)->first(); + + if (!$existingCheckout) { + $winnertotal = $status['amount'] ?? WinningBids::where('winning_bidder_num', $bidder->idbidders)->sum('winning_cost'); + $payment_method = 3; // Credit Card + $cc_transaction = $status['transactionId'] ?? 'NORTH_EC'; + $cc_amount = $status['amount'] ?? $winnertotal; + $check_number = null; + + $checkout_id = DB::table('checkout')->insertGetID( + [ + 'bidder_num' => $bidder->idbidders, + 'winnertotal' => $winnertotal, + 'payment_method' => $payment_method, + 'check_number' => $check_number, + 'cc_transaction' => $cc_transaction, + 'cc_amount' => $cc_amount, + 'created_at' => now(), + 'updated_at' => now(), + ] + ); + } else { + $checkout_id = $existingCheckout->checkout_id; + $payment_method = $existingCheckout->payment_method; + $cc_transaction = $existingCheckout->cc_transaction; + $check_number = $existingCheckout->check_number; + } + + // Replicate the data for checkout_complete view + $checkout_list_results = DB::select("SELECT + *, items.item_assigned_num, items.item_desc + FROM winning_bids + INNER JOIN items AS items + ON winning_bids.winning_item_num=items.iditems + WHERE winning_bidder_num = $bidder->idbidders + "); + + $checkout_info_results = DB::select("SELECT + winning_bids.*, + bidders.*, + sum(winning_cost) AS total_cost + FROM winning_bids + INNER JOIN bidders AS bidders + ON winning_bids.winning_bidder_num=bidders.idbidders + WHERE winning_bidder_num = $bidder->idbidders + GROUP BY winning_bids.winning_bidder_num + "); + + return view('checkout_complete', [ + 'checkout_result' => $checkout_id, + 'checkout_list_results' => $checkout_list_results, + 'checkout_info_results' => $checkout_info_results, + 'payment_method' => $payment_method, + 'check_number' => $check_number, + 'cc_transaction' => $cc_transaction + ]); + } + + return redirect('/mywinnings?bidder_number=' . $bidder->bidder_assigned_number)->with('error', 'Payment not completed. Status: ' . ($status['status'] ?? 'unknown')); + } +} diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index 5078e37..2838c2d 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -535,10 +535,13 @@ class PagesController extends Controller $total_cost = $winnings->sum('winning_cost'); + $is_checked_out = \App\Models\Checkout::where('bidder_num', $bidder->idbidders)->exists(); + return view('mywinnings_results', [ 'bidder' => $bidder, 'winnings' => $winnings, - 'total_cost' => $total_cost + 'total_cost' => $total_cost, + 'is_checked_out' => $is_checked_out ]); } } diff --git a/config/services.php b/config/services.php index 0b3b30c..230389e 100644 --- a/config/services.php +++ b/config/services.php @@ -42,4 +42,10 @@ return [ 'redirect' => env('OIDC_REDIRECT_URI'), ], + 'north' => [ + 'checkout_id' => env('NORTH_CHECKOUT_ID'), + 'profile_id' => env('NORTH_PROFILE_ID'), + 'private_api_key' => env('NORTH_PRIVATE_API_KEY'), + ], + ]; diff --git a/resources/views/mywinnings_results.blade.php b/resources/views/mywinnings_results.blade.php index 5ad93e3..1bea837 100644 --- a/resources/views/mywinnings_results.blade.php +++ b/resources/views/mywinnings_results.blade.php @@ -8,6 +8,24 @@
Winnings for Bidder #{{ $bidder->bidder_assigned_number }} - {{ $bidder->bidder_fname }} {{ $bidder->bidder_lname }}
+ @if (isset($error)) +
+ {{ $error }} +
+ @endif + + @if (session('error')) +
+ {{ session('error') }} +
+ @endif + + @if (session('success')) +
+ {{ session('success') }} +
+ @endif + @if($winnings->count() > 0) @@ -33,6 +51,16 @@
+ + @if(!$is_checked_out) + + @else +
+ Checked Out! Your payment has been processed. +
+ @endif @else

No winning bids found for this bidder number.

@endif diff --git a/resources/views/north_checkout.blade.php b/resources/views/north_checkout.blade.php new file mode 100644 index 0000000..a0478e0 --- /dev/null +++ b/resources/views/north_checkout.blade.php @@ -0,0 +1,74 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+
Checkout for Bidder #{{ $bidder->bidder_assigned_number }}
+ +
+

Total Amount Due: ${{ number_format($total_cost, 2) }}

+
+ +
+
+

Loading secure checkout...

+
+ Loading... +
+
+
+ +
+ +
+
+
+
+
+ + + +@endsection diff --git a/routes/web.php b/routes/web.php index ee3faf9..2355d21 100644 --- a/routes/web.php +++ b/routes/web.php @@ -27,6 +27,11 @@ Route::get('showscoresbycar', [ 'uses' => 'PagesController@showscoresbycar']); Route::get('mywinnings', [ 'uses' => 'PagesController@myWinnings']); Route::post('mywinnings', [ 'uses' => 'PagesController@myWinnings']); +// North Embedded Checkout +Route::get('north/checkout/{bidder_id}', [ 'uses' => 'NorthCheckoutController@checkout' ])->name('north.checkout'); +Route::post('north/session/{bidder_id}', [ 'uses' => 'NorthCheckoutController@createSession' ])->name('north.session'); +Route::get('north/verify/{bidder_id}', [ 'uses' => 'NorthCheckoutController@verify' ])->name('north.verify'); + Route::group(['middleware' => 'auth'], function() { Route::get('bidders', [ 'uses' => 'PagesController@bidders']); Route::post('bidders', [ 'uses' => 'PagesController@bidders']); From d2d53e961b24672ffdef7d199897b2d6d880a73d Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 08:32:31 -0400 Subject: [PATCH 02/26] fix: resolve invalid session token by correctly extracting token from North API response --- app/Http/Controllers/NorthCheckoutController.php | 16 ++++++++++++---- resources/views/north_checkout.blade.php | 6 ++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/NorthCheckoutController.php b/app/Http/Controllers/NorthCheckoutController.php index 941d72d..c84556a 100644 --- a/app/Http/Controllers/NorthCheckoutController.php +++ b/app/Http/Controllers/NorthCheckoutController.php @@ -53,15 +53,23 @@ class NorthCheckoutController extends Controller ])->post('https://checkout.north.com/api/sessions', [ 'checkoutId' => $checkoutId, 'profileId' => $profileId, - 'amount' => $total_cost, + 'amount' => (float)$total_cost, ]); if ($response->failed()) { - Log::error('North Session Creation Failed: ' . $response->body()); - return response()->json(['error' => 'Failed to create checkout session.'], 500); + Log::error('North Session Creation Failed: ' . $response->status() . ' ' . $response->body()); + return response()->json(['error' => 'Failed to create checkout session: ' . ($response->json('message') ?? 'Unknown error')], 500); } - return response()->json($response->json()); + $data = $response->json(); + $token = $data['token'] ?? $data['sessionToken'] ?? null; + + if (!$token) { + Log::error('North Session Token Missing in Response: ' . json_encode($data)); + return response()->json(['error' => 'Session token not found in API response.'], 500); + } + + return response()->json(['sessionToken' => $token]); } public function verify(Request $request, $bidder_id) diff --git a/resources/views/north_checkout.blade.php b/resources/views/north_checkout.blade.php index a0478e0..0084baa 100644 --- a/resources/views/north_checkout.blade.php +++ b/resources/views/north_checkout.blade.php @@ -47,6 +47,7 @@ }); const data = await response.json(); + console.log('North Session Response:', data); if (data.error) { document.getElementById('checkout-container').innerHTML = `
${data.error}
`; @@ -54,9 +55,14 @@ } const sessionToken = data.sessionToken; + if (!sessionToken) { + document.getElementById('checkout-container').innerHTML = `
Invalid session token received from server.
`; + return; + } // Initialize North Checkout // The global 'checkout' object is provided by checkout.js + console.log('Mounting checkout with token:', sessionToken); await checkout.mount(sessionToken, 'checkout-container'); // Handle completion From 06de3c01450c7a62ad36a3a8e1fc606f3d8a45cc Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 08:35:41 -0400 Subject: [PATCH 03/26] fix: broaden session token extraction to handle various North API response formats --- app/Http/Controllers/NorthCheckoutController.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/NorthCheckoutController.php b/app/Http/Controllers/NorthCheckoutController.php index c84556a..18a6b1c 100644 --- a/app/Http/Controllers/NorthCheckoutController.php +++ b/app/Http/Controllers/NorthCheckoutController.php @@ -62,11 +62,18 @@ class NorthCheckoutController extends Controller } $data = $response->json(); - $token = $data['token'] ?? $data['sessionToken'] ?? null; + $token = $data['token'] ?? + $data['sessionToken'] ?? + $data['id'] ?? + $data['session_id'] ?? + ($data['session']['id'] ?? null); if (!$token) { Log::error('North Session Token Missing in Response: ' . json_encode($data)); - return response()->json(['error' => 'Session token not found in API response.'], 500); + return response()->json([ + 'error' => 'Session token not found in API response.', + 'debug_response' => $data + ], 500); } return response()->json(['sessionToken' => $token]); From 9587c4465712796abc28805a9285bf06aaafd9d2 Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 08:38:47 -0400 Subject: [PATCH 04/26] fix: improve API request headers and error reporting for session creation and verification --- .../Controllers/NorthCheckoutController.php | 36 +++++++++++++++---- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/NorthCheckoutController.php b/app/Http/Controllers/NorthCheckoutController.php index 18a6b1c..c2fb1dc 100644 --- a/app/Http/Controllers/NorthCheckoutController.php +++ b/app/Http/Controllers/NorthCheckoutController.php @@ -50,6 +50,8 @@ class NorthCheckoutController extends Controller $response = Http::withHeaders([ 'Authorization' => 'Bearer ' . $apiKey, + 'Accept' => 'application/json', + 'Content-Type' => 'application/json', ])->post('https://checkout.north.com/api/sessions', [ 'checkoutId' => $checkoutId, 'profileId' => $profileId, @@ -58,10 +60,24 @@ class NorthCheckoutController extends Controller if ($response->failed()) { Log::error('North Session Creation Failed: ' . $response->status() . ' ' . $response->body()); - return response()->json(['error' => 'Failed to create checkout session: ' . ($response->json('message') ?? 'Unknown error')], 500); + return response()->json([ + 'error' => 'Failed to create checkout session: ' . ($response->json('message') ?? 'Unknown error'), + 'status' => $response->status(), + 'body' => $response->body() + ], 500); } $data = $response->json(); + + // If json() is null but body is not empty, it might be a parsing error + if (is_null($data) && !empty($response->body())) { + Log::error('North Session Response is not JSON: ' . $response->body()); + return response()->json([ + 'error' => 'Response from North is not valid JSON.', + 'raw_body' => $response->body() + ], 500); + } + $token = $data['token'] ?? $data['sessionToken'] ?? $data['id'] ?? @@ -72,7 +88,8 @@ class NorthCheckoutController extends Controller Log::error('North Session Token Missing in Response: ' . json_encode($data)); return response()->json([ 'error' => 'Session token not found in API response.', - 'debug_response' => $data + 'debug_response' => $data, + 'raw_body' => $response->body() ], 500); } @@ -88,15 +105,20 @@ class NorthCheckoutController extends Controller } $apiKey = config('services.north.private_api_key'); + $checkoutId = config('services.north.checkout_id'); + $profileId = config('services.north.profile_id'); + $response = Http::withHeaders([ 'Authorization' => 'Bearer ' . $apiKey, - ])->get('https://checkout.north.com/api/sessions/status', [ - 'sessionToken' => $sessionToken, - ]); + 'SessionToken' => $sessionToken, + 'CheckoutId' => $checkoutId, + 'ProfileId' => $profileId, + 'Accept' => 'application/json', + ])->get('https://checkout.north.com/api/sessions/status'); if ($response->failed()) { - Log::error('North Session Verification Failed: ' . $response->body()); - return redirect('/mywinnings?bidder_number=' . $bidder->bidder_assigned_number)->with('error', 'Failed to verify payment status.'); + Log::error('North Session Verification Failed: ' . $response->status() . ' ' . $response->body()); + return redirect('/mywinnings?bidder_number=' . $bidder->bidder_assigned_number)->with('error', 'Failed to verify payment status. Status: ' . $response->status()); } $status = $response->json(); From 68f75ac2fc9f5607828749765e545e0f56ba731e Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 08:41:58 -0400 Subject: [PATCH 05/26] feat: include products in checkout and increase form container size --- app/Http/Controllers/NorthCheckoutController.php | 11 ++++++++++- resources/views/north_checkout.blade.php | 13 +++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/NorthCheckoutController.php b/app/Http/Controllers/NorthCheckoutController.php index c2fb1dc..23446b7 100644 --- a/app/Http/Controllers/NorthCheckoutController.php +++ b/app/Http/Controllers/NorthCheckoutController.php @@ -37,9 +37,17 @@ class NorthCheckoutController extends Controller public function createSession(Request $request, $bidder_id) { $bidder = Bidders::findOrFail($bidder_id); - $winnings = WinningBids::where('winning_bidder_num', $bidder->idbidders)->get(); + $winnings = WinningBids::with('items')->where('winning_bidder_num', $bidder->idbidders)->get(); $total_cost = $winnings->sum('winning_cost'); + $products = $winnings->map(function($winning) { + return [ + 'name' => $winning->items->item_desc ?? 'Auction Item', + 'price' => (float)$winning->winning_cost, + 'quantity' => 1 + ]; + })->toArray(); + $apiKey = config('services.north.private_api_key'); $checkoutId = config('services.north.checkout_id'); $profileId = config('services.north.profile_id'); @@ -56,6 +64,7 @@ class NorthCheckoutController extends Controller 'checkoutId' => $checkoutId, 'profileId' => $profileId, 'amount' => (float)$total_cost, + 'products' => $products, ]); if ($response->failed()) { diff --git a/resources/views/north_checkout.blade.php b/resources/views/north_checkout.blade.php index 0084baa..9d83388 100644 --- a/resources/views/north_checkout.blade.php +++ b/resources/views/north_checkout.blade.php @@ -1,6 +1,19 @@ @extends('layouts.app') @section('content') +
From 50826c8c2054cc79086765b01268ea2e91b94e32 Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 08:43:26 -0400 Subject: [PATCH 06/26] update div height --- resources/views/north_checkout.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/north_checkout.blade.php b/resources/views/north_checkout.blade.php index 9d83388..080ef32 100644 --- a/resources/views/north_checkout.blade.php +++ b/resources/views/north_checkout.blade.php @@ -3,7 +3,7 @@ @section('content')
From fbb10a01d49c5412cf8a5583d07411411955343c Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 08:46:46 -0400 Subject: [PATCH 08/26] ui: switch from min-height to explicit height for checkout container --- resources/views/north_checkout.blade.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/resources/views/north_checkout.blade.php b/resources/views/north_checkout.blade.php index 2e5a329..531bf57 100644 --- a/resources/views/north_checkout.blade.php +++ b/resources/views/north_checkout.blade.php @@ -3,15 +3,17 @@ @section('content')
From 3953a6f4c8e9bb3920c81a23bd3456a236dd00ba Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 08:55:06 -0400 Subject: [PATCH 09/26] fix height --- resources/views/north_checkout.blade.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/resources/views/north_checkout.blade.php b/resources/views/north_checkout.blade.php index 531bf57..9c3b2d8 100644 --- a/resources/views/north_checkout.blade.php +++ b/resources/views/north_checkout.blade.php @@ -1,21 +1,6 @@ @extends('layouts.app') @section('content') -
@@ -26,7 +11,7 @@

Total Amount Due: ${{ number_format($total_cost, 2) }}


-
+

Loading secure checkout...

From 982efbf2bdf9a28c82277c646173009adb3e3de3 Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 08:59:09 -0400 Subject: [PATCH 10/26] fix: handle 'Approved' status and extract nested transaction ID from North API response --- app/Http/Controllers/NorthCheckoutController.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/NorthCheckoutController.php b/app/Http/Controllers/NorthCheckoutController.php index 23446b7..2a978e3 100644 --- a/app/Http/Controllers/NorthCheckoutController.php +++ b/app/Http/Controllers/NorthCheckoutController.php @@ -131,18 +131,22 @@ class NorthCheckoutController extends Controller } $status = $response->json(); + $currentStatus = $status['status'] ?? ''; - // The North API status check might return success/completed. - // Based on docs, we should check status. - if (isset($status['status']) && ($status['status'] === 'completed' || $status['status'] === 'success')) { + // The North API status check might return Approved, completed, or success. + $successStatuses = ['approved', 'completed', 'success']; + + if (in_array(strtolower($currentStatus), $successStatuses)) { // Check if already checked out to avoid duplicates $existingCheckout = Checkout::where('bidder_num', $bidder->idbidders)->first(); if (!$existingCheckout) { - $winnertotal = $status['amount'] ?? WinningBids::where('winning_bidder_num', $bidder->idbidders)->sum('winning_cost'); + // According to docs, when status is Approved, transaction details are in 'body' + $body = $status['body'] ?? []; + $winnertotal = $status['amount'] ?? ($body['amount'] ?? WinningBids::where('winning_bidder_num', $bidder->idbidders)->sum('winning_cost')); $payment_method = 3; // Credit Card - $cc_transaction = $status['transactionId'] ?? 'NORTH_EC'; - $cc_amount = $status['amount'] ?? $winnertotal; + $cc_transaction = $body['auth_guid'] ?? ($status['transactionId'] ?? 'NORTH_EC'); + $cc_amount = $winnertotal; $check_number = null; $checkout_id = DB::table('checkout')->insertGetID( From aca21ae115b84fed1174d0220397e11430c5379b Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 09:01:28 -0400 Subject: [PATCH 11/26] fix display --- resources/views/north_checkout.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/north_checkout.blade.php b/resources/views/north_checkout.blade.php index 9c3b2d8..3e28a64 100644 --- a/resources/views/north_checkout.blade.php +++ b/resources/views/north_checkout.blade.php @@ -3,7 +3,7 @@ @section('content')
-
+
Checkout for Bidder #{{ $bidder->bidder_assigned_number }}
From 290498c7283373cdb942e101dbdffa34b23a5d18 Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 09:27:36 -0400 Subject: [PATCH 12/26] fix: improve Google Pay handling with additional status checks, robust data extraction, and a fallback verification button --- .../Controllers/NorthCheckoutController.php | 17 +++++++-- resources/views/north_checkout.blade.php | 38 +++++++++++++++++-- 2 files changed, 48 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/NorthCheckoutController.php b/app/Http/Controllers/NorthCheckoutController.php index 2a978e3..71e83a1 100644 --- a/app/Http/Controllers/NorthCheckoutController.php +++ b/app/Http/Controllers/NorthCheckoutController.php @@ -133,8 +133,8 @@ class NorthCheckoutController extends Controller $status = $response->json(); $currentStatus = $status['status'] ?? ''; - // The North API status check might return Approved, completed, or success. - $successStatuses = ['approved', 'completed', 'success']; + // The North API status check might return Approved, completed, success, authorized, or captured. + $successStatuses = ['approved', 'completed', 'success', 'authorized', 'captured']; if (in_array(strtolower($currentStatus), $successStatuses)) { // Check if already checked out to avoid duplicates @@ -142,10 +142,19 @@ class NorthCheckoutController extends Controller if (!$existingCheckout) { // According to docs, when status is Approved, transaction details are in 'body' + // Digital wallets might have these at the top level $body = $status['body'] ?? []; - $winnertotal = $status['amount'] ?? ($body['amount'] ?? WinningBids::where('winning_bidder_num', $bidder->idbidders)->sum('winning_cost')); + $winnertotal = $status['amount'] ?? + ($body['amount'] ?? + ($status['amount_total'] ?? + WinningBids::where('winning_bidder_num', $bidder->idbidders)->sum('winning_cost'))); + $payment_method = 3; // Credit Card - $cc_transaction = $body['auth_guid'] ?? ($status['transactionId'] ?? 'NORTH_EC'); + $cc_transaction = $body['auth_guid'] ?? + ($status['transaction_id'] ?? + ($status['transactionId'] ?? + ($status['id'] ?? 'NORTH_EC'))); + $cc_amount = $winnertotal; $check_number = null; diff --git a/resources/views/north_checkout.blade.php b/resources/views/north_checkout.blade.php index 3e28a64..6a520d9 100644 --- a/resources/views/north_checkout.blade.php +++ b/resources/views/north_checkout.blade.php @@ -65,11 +65,43 @@ console.log('Mounting checkout with token:', sessionToken); await checkout.mount(sessionToken, 'checkout-container'); - // Handle completion - checkout.onPaymentComplete((result) => { + const handleCompletion = (result) => { + console.log('Payment complete event received:', result); // Redirect to verify the payment on the server window.location.href = `/north/verify/${bidderId}?sessionToken=${sessionToken}`; - }); + }; + + // Handle completion + checkout.onPaymentComplete(handleCompletion); + + // Support for possible variations in event names + if (typeof checkout.onPaymentSuccess === 'function') { + checkout.onPaymentSuccess(handleCompletion); + } + + // Handle errors + if (typeof checkout.onPaymentError === 'function') { + checkout.onPaymentError((error) => { + console.error('Payment Error:', error); + // Don't clear the container, just prepend the error + const errorDiv = document.createElement('div'); + errorDiv.className = 'alert alert-danger'; + errorDiv.innerHTML = `Payment Error: ${error.message || 'An error occurred during payment.'}`; + document.querySelector('.panel-body').prepend(errorDiv); + }); + } + + // Show a fallback button after a short delay to allow for manual verification if the redirect fails + setTimeout(() => { + const fallbackDiv = document.createElement('div'); + fallbackDiv.className = 'text-center'; + fallbackDiv.style.marginTop = '20px'; + fallbackDiv.innerHTML = ` +

Already completed your payment but still on this page?

+ Verify Payment Status + `; + document.querySelector('.panel-body').appendChild(fallbackDiv); + }, 5000); } catch (error) { console.error('Checkout Error:', error); From a3fd2785369e13520b68609e34ea9382538f1f4a Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 09:32:26 -0400 Subject: [PATCH 13/26] fix: resolve receipt 404 and add save receipt pdf functionality --- app/Http/Controllers/PagesController.php | 33 +++++++++++++++++++++ resources/views/checkout_complete.blade.php | 9 ++++-- routes/web.php | 1 + 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index 2838c2d..145b073 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -250,6 +250,39 @@ class PagesController extends Controller return view('receiptpdf', $checkout_data); } + public function downloadReceiptPdf(Request $request) + { + $checkoutid = $request->checkout_id; + $checkout_final_results = Checkout::where('checkout_id', '=', $checkoutid) + ->first(); + $bidder_num = $checkout_final_results->bidder_num; + $checkout_list_results = DB::select("SELECT + *, items.item_assigned_num, items.item_desc + FROM winning_bids + INNER JOIN items AS items + ON winning_bids.winning_item_num=items.iditems + WHERE winning_bidder_num = $bidder_num + "); + $checkout_info_results = DB::select("SELECT + winning_bids.*, + bidders.*, + sum(winning_cost) AS total_cost + FROM winning_bids + INNER JOIN bidders AS bidders + ON winning_bids.winning_bidder_num=bidders.idbidders + WHERE winning_bidder_num = $bidder_num + GROUP BY winning_bids.winning_bidder_num + "); + $checkout_data = [ + 'checkout_final_results' => $checkout_final_results, + 'checkout_list_results' => $checkout_list_results, + 'checkout_info_results' => $checkout_info_results + ]; + + $pdf = PDF::loadView('receiptpdf', $checkout_data); + return $pdf->download('receipt-'.$checkoutid.'.pdf'); + } + public function reprintReceipt(Request $reprint_receipt_req) { if (!$reprint_receipt_req->reprintbiddernum) { diff --git a/resources/views/checkout_complete.blade.php b/resources/views/checkout_complete.blade.php index 6acf915..2c003d2 100644 --- a/resources/views/checkout_complete.blade.php +++ b/resources/views/checkout_complete.blade.php @@ -24,11 +24,14 @@ -

- +

+ + Save Receipt PDF + +
diff --git a/routes/web.php b/routes/web.php index 2355d21..150faac 100644 --- a/routes/web.php +++ b/routes/web.php @@ -50,6 +50,7 @@ Route::group(['middleware' => 'auth'], function() { Route::get('reprint_receipt', ['uses' => 'PagesController@reprintReceipt']); Route::post('reprint_receipt', ['uses' => 'PagesController@reprintReceipt']); Route::get('receiptpdf', ['uses' => 'PagesController@receiptpdf'])->name('receiptpdf'); +Route::get('download_receipt', ['uses' => 'PagesController@downloadReceiptPdf'])->name('download_receipt'); Route::get('winners', [ 'uses' => 'PagesController@winners']); Route::post('winners', [ 'uses' => 'PagesController@winners']); Route::get('winnerlist', [ 'uses' => 'PagesController@winnerlist']); From 999c1dfc5867d3ad57f25521ad1da239a8457252 Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 09:34:56 -0400 Subject: [PATCH 14/26] fix: switch to correct PDF facade for mPDF and resolve receipt 500 error --- app/Http/Controllers/PagesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index 145b073..ca7212d 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -6,7 +6,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use View; use App\helpers; -use PDF; +use Mccarlosen\LaravelMpdf\Facades\LaravelMpdf as PDF; use App\Models\Bidders; use App\Models\Items; use App\Models\Checkout; From 98be7131f4d0b46e74b5b9cfa0eb9053bc630bea Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 09:36:43 -0400 Subject: [PATCH 15/26] update views --- resources/views/checkout_complete.blade.php | 6 +++--- resources/views/receiptpdf.blade.php | 6 +++--- resources/views/receiptpdf2.blade.php | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/resources/views/checkout_complete.blade.php b/resources/views/checkout_complete.blade.php index 2c003d2..9c45645 100644 --- a/resources/views/checkout_complete.blade.php +++ b/resources/views/checkout_complete.blade.php @@ -14,13 +14,13 @@

- St. John Catholic Church + North Hackathon
Car Show Silent Auction
- 2099 N. Hacker Rd. + 250 Stephenson Hwy
- Howell, MI 48855 + Troy, MI 48083

diff --git a/resources/views/receiptpdf.blade.php b/resources/views/receiptpdf.blade.php index 057b54c..db3ced8 100644 --- a/resources/views/receiptpdf.blade.php +++ b/resources/views/receiptpdf.blade.php @@ -10,13 +10,13 @@

- St. John Catholic Church + North Hackathon
Car Show Silent Auction
- 2099 N. Hacker Rd. + 250 Stephenson Hwy
- Howell, MI 48855 + Troy, MI 48083

diff --git a/resources/views/receiptpdf2.blade.php b/resources/views/receiptpdf2.blade.php index 72f50fe..e114e99 100644 --- a/resources/views/receiptpdf2.blade.php +++ b/resources/views/receiptpdf2.blade.php @@ -10,13 +10,13 @@

- St. John Catholic Church + North Hackathon
Car Show Silent Auction
- 2099 N. Hacker Rd. + 250 Stephenson Hwy
- Howell, MI 48855 + Troy, MI 48083

From 298f3fa22b9f02c404426697944078809302096c Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 09:38:46 -0400 Subject: [PATCH 16/26] fix: resolve mPDF temp directory access error by using storage_path --- app/Http/Controllers/PagesController.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index ca7212d..d58aa2f 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -255,6 +255,10 @@ class PagesController extends Controller $checkoutid = $request->checkout_id; $checkout_final_results = Checkout::where('checkout_id', '=', $checkoutid) ->first(); + if (!$checkout_final_results) { + return redirect('/mywinnings')->with('error', 'Checkout record not found.'); + } + $bidder_num = $checkout_final_results->bidder_num; $checkout_list_results = DB::select("SELECT *, items.item_assigned_num, items.item_desc @@ -279,7 +283,15 @@ class PagesController extends Controller 'checkout_info_results' => $checkout_info_results ]; - $pdf = PDF::loadView('receiptpdf', $checkout_data); + // Configure mPDF to use a writable directory + $config = [ + 'tempDir' => storage_path('temp') + ]; + if (!file_exists(storage_path('temp'))) { + mkdir(storage_path('temp'), 0755, true); + } + + $pdf = PDF::loadView('receiptpdf', $checkout_data, [], $config); return $pdf->download('receipt-'.$checkoutid.'.pdf'); } From 4b9220c89e0e741a398191cde17ada47d37838c6 Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 09:40:35 -0400 Subject: [PATCH 17/26] fix: update mPDF temp directory configuration key to temp_dir --- app/Http/Controllers/PagesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index d58aa2f..0df6f98 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -285,7 +285,7 @@ class PagesController extends Controller // Configure mPDF to use a writable directory $config = [ - 'tempDir' => storage_path('temp') + 'temp_dir' => storage_path('temp') ]; if (!file_exists(storage_path('temp'))) { mkdir(storage_path('temp'), 0755, true); From 23b0b30434241b5a572415fe57f6f9b943b4fcfc Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 09:42:05 -0400 Subject: [PATCH 18/26] fix: provide full mPDF configuration to avoid null array offset errors --- app/Http/Controllers/PagesController.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index 0df6f98..e2d8e25 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -284,13 +284,20 @@ class PagesController extends Controller ]; // Configure mPDF to use a writable directory - $config = [ - 'temp_dir' => storage_path('temp') - ]; - if (!file_exists(storage_path('temp'))) { - mkdir(storage_path('temp'), 0755, true); + $writableTemp = storage_path('temp'); + if (!file_exists($writableTemp)) { + mkdir($writableTemp, 0755, true); } + $config = [ + 'tempDir' => $writableTemp, + 'mode' => 'utf-8', + 'format' => 'letter', + 'author' => 'St John Church', + 'creator' => 'St John Church', + 'display_mode' => 'fullpage', + ]; + $pdf = PDF::loadView('receiptpdf', $checkout_data, [], $config); return $pdf->download('receipt-'.$checkoutid.'.pdf'); } From b9c018a4a6297daa7540ddc4fd8537f2c613fdb0 Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 09:44:04 -0400 Subject: [PATCH 19/26] fix: set tempDir via getMpdf to bypass problematic loadView config array --- app/Http/Controllers/PagesController.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index e2d8e25..6fc7cb5 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -289,16 +289,9 @@ class PagesController extends Controller mkdir($writableTemp, 0755, true); } - $config = [ - 'tempDir' => $writableTemp, - 'mode' => 'utf-8', - 'format' => 'letter', - 'author' => 'St John Church', - 'creator' => 'St John Church', - 'display_mode' => 'fullpage', - ]; + $pdf = PDF::loadView('receiptpdf', $checkout_data); + $pdf->getMpdf()->tempDir = $writableTemp; - $pdf = PDF::loadView('receiptpdf', $checkout_data, [], $config); return $pdf->download('receipt-'.$checkoutid.'.pdf'); } From 9d981f3a34f93c7dbb1b985a6184d0f5200b6b6a Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 09:56:16 -0400 Subject: [PATCH 20/26] feat: migrate receipt PDF generation to Spatie Laravel PDF --- app/Http/Controllers/PagesController.php | 24 +--- composer.json | 3 +- composer.lock | 156 ++++++++++++++++++++++- 3 files changed, 164 insertions(+), 19 deletions(-) diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index 6fc7cb5..2a705c0 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -6,7 +6,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use View; use App\helpers; -use Mccarlosen\LaravelMpdf\Facades\LaravelMpdf as PDF; +use Spatie\LaravelPdf\Facades\Pdf; use App\Models\Bidders; use App\Models\Items; use App\Models\Checkout; @@ -277,22 +277,12 @@ class PagesController extends Controller WHERE winning_bidder_num = $bidder_num GROUP BY winning_bids.winning_bidder_num "); - $checkout_data = [ - 'checkout_final_results' => $checkout_final_results, - 'checkout_list_results' => $checkout_list_results, - 'checkout_info_results' => $checkout_info_results - ]; - - // Configure mPDF to use a writable directory - $writableTemp = storage_path('temp'); - if (!file_exists($writableTemp)) { - mkdir($writableTemp, 0755, true); - } - - $pdf = PDF::loadView('receiptpdf', $checkout_data); - $pdf->getMpdf()->tempDir = $writableTemp; - - return $pdf->download('receipt-'.$checkoutid.'.pdf'); + + return Pdf::view('receiptpdf', [ + 'checkout_final_results' => $checkout_final_results, + 'checkout_list_results' => $checkout_list_results, + 'checkout_info_results' => $checkout_info_results + ])->name('receipt-'.$checkoutid.'.pdf'); } public function reprintReceipt(Request $reprint_receipt_req) diff --git a/composer.json b/composer.json index 7cf9e77..2e04633 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,8 @@ "laravel/socialite": "^5.26", "laravel/tinker": "^2.9", "laravel/ui": "^4.2", - "socialiteproviders/manager": "^4.9" + "socialiteproviders/manager": "^4.9", + "spatie/laravel-pdf": "^2.8" }, "require-dev": { "barryvdh/laravel-debugbar": "^3.8", diff --git a/composer.lock b/composer.lock index 6de3d70..683a318 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3c08b43425d232f81481839d3c2286fc", + "content-hash": "91ae6772f9ad6590dc3dafcf7b4899fe", "packages": [ { "name": "barryvdh/laravel-snappy", @@ -6220,6 +6220,99 @@ ], "time": "2026-02-21T12:49:54+00:00" }, + { + "name": "spatie/laravel-pdf", + "version": "2.8.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/laravel-pdf.git", + "reference": "2ba286a03ee5e22463fb0a6e706b157a21d5f60a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/laravel-pdf/zipball/2ba286a03ee5e22463fb0a6e706b157a21d5f60a", + "reference": "2ba286a03ee5e22463fb0a6e706b157a21d5f60a", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^11.0|^12.0|^13.0", + "php": "^8.2", + "spatie/laravel-package-tools": "^1.16.1", + "spatie/temporary-directory": "^2.2.1" + }, + "require-dev": { + "chrome-php/chrome": "^1.0", + "dompdf/dompdf": "^3.0", + "ext-imagick": "*", + "larastan/larastan": "^2.7.0|^3.0", + "laravel/pint": "^1.13.7", + "nunomaduro/collision": "^8.0", + "orchestra/testbench": "^9.6|^10.0|^11.0", + "pestphp/pest": "^2.30|^3.7|^4.4", + "pestphp/pest-plugin-arch": "^2.5|^3.0|^4.0", + "pestphp/pest-plugin-laravel": "^2.2|^3.1|^4.1", + "phpstan/extension-installer": "^1.3.1", + "phpstan/phpstan-deprecation-rules": "^1.1.4|^2.0", + "phpstan/phpstan-phpunit": "^1.3.15|^2.0", + "pontedilana/php-weasyprint": "^2.4", + "spatie/image": "^3.3.2", + "spatie/invade": "^2.1", + "spatie/laravel-ray": "^1.33", + "spatie/pdf-to-image": "^2.2|^3.1", + "spatie/pdf-to-text": "^1.52.1", + "spatie/pest-expectations": "^1.5", + "spatie/pest-plugin-snapshots": "^2.1", + "spatie/pixelmatch-php": "^1.0", + "wnx/sidecar-browsershot": "^2.0" + }, + "suggest": { + "chrome-php/chrome": "Required for the Chrome PHP driver (^1.0)", + "dompdf/dompdf": "Required for the DOMPDF driver (^3.0)", + "spatie/browsershot": "Required for the Browsershot driver (^4.0|^5.0)" + }, + "type": "library", + "extra": { + "laravel": { + "aliases": { + "LaravelPdf": "Pdf" + }, + "providers": [ + "Spatie\\LaravelPdf\\PdfServiceProvider" + ] + } + }, + "autoload": { + "files": [ + "src/Support/functions.php" + ], + "psr-4": { + "Spatie\\LaravelPdf\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "role": "Developer" + } + ], + "description": "Create PDFs in Laravel apps", + "homepage": "https://github.com/spatie/laravel-pdf", + "keywords": [ + "laravel", + "laravel-pdf", + "spatie" + ], + "support": { + "issues": "https://github.com/spatie/laravel-pdf/issues", + "source": "https://github.com/spatie/laravel-pdf/tree/2.8.0" + }, + "time": "2026-04-27T08:15:52+00:00" + }, { "name": "spatie/shiki-php", "version": "2.3.3", @@ -6285,6 +6378,67 @@ ], "time": "2026-02-01T09:30:04+00:00" }, + { + "name": "spatie/temporary-directory", + "version": "2.3.1", + "source": { + "type": "git", + "url": "https://github.com/spatie/temporary-directory.git", + "reference": "662e481d6ec07ef29fd05010433428851a42cd07" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/temporary-directory/zipball/662e481d6ec07ef29fd05010433428851a42cd07", + "reference": "662e481d6ec07ef29fd05010433428851a42cd07", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\TemporaryDirectory\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alex Vanderbist", + "email": "alex@spatie.be", + "homepage": "https://spatie.be", + "role": "Developer" + } + ], + "description": "Easily create, use and destroy temporary directories", + "homepage": "https://github.com/spatie/temporary-directory", + "keywords": [ + "php", + "spatie", + "temporary-directory" + ], + "support": { + "issues": "https://github.com/spatie/temporary-directory/issues", + "source": "https://github.com/spatie/temporary-directory/tree/2.3.1" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2026-01-12T07:42:22+00:00" + }, { "name": "symfony/clock", "version": "v8.0.8", From 24d1eda717815467394979702dfc25cc4f4e4c7d Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 09:57:46 -0400 Subject: [PATCH 21/26] feat: install spatie/browsershot --- composer.json | 1 + composer.lock | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2e04633..52e6eb8 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,7 @@ "laravel/tinker": "^2.9", "laravel/ui": "^4.2", "socialiteproviders/manager": "^4.9", + "spatie/browsershot": "^5.3", "spatie/laravel-pdf": "^2.8" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 683a318..9558fc2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "91ae6772f9ad6590dc3dafcf7b4899fe", + "content-hash": "eb73237e8d87f14d74bd22923c5b8523", "packages": [ { "name": "barryvdh/laravel-snappy", @@ -6100,6 +6100,74 @@ }, "time": "2026-03-18T22:13:24+00:00" }, + { + "name": "spatie/browsershot", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/browsershot.git", + "reference": "91ba83158c4c7cdee34562cca7936ed995b87f3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/browsershot/zipball/91ba83158c4c7cdee34562cca7936ed995b87f3e", + "reference": "91ba83158c4c7cdee34562cca7936ed995b87f3e", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "ext-json": "*", + "php": "^8.2", + "spatie/temporary-directory": "^2.0", + "symfony/process": "^6.0|^7.0|^8.0" + }, + "require-dev": { + "pestphp/pest": "^3.0|^4.0", + "spatie/image": "^3.6", + "spatie/pdf-to-text": "^1.52", + "spatie/phpunit-snapshot-assertions": "^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\Browsershot\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://github.com/freekmurze", + "role": "Developer" + } + ], + "description": "Convert a webpage to an image or pdf using headless Chrome", + "homepage": "https://github.com/spatie/browsershot", + "keywords": [ + "chrome", + "convert", + "headless", + "image", + "pdf", + "puppeteer", + "screenshot", + "webpage" + ], + "support": { + "source": "https://github.com/spatie/browsershot/tree/5.3.0" + }, + "funding": [ + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2026-04-27T08:01:04+00:00" + }, { "name": "spatie/invade", "version": "2.1.0", From 7d1ec59dea46b0ad9a610d408890647d5a794008 Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 10:06:35 -0400 Subject: [PATCH 22/26] feat: switch to dompdf for receipt generation --- app/Http/Controllers/PagesController.php | 42 +- composer.json | 2 +- composer.lock | 515 ++++++++++++++++++++--- 3 files changed, 487 insertions(+), 72 deletions(-) diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index 2a705c0..b760faf 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -278,11 +278,49 @@ class PagesController extends Controller GROUP BY winning_bids.winning_bidder_num "); - return Pdf::view('receiptpdf', [ +use Dompdf\Dompdf; + +// ... + + public function downloadReceiptPdf(Request $request) + { + $checkoutid = $request->checkout_id; + $checkout_final_results = Checkout::where('checkout_id', '=', $checkoutid)->first(); + if (!$checkout_final_results) { + return redirect('/mywinnings')->with('error', 'Checkout record not found.'); + } + + $bidder_num = $checkout_final_results->bidder_num; + $checkout_list_results = DB::select("SELECT + *, items.item_assigned_num, items.item_desc + FROM winning_bids + INNER JOIN items AS items ON winning_bids.winning_item_num=items.iditems + WHERE winning_bidder_num = $bidder_num + "); + $checkout_info_results = DB::select("SELECT + winning_bids.*, + bidders.*, + sum(winning_cost) AS total_cost + FROM winning_bids + INNER JOIN bidders AS bidders ON winning_bids.winning_bidder_num=bidders.idbidders + WHERE winning_bidder_num = $bidder_num + GROUP BY winning_bids.winning_bidder_num + "); + + $dompdf = new Dompdf(); + $dompdf->setOptions(['isHtml5ParserEnabled' => true, 'isRemoteEnabled' => true]); + + $html = view('receiptpdf', [ 'checkout_final_results' => $checkout_final_results, 'checkout_list_results' => $checkout_list_results, 'checkout_info_results' => $checkout_info_results - ])->name('receipt-'.$checkoutid.'.pdf'); + ])->render(); + + $dompdf->loadHtml($html); + $dompdf->setPaper('letter', 'portrait'); + $dompdf->render(); + + return $dompdf->stream('receipt-'.$checkoutid.'.pdf'); } public function reprintReceipt(Request $reprint_receipt_req) diff --git a/composer.json b/composer.json index 52e6eb8..2754117 100644 --- a/composer.json +++ b/composer.json @@ -8,6 +8,7 @@ "php": "^8.2", "barryvdh/laravel-snappy": "^1.0", "carlos-meneses/laravel-mpdf": "^2.1", + "dompdf/dompdf": "^3.1", "filament/filament": "^5.0", "kovah/laravel-socialite-oidc": "^0.7.0", "laravel/framework": "^11.0", @@ -15,7 +16,6 @@ "laravel/tinker": "^2.9", "laravel/ui": "^4.2", "socialiteproviders/manager": "^4.9", - "spatie/browsershot": "^5.3", "spatie/laravel-pdf": "^2.8" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 9558fc2..5efc729 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "eb73237e8d87f14d74bd22923c5b8523", + "content-hash": "bc73ddd14c4ed8e50e635ca2db38cdd8", "packages": [ { "name": "barryvdh/laravel-snappy", @@ -928,6 +928,161 @@ ], "time": "2024-02-05T11:56:58+00:00" }, + { + "name": "dompdf/dompdf", + "version": "v3.1.5", + "source": { + "type": "git", + "url": "https://github.com/dompdf/dompdf.git", + "reference": "f11ead23a8a76d0ff9bbc6c7c8fd7e05ca328496" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dompdf/dompdf/zipball/f11ead23a8a76d0ff9bbc6c7c8fd7e05ca328496", + "reference": "f11ead23a8a76d0ff9bbc6c7c8fd7e05ca328496", + "shasum": "" + }, + "require": { + "dompdf/php-font-lib": "^1.0.0", + "dompdf/php-svg-lib": "^1.0.0", + "ext-dom": "*", + "ext-mbstring": "*", + "masterminds/html5": "^2.0", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "ext-gd": "*", + "ext-json": "*", + "ext-zip": "*", + "mockery/mockery": "^1.3", + "phpunit/phpunit": "^7.5 || ^8 || ^9 || ^10 || ^11", + "squizlabs/php_codesniffer": "^3.5", + "symfony/process": "^4.4 || ^5.4 || ^6.2 || ^7.0" + }, + "suggest": { + "ext-gd": "Needed to process images", + "ext-gmagick": "Improves image processing performance", + "ext-imagick": "Improves image processing performance", + "ext-zlib": "Needed for pdf stream compression" + }, + "type": "library", + "autoload": { + "psr-4": { + "Dompdf\\": "src/" + }, + "classmap": [ + "lib/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1" + ], + "authors": [ + { + "name": "The Dompdf Community", + "homepage": "https://github.com/dompdf/dompdf/blob/master/AUTHORS.md" + } + ], + "description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter", + "homepage": "https://github.com/dompdf/dompdf", + "support": { + "issues": "https://github.com/dompdf/dompdf/issues", + "source": "https://github.com/dompdf/dompdf/tree/v3.1.5" + }, + "time": "2026-03-03T13:54:37+00:00" + }, + { + "name": "dompdf/php-font-lib", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/dompdf/php-font-lib.git", + "reference": "a6e9a688a2a80016ac080b97be73d3e10c444c9a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dompdf/php-font-lib/zipball/a6e9a688a2a80016ac080b97be73d3e10c444c9a", + "reference": "a6e9a688a2a80016ac080b97be73d3e10c444c9a", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8 || ^9 || ^10 || ^11 || ^12" + }, + "type": "library", + "autoload": { + "psr-4": { + "FontLib\\": "src/FontLib" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1-or-later" + ], + "authors": [ + { + "name": "The FontLib Community", + "homepage": "https://github.com/dompdf/php-font-lib/blob/master/AUTHORS.md" + } + ], + "description": "A library to read, parse, export and make subsets of different types of font files.", + "homepage": "https://github.com/dompdf/php-font-lib", + "support": { + "issues": "https://github.com/dompdf/php-font-lib/issues", + "source": "https://github.com/dompdf/php-font-lib/tree/1.0.2" + }, + "time": "2026-01-20T14:10:26+00:00" + }, + { + "name": "dompdf/php-svg-lib", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/dompdf/php-svg-lib.git", + "reference": "8259ffb930817e72b1ff1caef5d226501f3dfeb1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dompdf/php-svg-lib/zipball/8259ffb930817e72b1ff1caef5d226501f3dfeb1", + "reference": "8259ffb930817e72b1ff1caef5d226501f3dfeb1", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^7.1 || ^8.0", + "sabberworm/php-css-parser": "^8.4 || ^9.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8 || ^9 || ^10 || ^11" + }, + "type": "library", + "autoload": { + "psr-4": { + "Svg\\": "src/Svg" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "The SvgLib Community", + "homepage": "https://github.com/dompdf/php-svg-lib/blob/master/AUTHORS.md" + } + ], + "description": "A library to read, parse and export to PDF SVG files.", + "homepage": "https://github.com/dompdf/php-svg-lib", + "support": { + "issues": "https://github.com/dompdf/php-svg-lib/issues", + "source": "https://github.com/dompdf/php-svg-lib/tree/1.0.2" + }, + "time": "2026-01-02T16:01:13+00:00" + }, { "name": "dragonmantank/cron-expression", "version": "v3.6.0", @@ -3774,6 +3929,73 @@ ], "time": "2026-04-02T20:48:35+00:00" }, + { + "name": "masterminds/html5", + "version": "2.10.0", + "source": { + "type": "git", + "url": "https://github.com/Masterminds/html5-php.git", + "reference": "fcf91eb64359852f00d921887b219479b4f21251" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Masterminds/html5-php/zipball/fcf91eb64359852f00d921887b219479b4f21251", + "reference": "fcf91eb64359852f00d921887b219479b4f21251", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8 || ^9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Masterminds\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matt Butcher", + "email": "technosophos@gmail.com" + }, + { + "name": "Matt Farina", + "email": "matt@mattfarina.com" + }, + { + "name": "Asmir Mustafic", + "email": "goetas@gmail.com" + } + ], + "description": "An HTML5 parser and serializer.", + "homepage": "http://masterminds.github.io/html5-php", + "keywords": [ + "HTML5", + "dom", + "html", + "parser", + "querypath", + "serializer", + "xml" + ], + "support": { + "issues": "https://github.com/Masterminds/html5-php/issues", + "source": "https://github.com/Masterminds/html5-php/tree/2.10.0" + }, + "time": "2025-07-25T09:04:22+00:00" + }, { "name": "monolog/monolog", "version": "3.10.0", @@ -5876,6 +6098,86 @@ ], "time": "2026-03-19T10:36:26+00:00" }, + { + "name": "sabberworm/php-css-parser", + "version": "v9.3.0", + "source": { + "type": "git", + "url": "https://github.com/MyIntervals/PHP-CSS-Parser.git", + "reference": "88dbd0f7f91abbfe4402d0a3071e9ff4d81ed949" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/MyIntervals/PHP-CSS-Parser/zipball/88dbd0f7f91abbfe4402d0a3071e9ff4d81ed949", + "reference": "88dbd0f7f91abbfe4402d0a3071e9ff4d81ed949", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": "^7.2.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", + "thecodingmachine/safe": "^1.3 || ^2.5 || ^3.4" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "1.4.0", + "phpstan/extension-installer": "1.4.3", + "phpstan/phpstan": "1.12.32 || 2.1.32", + "phpstan/phpstan-phpunit": "1.4.2 || 2.0.8", + "phpstan/phpstan-strict-rules": "1.6.2 || 2.0.7", + "phpunit/phpunit": "8.5.52", + "rawr/phpunit-data-provider": "3.3.1", + "rector/rector": "1.2.10 || 2.2.8", + "rector/type-perfect": "1.0.0 || 2.1.0", + "squizlabs/php_codesniffer": "4.0.1", + "thecodingmachine/phpstan-safe-rule": "1.2.0 || 1.4.1" + }, + "suggest": { + "ext-mbstring": "for parsing UTF-8 CSS" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "9.4.x-dev" + } + }, + "autoload": { + "files": [ + "src/Rule/Rule.php", + "src/RuleSet/RuleContainer.php" + ], + "psr-4": { + "Sabberworm\\CSS\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Raphael Schweikert" + }, + { + "name": "Oliver Klee", + "email": "github@oliverklee.de" + }, + { + "name": "Jake Hotson", + "email": "jake.github@qzdesign.co.uk" + } + ], + "description": "Parser for CSS Files written in PHP", + "homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser", + "keywords": [ + "css", + "parser", + "stylesheet" + ], + "support": { + "issues": "https://github.com/MyIntervals/PHP-CSS-Parser/issues", + "source": "https://github.com/MyIntervals/PHP-CSS-Parser/tree/v9.3.0" + }, + "time": "2026-03-03T17:31:43+00:00" + }, { "name": "scrivo/highlight.php", "version": "v9.18.1.10", @@ -6100,74 +6402,6 @@ }, "time": "2026-03-18T22:13:24+00:00" }, - { - "name": "spatie/browsershot", - "version": "5.3.0", - "source": { - "type": "git", - "url": "https://github.com/spatie/browsershot.git", - "reference": "91ba83158c4c7cdee34562cca7936ed995b87f3e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spatie/browsershot/zipball/91ba83158c4c7cdee34562cca7936ed995b87f3e", - "reference": "91ba83158c4c7cdee34562cca7936ed995b87f3e", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "ext-json": "*", - "php": "^8.2", - "spatie/temporary-directory": "^2.0", - "symfony/process": "^6.0|^7.0|^8.0" - }, - "require-dev": { - "pestphp/pest": "^3.0|^4.0", - "spatie/image": "^3.6", - "spatie/pdf-to-text": "^1.52", - "spatie/phpunit-snapshot-assertions": "^5.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Spatie\\Browsershot\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Freek Van der Herten", - "email": "freek@spatie.be", - "homepage": "https://github.com/freekmurze", - "role": "Developer" - } - ], - "description": "Convert a webpage to an image or pdf using headless Chrome", - "homepage": "https://github.com/spatie/browsershot", - "keywords": [ - "chrome", - "convert", - "headless", - "image", - "pdf", - "puppeteer", - "screenshot", - "webpage" - ], - "support": { - "source": "https://github.com/spatie/browsershot/tree/5.3.0" - }, - "funding": [ - { - "url": "https://github.com/spatie", - "type": "github" - } - ], - "time": "2026-04-27T08:01:04+00:00" - }, { "name": "spatie/invade", "version": "2.1.0", @@ -8991,6 +9225,149 @@ ], "time": "2026-03-30T13:44:50+00:00" }, + { + "name": "thecodingmachine/safe", + "version": "v3.4.0", + "source": { + "type": "git", + "url": "https://github.com/thecodingmachine/safe.git", + "reference": "705683a25bacf0d4860c7dea4d7947bfd09eea19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thecodingmachine/safe/zipball/705683a25bacf0d4860c7dea4d7947bfd09eea19", + "reference": "705683a25bacf0d4860c7dea4d7947bfd09eea19", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "^1.4", + "phpstan/phpstan": "^2", + "phpunit/phpunit": "^10", + "squizlabs/php_codesniffer": "^3.2" + }, + "type": "library", + "autoload": { + "files": [ + "lib/special_cases.php", + "generated/apache.php", + "generated/apcu.php", + "generated/array.php", + "generated/bzip2.php", + "generated/calendar.php", + "generated/classobj.php", + "generated/com.php", + "generated/cubrid.php", + "generated/curl.php", + "generated/datetime.php", + "generated/dir.php", + "generated/eio.php", + "generated/errorfunc.php", + "generated/exec.php", + "generated/fileinfo.php", + "generated/filesystem.php", + "generated/filter.php", + "generated/fpm.php", + "generated/ftp.php", + "generated/funchand.php", + "generated/gettext.php", + "generated/gmp.php", + "generated/gnupg.php", + "generated/hash.php", + "generated/ibase.php", + "generated/ibmDb2.php", + "generated/iconv.php", + "generated/image.php", + "generated/imap.php", + "generated/info.php", + "generated/inotify.php", + "generated/json.php", + "generated/ldap.php", + "generated/libxml.php", + "generated/lzf.php", + "generated/mailparse.php", + "generated/mbstring.php", + "generated/misc.php", + "generated/mysql.php", + "generated/mysqli.php", + "generated/network.php", + "generated/oci8.php", + "generated/opcache.php", + "generated/openssl.php", + "generated/outcontrol.php", + "generated/pcntl.php", + "generated/pcre.php", + "generated/pgsql.php", + "generated/posix.php", + "generated/ps.php", + "generated/pspell.php", + "generated/readline.php", + "generated/rnp.php", + "generated/rpminfo.php", + "generated/rrd.php", + "generated/sem.php", + "generated/session.php", + "generated/shmop.php", + "generated/sockets.php", + "generated/sodium.php", + "generated/solr.php", + "generated/spl.php", + "generated/sqlsrv.php", + "generated/ssdeep.php", + "generated/ssh2.php", + "generated/stream.php", + "generated/strings.php", + "generated/swoole.php", + "generated/uodbc.php", + "generated/uopz.php", + "generated/url.php", + "generated/var.php", + "generated/xdiff.php", + "generated/xml.php", + "generated/xmlrpc.php", + "generated/yaml.php", + "generated/yaz.php", + "generated/zip.php", + "generated/zlib.php" + ], + "classmap": [ + "lib/DateTime.php", + "lib/DateTimeImmutable.php", + "lib/Exceptions/", + "generated/Exceptions/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHP core functions that throw exceptions instead of returning FALSE on error", + "support": { + "issues": "https://github.com/thecodingmachine/safe/issues", + "source": "https://github.com/thecodingmachine/safe/tree/v3.4.0" + }, + "funding": [ + { + "url": "https://github.com/OskarStark", + "type": "github" + }, + { + "url": "https://github.com/shish", + "type": "github" + }, + { + "url": "https://github.com/silasjoisten", + "type": "github" + }, + { + "url": "https://github.com/staabm", + "type": "github" + } + ], + "time": "2026-02-04T18:08:13+00:00" + }, { "name": "tijsverkoyen/css-to-inline-styles", "version": "v2.4.0", From d468991bd1c08940bded23601350546e0b454acc Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 10:08:01 -0400 Subject: [PATCH 23/26] typo --- app/Http/Controllers/PagesController.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index b760faf..7c706e3 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -277,10 +277,7 @@ class PagesController extends Controller WHERE winning_bidder_num = $bidder_num GROUP BY winning_bids.winning_bidder_num "); - -use Dompdf\Dompdf; - -// ... + } public function downloadReceiptPdf(Request $request) { From dcd08ae530825d1550429c6e574f7176662293e1 Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 10:09:01 -0400 Subject: [PATCH 24/26] fix duplicate function --- app/Http/Controllers/PagesController.php | 29 ------------------------ 1 file changed, 29 deletions(-) diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index 7c706e3..4607e84 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -250,35 +250,6 @@ class PagesController extends Controller return view('receiptpdf', $checkout_data); } - public function downloadReceiptPdf(Request $request) - { - $checkoutid = $request->checkout_id; - $checkout_final_results = Checkout::where('checkout_id', '=', $checkoutid) - ->first(); - if (!$checkout_final_results) { - return redirect('/mywinnings')->with('error', 'Checkout record not found.'); - } - - $bidder_num = $checkout_final_results->bidder_num; - $checkout_list_results = DB::select("SELECT - *, items.item_assigned_num, items.item_desc - FROM winning_bids - INNER JOIN items AS items - ON winning_bids.winning_item_num=items.iditems - WHERE winning_bidder_num = $bidder_num - "); - $checkout_info_results = DB::select("SELECT - winning_bids.*, - bidders.*, - sum(winning_cost) AS total_cost - FROM winning_bids - INNER JOIN bidders AS bidders - ON winning_bids.winning_bidder_num=bidders.idbidders - WHERE winning_bidder_num = $bidder_num - GROUP BY winning_bids.winning_bidder_num - "); - } - public function downloadReceiptPdf(Request $request) { $checkoutid = $request->checkout_id; From 9065dcd911cb885f441b962e4af869a8e5ec2e04 Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 10:09:35 -0400 Subject: [PATCH 25/26] missing use --- app/Http/Controllers/PagesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index 4607e84..fb84ccd 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -19,7 +19,7 @@ use App\Models\CarShowCategory; use App\Models\Types; use App\Models\Vehicles; use App\Models\VehicleScores; - +use Dompdf\Dompdf; class PagesController extends Controller { public function home() From 05ab1c6014b1739bdfba77a6fd4ed5a4d41b8c54 Mon Sep 17 00:00:00 2001 From: Russ Long Date: Fri, 1 May 2026 10:10:16 -0400 Subject: [PATCH 26/26] fix: use correct Options object for Dompdf configuration --- app/Http/Controllers/PagesController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index fb84ccd..588a913 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -275,8 +275,10 @@ class PagesController extends Controller GROUP BY winning_bids.winning_bidder_num "); - $dompdf = new Dompdf(); - $dompdf->setOptions(['isHtml5ParserEnabled' => true, 'isRemoteEnabled' => true]); + $options = new \Dompdf\Options(); + $options->set('isHtml5ParserEnabled', true); + $options->set('isRemoteEnabled', true); + $dompdf = new Dompdf($options); $html = view('receiptpdf', [ 'checkout_final_results' => $checkout_final_results,