Skip to content

ProcessOrder API Endpoint #77

@brandonw504

Description

@brandonw504

Implement the ProcessOrder endpoint that the client (demo site) will call whenever someone makes an order to the store. ProcessOrder should:

  1. Take in non-sensitive user info (basically everything on the Order model, NOT credit card info).
  2. Calculate the cart total.
  3. Create a new Order using the existing create order function. Set the status to "pending payment".
  4. Create a Stripe PaymentIntent with the Order's ID in the metadata, so Stripe now knows how much money to expect from the purchase.
  5. Then, update the Order to also contain the PaymentIntent's ID as a field.
  6. Returns the created Order and the client_secret from the PaymentIntent to the client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions