package v1 import ( "quyun/v2/app/http/v1/dto" "quyun/v2/app/services" "github.com/gofiber/fiber/v3" ) // @provider type Transaction struct{} // Create Order // // @Router /v1/orders [post] // @Summary Create Order // @Description Create Order // @Tags Transaction // @Accept json // @Produce json // @Param form body dto.OrderCreateForm true "Create form" // @Success 200 {object} dto.OrderCreateResponse // @Bind form body func (t *Transaction) Create(ctx fiber.Ctx, form *dto.OrderCreateForm) (*dto.OrderCreateResponse, error) { return services.Order.Create(ctx.Context(), form) } // Pay for order // // @Router /v1/orders/:id/pay [post] // @Summary Pay for order // @Description Pay for order // @Tags Transaction // @Accept json // @Produce json // @Param id path string true "Order ID" // @Param form body dto.OrderPayForm true "Pay form" // @Success 200 {object} dto.OrderPayResponse // @Bind id path // @Bind form body func (t *Transaction) Pay(ctx fiber.Ctx, id string, form *dto.OrderPayForm) (*dto.OrderPayResponse, error) { return services.Order.Pay(ctx.Context(), id, form) } // Check order payment status // // @Router /v1/orders/:id/status [get] // @Summary Check order status // @Description Check order payment status // @Tags Transaction // @Accept json // @Produce json // @Param id path string true "Order ID" // @Success 200 {object} dto.OrderStatusResponse // @Bind id path func (t *Transaction) Status(ctx fiber.Ctx, id string) (*dto.OrderStatusResponse, error) { return services.Order.Status(ctx.Context(), id) }