hngprojects / hng_boilerplate_nestjs

Description
Apache License 2.0
181 stars 105 forks source link

[FEAT]:Checkout Process - Backend #33

Closed King-Mikaelson closed 2 weeks ago

King-Mikaelson commented 1 month ago

Description

Develop an endpoint to handle the checkout process, including payment processing

Acceptance Criteria

Automated Checkout System:

Purpose

To allow users to complete their purchases securely and efficiently.

Requirements

Payment Handling

Expected Outcome

  1. The backend should handle plan purchases securely and efficiently.
  2. The system should log transactions and handle errors appropriately.

Endpoints

Checkout Process:

Description: Process the checkout and payment for the selected plan. Endpoint: POST /api/checkout Request Body: json

{
  "userId": "String",
  "planId": "String",
  "paymentDetails": {
    "cardNumber": "String",
    "expiryDate": "String",
    "cvv": "String"
  }
}

Response (Success): json

{
  "message": "Payment successful. Plan activated.",
  "transactionId": "String"
}

Response (Error): json

{
  "message": "Payment failed",
  "statusCode": 400
}

Tasks

Testing

  1. Write unit tests for the POST /api/checkout endpoint.
  2. Write unit tests for validation and error handling logic.
  3. Write integration tests for the end-to-end checkout process.
  4. Test integration with the payment gateway.
  5. Perform security testing to ensure compliance and data protection.
  6. Test encryption and secure storage of sensitive data.
  7. Test the full flow from plan selection to payment completion.
  8. Ensure the system handles successful and failed transactions appropriately.
markessien commented 1 month ago

Too broad

markessien commented 1 month ago

This is too broad!