feat: notify supplier and client after payment is done

This commit is contained in:
2023-07-19 21:01:35 +02:00
parent b426a36570
commit e80e75cb8c
9 changed files with 161 additions and 39 deletions

View File

@@ -25,10 +25,11 @@ func NewOrderHandler(walletAddress string, orderSrv *services.Order, conversor *
}
type orderReq struct {
OrderID string `json:"order_id"`
ClientID string `json:"client_id"`
Amount float64 `json:"amount"`
Currency domain.FiatCurrency `json:"currency"`
OrderID string `json:"order_id"`
ClientID string `json:"client_id"`
Amount float64 `json:"amount"`
Currency domain.FiatCurrency `json:"currency"`
ClientEmail string `json:"client_email"`
}
func (hdl *OrderHandler) Post(c *fiber.Ctx) error {
@@ -42,7 +43,7 @@ func (hdl *OrderHandler) Post(c *fiber.Ctx) error {
return RenderError(c, fmt.Errorf("hdl.conversor.UsdToBtc %w", err), "")
}
order, err := hdl.orderSrv.NewOrder(c.Context(), req.OrderID, req.ClientID, btcAmount)
order, err := hdl.orderSrv.NewOrder(c.Context(), req.OrderID, req.ClientID, req.ClientEmail, btcAmount)
if err != nil {
return RenderError(c, fmt.Errorf("hdl.orderSrv.NewOrder %w", err), "")
}