pay

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDBDedupStore

func InitDBDedupStore(db *gorm.DB, ttl time.Duration)

func RegisterPayNotify

func RegisterPayNotify(engine *gin.Engine, manager *PaymentManager)

func RegisterPayNotifyWithBus

func RegisterPayNotifyWithBus(engine *gin.Engine, manager *PaymentManager, bus EventBus.Bus)

func SetDedupStore

func SetDedupStore(store DedupStore)

Types

type DedupEntry

type DedupEntry struct {
	Key       string `gorm:"primaryKey;size:128"`
	CreatedAt time.Time
}

type DedupStore

type DedupStore interface {
	IsDuplicate(key string) bool
	MarkKey(key string)
}

func NewMemoryDedupStore

func NewMemoryDedupStore(ttl time.Duration) DedupStore

type Options

type Options struct {
	Default  string            `json:"default"`
	Alipay   payc.AlipayConfig `json:"alipay"`
	Wechat   payc.WechatConfig `json:"wechat"`
	Card     payc.CardConfig   `json:"card"`
	DedupTTL int               `json:"dedup_ttl"`
}

type PayServiceProvider

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

func (*PayServiceProvider) Boot

func (p *PayServiceProvider) Boot(ctx context.Context) error

func (*PayServiceProvider) Conf

func (p *PayServiceProvider) Conf() map[string]string

func (*PayServiceProvider) Description

func (p *PayServiceProvider) Description() string

func (*PayServiceProvider) Register

func (p *PayServiceProvider) Register(ctx context.Context) error

func (*PayServiceProvider) SetApplication

func (p *PayServiceProvider) SetApplication(app foundation.Application)

type PaymentManager

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

func NewPaymentManager

func NewPaymentManager() *PaymentManager

func (*PaymentManager) AddDriver

func (m *PaymentManager) AddDriver(name string, d payc.PayDriver)

func (*PaymentManager) Capture

func (*PaymentManager) Close

func (m *PaymentManager) Close(ctx context.Context, req *payc.CloseRequest) error

func (*PaymentManager) Create

func (*PaymentManager) CreateCombined

func (*PaymentManager) Default

func (m *PaymentManager) Default() (payc.PayDriver, error)

func (*PaymentManager) GetDriver

func (m *PaymentManager) GetDriver(name string) (payc.PayDriver, error)

func (*PaymentManager) ProfitShare

func (*PaymentManager) Query

func (*PaymentManager) Refund

func (*PaymentManager) SetDefaultDriver

func (m *PaymentManager) SetDefaultDriver(name string) error

func (*PaymentManager) Use

func (m *PaymentManager) Use(name string) (payc.PayDriver, error)

Source Files

  • dedup_db.go
  • dedup_store.go
  • notify.go
  • pay.go
  • pay_service_provider.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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