forked from TFMM/silent-auction
feat: integrate North Embedded Checkout for bidder payments #1
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user