Skip to content

FiveD-SE/CoffeShopMangementBackend

Repository files navigation

CoffeeShopManagement Backend

This repository contains the backend code for the CoffeeShopManagement project.

Installation

  1. Clone the repository:
git clone https://github.com/FiveD-SE/CoffeShopMangementBackend.git
  1. Install dependencies:
npm install

Usage

  1. Start the server:
npm start
  1. Access the API endpoints at http://localhost:3000.

API Endpoints

Orders

  • POST /orders/create

    • Creates a new order.
    • Request Body:
      {
          "description": "string",
          "returnUrl": "string",
          "cancelUrl": "string",
          "amount": "number"
      }
    • Response Body:
      {
          "error": 0,
          "message": "Success",
          "data": {
              "bin": "string",
              "checkoutUrl": "string",
              "accountNumber": "string",
              "accountName": "string",
              "amount": "number",
              "description": "string",
              "orderCode": "number",
              "qrCode": "string"
          }
      }
  • GET /orders/:orderId

    • Retrieves an order by ID.
    • Response Body:
      {
          "error": 0,
          "message": "ok",
          "data": {
              // Order details
          }
      }
  • PUT /orders/:orderId

    • Cancels an order by ID.
    • Request Body:
      {
          "cancellationReason": "string"
      }
    • Response Body:
      {
          "error": 0,
          "message": "ok",
          "data": {
              // Order details
          }
      }
  • POST /orders/confirm-webhook

    • Confirms a webhook URL.
    • Request Body:
      {
          "webhookUrl": "string"
      }
    • Response Body:
      {
          "error": 0,
          "message": "ok",
          "data": null
      }

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published