feat: include products in checkout and increase form container size

This commit is contained in:
2026-05-01 08:41:58 -04:00
parent 9587c44657
commit 68f75ac2fc
2 changed files with 23 additions and 1 deletions
@@ -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()) {
+13
View File
@@ -1,6 +1,19 @@
@extends('layouts.app')
@section('content')
<style>
#checkout-container {
min-height: 600px;
width: 100%;
margin-top: 20px;
}
/* Ensure the iframe inside the container takes full width */
#checkout-container iframe {
width: 100% !important;
min-height: 600px !important;
}
</style>
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">