summaryrefslogtreecommitdiff
path: root/api-src/createPaypalOrder.ts
diff options
context:
space:
mode:
authorJoe Carstairs <65492573+Sycamost@users.noreply.github.com>2023-08-08 08:07:28 +0100
committerJoe Carstairs <65492573+Sycamost@users.noreply.github.com>2023-08-08 08:07:28 +0100
commit4a5bd8bf5e3c6017794d7c5c7eb4f2794a902245 (patch)
treeda65df5a62bd7119226a06cfcd731bb18d879751 /api-src/createPaypalOrder.ts
parent6efde13e05ce8f516672106d93eeaa0c5224bc42 (diff)
Revert "Doesn't insist on POST"
This reverts commit 84adcb14af7a0e13549f1977a2a5690e978fcf57.
Diffstat (limited to 'api-src/createPaypalOrder.ts')
-rw-r--r--api-src/createPaypalOrder.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/api-src/createPaypalOrder.ts b/api-src/createPaypalOrder.ts
index 0ae9f8f..676d788 100644
--- a/api-src/createPaypalOrder.ts
+++ b/api-src/createPaypalOrder.ts
@@ -5,6 +5,12 @@ import { paypalCreateOrder } from './_paypal';
export default async function handler(request: VercelRequest, response: VercelResponse) {
const { productDescription, shortDescription, totalPrice }: Partial<Order> = request.body;
+ if (request.method !== 'POST') {
+ console.warn('Method was not POST. Method was ' + request.method);
+ response.status(404);
+ return;
+ }
+
if (!productDescription) {
response.status(400).send('Expected body to contain productDescription, but none provided.');
} else if (!shortDescription) {