checkout

package
v1.36.3 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 63 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FailedToCreateCustomer       = errors.New("Failed to create customer")
	FailedToCreateUser           = errors.New("Failed to create user")
	FailedToDecodeRequestBody    = errors.New("Failed to decode request body")
	FailedToReserveItem          = errors.New("Item already reserved")
	FeeCalculationError          = errors.New("Failed to calculate fees")
	FundingAccountCreationError  = errors.New("Failed to create funding account")
	InvalidOrIncompleteOrder     = errors.New("Invalid or incomplete order")
	OnlyOneOfUserBuyerAllowed    = errors.New("Only one of user buyer allowed")
	OrderDoesNotExist            = errors.New("Order does not exist")
	PaymentCancelled             = errors.New("Payment was cancelled")
	TokenSaleNotFound            = errors.New("Token sale not found")
	TransactionLimitReached      = errors.New("Transaction Amount May Not Exceed Limit of 5000000")
	UnsupportedBitcoinCurrency   = errors.New("BTC/XBT is supported for 'bitcoin' payment method")
	UnsupportedEthereumCurrency  = errors.New("Only ETH is supported for 'ethereum' payment method")
	UnsupportedPaymentType       = errors.New("Unsupported payment type")
	UnsupportedStripeCurrency    = errors.New("XBT(BTC), ETH not supported by 'stripe' payment method")
	UserDoesNotExist             = errors.New("User does not exist")
	UserNotProvided              = errors.New("None of user, user.id, order.userId is set")
	WalletCreationError          = errors.New("Failed to create wallet for user")
	MissingTokenSaleOrPassphrase = errors.New("order.tokenSaleId or tokenSale.passphrase is missing")
	OrderTotalIsLessThan1        = errors.New("order.total is less than 1")
	AuthorizationFailed          = errors.New("Failed to authorize")
)

Functions

func Authorize

func Authorize(c *gin.Context)

func Cancel

func Cancel(c *gin.Context)

func Capture

func Capture(c *gin.Context)

func Charge

func Charge(c *gin.Context)

func Confirm

func Confirm(c *gin.Context)

func Refund

func Refund(c *gin.Context)

func Route

func Route(router router.Router, args ...gin.HandlerFunc)

func Sessions

func Sessions(c *gin.Context)

Sessions creates a provider-agnostic, Stripe-like hosted checkout session.

Currently implemented using Square Payment Links (hosted checkout URL). When providerHint is "wire", returns wire transfer instructions instead.

Types

type Authorization

type Authorization struct {
	User      *user.User       `json:"user"`
	Payment   *payment.Payment `json:"payment"`
	Order     *order.Order     `json:"order"`
	TokenSale *TokenSale       `json:"tokenSale"`
}

func (*Authorization) Init

func (a *Authorization) Init(db *datastore.Datastore) error

type TokenSale

type TokenSale struct {
	Passphrase string `json:"passphrase"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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