generated from include-davis/Next.js-App-Router-Starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Implement the ProcessOrder endpoint that the client (demo site) will call whenever someone makes an order to the store. ProcessOrder should:
- Take in non-sensitive user info (basically everything on the Order model, NOT credit card info).
- Calculate the cart total.
- Create a new Order using the existing create order function. Set the status to "pending payment".
- Create a Stripe PaymentIntent with the Order's ID in the metadata, so Stripe now knows how much money to expect from the purchase.
- Then, update the Order to also contain the PaymentIntent's ID as a field.
- Returns the created Order and the client_secret from the PaymentIntent to the client.
Metadata
Metadata
Assignees
Labels
No labels