Merge pull request #194 from copenhagentruckwash/fix-missing-department-authorization-for-payment-intents
Require department access on Stripe payment-intent routes
This commit is contained in:
@@ -605,6 +605,7 @@ class ordersRoute
|
||||
if (!$order->exists()) {
|
||||
$response->error('Order not found', 400);
|
||||
}
|
||||
self::requireDepartmentAccess((int)$order->department_id->value());
|
||||
|
||||
$department = (new departments_o())->selectId((int)$order->department_id->value());
|
||||
if (!$department->isStripeConfigured()) {
|
||||
@@ -730,6 +731,7 @@ class ordersRoute
|
||||
if (!$order->exists()) {
|
||||
$response->error('Order not found', 400);
|
||||
}
|
||||
self::requireDepartmentAccess((int)$order->department_id->value());
|
||||
|
||||
$stripePaymentIntents = new stripe_payment_intents_o();
|
||||
if (!$stripePaymentIntents->doesOrderHavePaymentIntent((int)$order->id)) {
|
||||
@@ -788,6 +790,7 @@ class ordersRoute
|
||||
if (!$order->exists()) {
|
||||
$response->error('Order not found', 400);
|
||||
}
|
||||
self::requireDepartmentAccess((int)$order->department_id->value());
|
||||
|
||||
$stripePaymentIntents = new stripe_payment_intents_o();
|
||||
if (!$stripePaymentIntents->doesOrderHavePaymentIntent((int)$order->id)) {
|
||||
|
||||
Reference in New Issue
Block a user