handler

package
v0.0.0-...-94cb825 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(paymentManager *gopay.PaymentManager, fileStorage fileStorage) Handler

func (Handler) AllPayment

func (h Handler) AllPayment(c echo.Context) error

AllPayment gets all payment statuses @Summary Get all payment statuses @Description Get statuses for all payments @Tags payments @Produce json @Success 200 {object} allPaymentResponse @Failure 500 {string} string "Internal server error" @Router /payments [get]

func (Handler) Checkout

func (h Handler) Checkout(c echo.Context) error

Checkout updates payment status @Summary Update payment status @Description Update payment status according to payment provider webhook data @Tags payments @Accept json @Param request body checkoutRequest true "Checkout request" @Success 200 "Payment status updated" @Failure 400 {string} string "Invalid request" @Failure 500 {string} string "Internal server error" @Router /checkout [post]

func (Handler) File

func (h Handler) File(c echo.Context) error

File gets file by ID @Summary Get file by ID @Description Get pdf-file content from MinIO by file ID @Description NOTE: Swagger UI does not support viewing pdf files @Tags files @Produce application/pdf @Param id path string true "File ID" @Success 200 {file} binary "File content" @Failure 400 {string} string "Invalid ID" @Failure 500 {string} string "Internal server error" @Router /files/{id} [get]

func (Handler) GetPayment

func (h Handler) GetPayment(c echo.Context) error

GetPayment gets payment status by ID @Summary Get payment status by ID @Description Get status for specific payment @Tags payments @Produce plain @Param id path string true "Payment ID" @Success 200 {string} string "Payment status" @Failure 400 {string} string "Invalid ID" @Failure 500 {string} string "Internal server error" @Router /payments/{id} [get]

func (Handler) NewPayment

func (h Handler) NewPayment(c echo.Context) error

NewPayment creates a new payment @Summary Create a new payment @Description Create a new payment and get payment link @Tags payments @Accept json @Produce plain @Param request body newPaymentRequest true "Payment creation request" @Success 200 {string} string "Payment link" @Failure 400 {string} string "Invalid request" @Failure 500 {string} string "Internal server error" @Router /payments [post]

func (Handler) Redirect

func (h Handler) Redirect(c echo.Context) error

Redirect redirects to payment/delivery page @Summary Redirect to payment/delivery page @Description Redirect to payment page or delivery page depends on payment status by payment ID @Description NOTE: Swagger UI does not support redirection to external resources like payment page @Tags payments, files @Param id path string true "Payment ID" @Success 307 "Redirect to payment/delivery page URL" @Failure 400 {string} string "Invalid ID" @Failure 500 {string} string "Internal server error" @Router /{id} [get]

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL