stripe

package
v0.0.0-...-05ebe4c Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddStripeRoutes

func AddStripeRoutes(router *gin.RouterGroup, acctHandler gin.HandlerFunc, db *gorm.DB)

func CheckGiftcard

func CheckGiftcard(db *gorm.DB) gin.HandlerFunc

func CheckoutDeposit

func CheckoutDeposit(db *gorm.DB) gin.HandlerFunc

func CreateSession

func CreateSession(db *gorm.DB) gin.HandlerFunc

func DeleteManualDeposit

func DeleteManualDeposit(db *gorm.DB) gin.HandlerFunc

func GetDepositOrders

func GetDepositOrders(c *gin.Context)

func GetDeposits

func GetDeposits(db *gorm.DB) gin.HandlerFunc

func GetProducts

func GetProducts(db *gorm.DB, c *gin.Context)

func GetSession

func GetSession(db *gorm.DB) gin.HandlerFunc

func ListManualDeposits

func ListManualDeposits(db *gorm.DB) gin.HandlerFunc

func SaveManualDeposit

func SaveManualDeposit(db *gorm.DB) gin.HandlerFunc

func StripeWebhook

func StripeWebhook(db *gorm.DB) gin.HandlerFunc

Types

type CreateDepositCheckout

type CreateDepositCheckout struct {
	Date         string `json:"date"`
	Time         string `json:"time"`
	PriceID      string `json:"priceId"`
	TripLength   int    `json:"tripLength"`
	TripType     string `json:"tripType"`
	EstimatedPpl int    `json:"estimated"`
}

type CreateSessionRequest

type CreateSessionRequest struct {
	Type        string `json:"type,omitempty"`
	Items       []Item `json:"items"`
	Name        string `json:"name"`
	Email       string `json:"email"`
	Phone       string `json:"phone"`
	UseGiftCard string `json:"useGift"`
}

type DepositPrice

type DepositPrice struct {
	ID               uint   `json:"-"`
	StripeID         string `json:"id"`
	DepositProductID uint   `json:"-"`
	Product          string `json:"product"`
	NickName         string `json:"name"`
	UnitAmount       uint   `json:"amount"`
}

type DepositProduct

type DepositProduct struct {
	ID         uint              `json:"id" gorm:"primary_key;auto_increment;"`
	StripeID   string            `json:"stripeId"`
	MerchantID string            `json:"-" gorm:"type:varchar;not null;primary_key;"`
	Name       string            `json:"name"`
	Desc       string            `json:"desc"`
	Color      string            `json:"color"`
	Publish    bool              `json:"publish"`
	BoatID     uint              `json:"boatId"`
	Type       string            `json:"type"`
	Prices     []DepositPrice    `json:"prices"`
	Schedules  []DepositSchedule `json:"schedules"`
}

type DepositSchedule

type DepositSchedule struct {
	ID               uint           `json:"id"`
	DepositProductID uint           `json:"-"`
	Days             pq.Int64Array  `json:"days" gorm:"type:integer[]"`
	NotAvail         pq.StringArray `json:"notAvail,nilasempty" gorm:"type:text[]"`
	Start            string         `json:"start"`
	End              string         `json:"end"`
	Price            string         `json:"price"`
	Minimum          int            `json:"minimum"`
	Times            pq.StringArray `json:"times" gorm:"type:text[]"`
}

type DepositSearchResult

type DepositSearchResult struct {
	ID       string            `json:"id"`
	Desc     string            `json:"description"`
	Metadata map[string]string `json:"metadata"`
}

type Handler

type Handler struct{}

func (Handler) GetPassItems

func (h Handler) GetPassItems(config *types.MerchantConfig, db *gorm.DB, id string) ([]types.PassItem, string, string)

func (Handler) GetSoldTickets

func (h Handler) GetSoldTickets(config *types.MerchantConfig, db *gorm.DB, from, to string) (interface{}, error)

func (Handler) ManualEntry

func (h Handler) ManualEntry(config *types.MerchantConfig, db *gorm.DB, entry types.Manual) (interface{}, error)

func (Handler) OrdersTimestamp

func (h Handler) OrdersTimestamp(config *types.MerchantConfig, db *gorm.DB, timestamp string) (interface{}, error)

func (Handler) RedeemTickets

func (h Handler) RedeemTickets(config *types.MerchantConfig, db *gorm.DB, data json.RawMessage) (interface{}, error)

func (Handler) RefundTickets

func (h Handler) RefundTickets(config *types.MerchantConfig, db *gorm.DB, data json.RawMessage) (interface{}, error)

func (Handler) TransferTickets

func (h Handler) TransferTickets(_ *types.MerchantConfig, db *gorm.DB, data []types.TransferReq) (interface{}, error)

type Item

type Item struct {
	Name       string `json:"name"`
	UnitAmount Money  `json:"unit_amount"`
	Quantity   int    `json:"quantity,string"`
	Sku        string `json:"sku"`
	Desc       string `json:"description"`
}

type LineItem

type LineItem struct {
	ID        string `json:"id" gorm:"primary_key"`
	PaymentID string `json:"paymentId" gorm:"primary_key"`
	Acct      string `json:"-"`
	Quantity  int    `json:"quantity"`
	Sku       string `json:"sku"`
	Name      string `json:"name"`
	UnitPrice string `json:"unitPrice" gorm:"type:money"`
	Amount    string `json:"total" gorm:"type:money"`
	Status    string `json:"status"`
}

type ManualDeposit

type ManualDeposit struct {
	ID         int    `json:"id" gorm:"primary_key;auto_increment;"`
	MerchantID string `json:"-"`
	Date       string `json:"date"`
	Time       string `json:"time"`
	Length     uint   `json:"length"`
	Name       string `json:"name"`
	Email      string `json:"email"`
	Phone      string `json:"phone"`
}

type ManualPayerInfo

type ManualPayerInfo struct {
	ID    string `gorm:"primary_key"`
	Name  string
	Phone string
	Email string
}

type Money

type Money struct {
	CurrencyCode string  `json:"currency_code"`
	Value        float32 `json:"value,string"`
}

type PaymentIntent

type PaymentIntent struct {
	ID        string    `json:"id" gorm:"primary_key"`
	Acct      string    `json:"-" gorm:"primary_key"`
	CreatedAt time.Time `json:"createdAt"`
	Amount    string    `json:"amount" gorm:"type:money"`
	Email     string    `json:"email"`
	Name      string    `json:"name"`
	Status    string    `json:"status"`
}

type RefundInfo

type RefundInfo struct {
	PaymentIntentID string `json:"paymentId"`
	LineItemID      string `json:"itemId"`
}

type TicketRedemption

type TicketRedemption struct {
	GiftCard string `json:"giftcard"`
	Items    []Item `json:"items"`
	Name     string `json:"name"`
	Email    string `json:"email"`
	Phone    string `json:"phone"`
}

Jump to

Keyboard shortcuts

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