soat-fiap / FIAP.TechChallenge.ByteMeBurger

The FIAP.TechChallenge.ByteMeBurger project is a comprehensive solution for managing a burger ordering system. It includes multiple modules for domain logic, application services, API endpoints, and infrastructure. The project is designed to be scalable, maintainable, and secure, leveraging modern .NET practices and AWS services.
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Implement Payment Webhook #74

Closed italopessoa closed 1 month ago

italopessoa commented 4 months ago

Create a webhook endpoint that receives payment confirmation from the provider (e.g., Mercado Pago).

check the discussion for more details https://github.com/soat-fiap/FIAP.TechChallenge.ByteMeBurger/discussions/90

italopessoa commented 3 months ago

@coderabbitai create mermaid sequenceDiagram graph

coderabbitai[bot] commented 3 months ago

[!TIP] For best results, initiate chat on the files or code changes.

sequenceDiagram
    participant Webhook as Webhook Endpoint
    participant MercadoPago as MercadoPago Gateway
    participant PaymentRepo as Payment Repository
    participant OrderStatusUC as UpdateOrderStatusUseCase

    Webhook->>+MercadoPago: Receive payment confirmation
    MercadoPago->>+PaymentRepo: GetPaymentStatus()
    PaymentRepo->>+PaymentRepo: UpdatePayment()
    PaymentRepo->>+OrderStatusUC: Payment approved?
    alt Payment is approved
        OrderStatusUC->>+OrderStatusUC: UpdateOrderStatus()
    end
    OrderStatusUC-->>-Webhook: Finish update

@italopessoa Here's the Mermaid sequence diagram for the webhook implementation process as described in the PR objectives. This diagram visualizes the interactions between the webhook endpoint, MercadoPago gateway, payment repository, and the order status update use case. Let me know if there are any adjustments or additional details you'd like to include!