Documentation ¶
Index ¶
- Constants
- func CreateCartPurchase(w http.ResponseWriter, r *http.Request)
- func CreateProductPurchase(w http.ResponseWriter, r *http.Request)
- func ListPurchases(w http.ResponseWriter, r *http.Request)
- func ReceiveMercadoPagoNotification(w http.ResponseWriter, r *http.Request)
- type Pack
- type Payment
- type Purchase
- type PurchaseStatus
- type Usecases
- func (u Usecases) BuyCart(userId string) (*Purchase, error)
- func (u Usecases) BuyProduct(userId, productSku string) (*Purchase, error)
- func (u Usecases) GetPurchases(userId string, page int) (responses.PaginatedResponse, error)
- func (u Usecases) ReceiveMercadoPagoNotification(topic, id string) error
Constants ¶
View Source
const ( CREATED = "CREATED" WAITING_PAYMENT = "WAITING_PAYMENT" COMPLETED = "COMPLETED" DOCUMENTED = "DOCUMENTED" PAYMENT_REJECTED = "PAYMENT_REJECTED" CANCELLED = "CANCELLED" )
Variables ¶
This section is empty.
Functions ¶
func CreateCartPurchase ¶
func CreateCartPurchase(w http.ResponseWriter, r *http.Request)
func CreateProductPurchase ¶
func CreateProductPurchase(w http.ResponseWriter, r *http.Request)
func ListPurchases ¶
func ListPurchases(w http.ResponseWriter, r *http.Request)
func ReceiveMercadoPagoNotification ¶
func ReceiveMercadoPagoNotification(w http.ResponseWriter, r *http.Request)
Types ¶
type Purchase ¶
type Purchase struct { ID string `json:"id" gorm:"primaryKey"` UserID string `json:"userId"` Amount float64 `json:"amount"` Status string `json:"status"` Payment Payment `json:"payment" gorm:"foreignkey:PurchaseID"` Packs []Pack `json:"packs" gorm:"foreignkey:PurchaseID"` InvoiceID string `json:"invoiceId"` CreatedAt time.Time `json:"createdAt" gorm:"autoUpdateTime"` UpdatedAt time.Time `json:"updatedAt" gorm:"autoCreateTime"` }
type PurchaseStatus ¶
type PurchaseStatus string
type Usecases ¶
type Usecases struct{}
func (Usecases) BuyProduct ¶
func (Usecases) GetPurchases ¶
func (Usecases) ReceiveMercadoPagoNotification ¶
Click to show internal directories.
Click to hide internal directories.