payment

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PaymentConfig

type PaymentConfig struct {
	ID            int64
	Platform      string
	AppID         string
	PrivateKey    string
	PublicKey     string
	WebhookSecret string
	InvoiceName   string
	Sandbox       bool
	EPayPid       string
	EPayKey       string
	EPayURL       string
	NotifyURL     string
}

PaymentConfig 支付配置

type PaymentMethod

type PaymentMethod struct {
	ID          int64
	Name        string
	Platform    string
	Description string
	Icon        string
	FeeMode     int32
	FeePercent  int64
	FeeAmount   int64
}

PaymentMethod 支付方式

type PaymentRepo

type PaymentRepo interface {
	// GetAvailablePaymentMethods 获取可用支付方式
	GetAvailablePaymentMethods(ctx context.Context) ([]*PaymentMethod, error)
	// GetPaymentConfigByToken 根据token获取支付配置
	GetPaymentConfigByToken(ctx context.Context, token string) (*PaymentConfig, error)
	// ActivateOrder 激活订单(支付成功后调用)
	ActivateOrder(ctx context.Context, orderNo string, platform string, tradeNo string, amount int64) error
}

PaymentRepo Public Payment数据仓库接口

type PaymentUseCase

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

PaymentUseCase Public Payment用例

func NewPaymentUseCase

func NewPaymentUseCase(repo PaymentRepo, logger log.Logger) *PaymentUseCase

NewPaymentUseCase 创建Public Payment用例

func (*PaymentUseCase) AlipayNotify

func (uc *PaymentUseCase) AlipayNotify(ctx context.Context, token string, params url.Values) (bool, string, error)

AlipayNotify 处理支付宝回调

func (*PaymentUseCase) EPayNotify

func (uc *PaymentUseCase) EPayNotify(ctx context.Context, token string, params map[string]string) (bool, string, error)

EPayNotify 处理易支付回调

func (*PaymentUseCase) GetAvailablePaymentMethods

func (uc *PaymentUseCase) GetAvailablePaymentMethods(ctx context.Context) ([]*PaymentMethod, error)

GetAvailablePaymentMethods 获取可用支付方式

func (*PaymentUseCase) StripeNotify

func (uc *PaymentUseCase) StripeNotify(ctx context.Context, token string, payload []byte, signature string) (bool, error)

StripeNotify 处理Stripe回调

Jump to

Keyboard shortcuts

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