Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

Revert "main <- develop"

Dave Earley7e8407b5f9e4
diff --git a/backend/app/DomainObjects/OrderDomainObject.php b/backend/app/DomainObjects/OrderDomainObject.php
index 5782dd2af..9a5baed0f 100644
--- a/backend/app/DomainObjects/OrderDomainObject.php
+++ b/backend/app/DomainObjects/OrderDomainObject.php
@@ -29,8 +29,6 @@ class OrderDomainObject extends Generated\OrderDomainObjectAbstract implements I
public ?EventDomainObject $event = null;
- public ?string $sessionIdentifier = null;
-
public static function getAllowedFilterFields(): array
{
return [
@@ -255,15 +253,4 @@ class OrderDomainObject extends Generated\OrderDomainObjectAbstract implements I
{
return $this->invoices;
}
-
- public function setSessionIdentifier(?string $sessionIdentifier): OrderDomainObject
- {
- $this->sessionIdentifier = $sessionIdentifier;
- return $this;
- }
-
- public function getSessionIdentifier(): ?string
- {
- return $this->sessionIdentifier;
- }
}
diff --git a/backend/app/Http/Actions/Orders/Public/CreateOrderActionPublic.php b/backend/app/Http/Actions/Orders/Public/CreateOrderActionPublic.php
index 9f0f48fde..bf024a9df 100644
--- a/backend/app/Http/Actions/Orders/Public/CreateOrderActionPublic.php
+++ b/backend/app/Http/Actions/Orders/Public/CreateOrderActionPublic.php
@@ -48,12 +48,10 @@ class CreateOrderActionPublic extends BaseAction
])
);
- $order->setSessionIdentifier($sessionId);
-
$response = $this->resourceResponse(
resource: OrderResourcePublic::class,
data: $order,
- statusCode: ResponseCodes::HTTP_CREATED,
+ statusCode: ResponseCodes::HTTP_CREATED
);
return $response->withCookie(
diff --git a/backend/app/Http/Actions/Orders/Public/GetOrderActionPublic.php b/backend/app/Http/Actions/Orders/Public/GetOrderActionPublic.php
index ff8133af4..01b7e0e92 100644
--- a/backend/app/Http/Actions/Orders/Public/GetOrderActionPublic.php
+++ b/backend/app/Http/Actions/Orders/Public/GetOrderActionPublic.php
@@ -6,15 +6,13 @@ use HiEvents\Http\Actions\BaseAction;
use HiEvents\Resources\Order\OrderResourcePublic;
use HiEvents\Services\Application\Handlers\Order\DTO\GetOrderPublicDTO;
use HiEvents\Services\Application\Handlers\Order\GetOrderPublicHandler;
-use HiEvents\Services\Infrastructure\Session\CheckoutSessionManagementService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class GetOrderActionPublic extends BaseAction
{
public function __construct(
- private readonly GetOrderPublicHandler $getOrderPublicHandler,
- private readonly CheckoutSessionManagementService $sessionService,
+ private readonly GetOrderPublicHandler $getOrderPublicHandler
)
{
}
@@ -27,17 +25,9 @@ class GetOrderActionPublic extends BaseAction
includeEventInResponse: $this->isIncludeRequested($request, 'event'),
));
- $response = $this->resourceResponse(
+ return $this->resourceResponse(
resource: OrderResourcePublic::class,
data: $order,
);
-
- if ($request->query->has('session_identifier')) {
- $response->headers->setCookie(
- $this->sessionService->getSessionCookie()
- );
- }
-
- return $response;
}
}
diff --git a/backend/app/Resources/Order/OrderResourcePublic.php b/backend/app/Resources/Order/OrderResourcePublic.php
index 7880d22ed..4654c5092 100644
--- a/backend/app/Resources/Order/OrderResourcePublic.php
+++ b/backend/app/Resources/Order/OrderResourcePublic.php
@@ -8,6 +8,7 @@ use HiEvents\DomainObjects\Status\OrderStatus;
use HiEvents\Resources\Attendee\AttendeeResourcePublic;
use HiEvents\Resources\BaseResource;
use HiEvents\Resources\Event\EventResourcePublic;
+use HiEvents\Resources\Order\Invoice\InvoiceResource;
use HiEvents\Resources\Order\Invoice\InvoiceResourcePublic;
use Illuminate\Http\Request;
@@ -63,9 +64,6 @@ class OrderResourcePublic extends BaseResource
!is_null($this->getAttendees()),
fn() => AttendeeResourcePublic::collection($this->getAttendees())
),
- $this->mergeWhen($this->getSessionIdentifier() !== null, fn() => [
- 'session_identifier' => $this->getSessionIdentifier(),
- ]),
];
}
}
diff --git a/backend/app/Services/Infrastructure/Session/CheckoutSessionManagementService.php b/backend/app/Services/Infrastructure/Session/CheckoutSessionManagementService.php
index d7552ac84..792067f84 100644
--- a/backend/app/Services/Infrastructure/Session/CheckoutSessionManagementService.php
+++ b/backend/app/Services/Infrastructure/Session/CheckoutSessionManagementService.php
@@ -22,7 +22,7 @@ class CheckoutSessionManagementService
}
/**
- * Get the session ID from query param, cookie, or generate a new one.
+ * Get the session ID from the cookie, or generate a new one if it doesn't exist.
*/
public function getSessionId(): string
{
@@ -30,9 +30,7 @@ class CheckoutSessionManagementService
return $this->sessionId;
}
- $this->sessionId = $this->request->query(self::SESSION_IDENTIFIER)
- ?? $this->request->cookie(self::SESSION_IDENTIFIER)
- ?? $this->createSessionId();
+ $this->sessionId = $this->request->cookie(self::SESSION_IDENTIFIER) ?? $this->createSessionId();
return $this->sessionId;
}
diff --git a/frontend/src/api/order.client.ts b/frontend/src/api/order.client.ts
index 8d9ed1c24..eb80c8001 100644
--- a/frontend/src/api/order.client.ts
+++ b/frontend/src/api/order.client.ts
@@ -116,24 +116,8 @@ export const orderClientPublic = {
return response.data;
},
- findByShortId: async (
- eventId: number,
- orderShortId: string,
- includes: string[] = [],
- sessionIdentifier?: string
- ) => {
- const query = new URLSearchParams();
- if (includes.length > 0) {
- query.append("include", includes.join(","));
- }
- if (sessionIdentifier) {
- query.append("session_identifier", sessionIdentifier);
- }
-
- const response = await publicApi.get<GenericDataResponse<Order>>(
- `events/${eventId}/order/${orderShortId}?${query.toString()}`
- );
-
+ findByShortId: async (eventId: number, orderShortId: string, includes: string[] = []) => {
+ const response = await publicApi.get<GenericDataResponse<Order>>(`events/${eventId}/order/${orderShortId}?include=${includes.join(',')}`);
return response.data;
},
diff --git a/frontend/src/components/routes/product-widget/SelectProducts/index.tsx b/frontend/src/components/routes/product-widget/SelectProducts/index.tsx
index 44d3c3265..8f6d74aa6 100644
--- a/frontend/src/components/routes/product-widget/SelectProducts/index.tsx
+++ b/frontend/src/components/routes/product-widget/SelectProducts/index.tsx
@@ -103,10 +103,7 @@ const SelectProducts = (props: SelectProductsProps) => {
.then(() => {
const url = '/checkout/' + eventId + '/' + data.data.short_id + '/details';
if (props.widgetMode === 'embedded') {
- window.open(
- url + '?session_identifier=' + data.data.session_identifier + '&utm_source=embedded_widget',
- '_blank'
- );
+ window.open(url, '_blank');
setOrderInProcessOverlayVisible(true);
return;
}
diff --git a/frontend/src/queries/useGetOrderPublic.ts b/frontend/src/queries/useGetOrderPublic.ts
index 77dfb1285..c098c917e 100644
--- a/frontend/src/queries/useGetOrderPublic.ts
+++ b/frontend/src/queries/useGetOrderPublic.ts
@@ -1,44 +1,25 @@
import {useQuery} from "@tanstack/react-query";
import {orderClientPublic} from "../api/order.client.ts";
import {IdParam, Order} from "../types.ts";
-import {useMemo} from "react";
-import {isSsr} from "../utilites/helpers.ts";
-export const GET_ORDER_PUBLIC_QUERY_KEY = "getOrderPublic";
-
-const getSessionIdentifierFromUrl = (): string | null => {
- if (isSsr()) return null;
-
- const url = new URL(window.location.href);
- return url.searchParams.get("session_identifier");
-};
-
-export const useGetOrderPublic = (
- eventId: IdParam,
- orderShortId: IdParam,
- includes: string[] = []
-) => {
- const sessionIdentifier = useMemo(getSessionIdentifierFromUrl, []);
+export const GET_ORDER_PUBLIC_QUERY_KEY = 'getOrderPublic';
+export const useGetOrderPublic = (eventId: IdParam, orderShortId: IdParam, includes: string[] = []) => {
return useQuery<Order>({
- queryKey: [
- GET_ORDER_PUBLIC_QUERY_KEY,
- eventId,
- orderShortId,
- sessionIdentifier,
- ],
+ queryKey: [GET_ORDER_PUBLIC_QUERY_KEY, eventId, orderShortId],
+
queryFn: async () => {
const {data} = await orderClientPublic.findByShortId(
Number(eventId),
String(orderShortId),
includes,
- sessionIdentifier ?? undefined
);
return data;
},
+
refetchOnWindowFocus: false,
staleTime: 500,
retryOnMount: false,
- retry: false,
+ retry: false
});
-};
+}
diff --git a/frontend/src/types.ts b/frontend/src/types.ts
index 9ed8652cf..1d851bf82 100644
--- a/frontend/src/types.ts
+++ b/frontend/src/types.ts
@@ -475,7 +475,6 @@ export interface Order {
question_answers?: QuestionAnswer[];
event?: Event;
latest_invoice?: Invoice;
- session_identifier?: string;
}
export interface Invoice {