Skip to content

Commit

Permalink
fix userticketId in createcheckout
Browse files Browse the repository at this point in the history
  • Loading branch information
Ratchet7x5 committed Dec 13, 2024
1 parent 2f22ceb commit 219802b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/controller/stripeController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const endpointSecret: string = process.env.STRIPE_WEBHOOK_ENDPOINT as string;
export const createCheckout = asyncHandler(
async (req: Request, res: Response) => {
const { priceId, userTicketId } = req.body;
console.log("createCheckout: req.body: ", req.body, 2);
console.log("createCheckout: priceId: " + priceId);
console.log("createCheckout: userTicketId: " + userTicketId);
const session = req.session!;
Expand All @@ -31,7 +32,10 @@ export const createCheckout = asyncHandler(
}

let checkPriceId = priceId === undefined || priceId === "";
console.log("createCheckout: priceId Check: ", checkPriceId);
console.log(
"createCheckout: is priceId undefined or empty: ",
checkPriceId
);
// if priceId is undefined, send a 404 back.
if (priceId === undefined || priceId === "") {
return res
Expand Down Expand Up @@ -88,7 +92,7 @@ export const createCheckout = asyncHandler(
metadata: {
priceId: `${priceId}`,
isEventTicket: `${isEventTicket}`,
userTicketId: `${userTicketId}`,
userTicketId: userTicketId,
},
});

Expand Down

0 comments on commit 219802b

Please sign in to comment.