Documentation
¶
Index ¶
- type PaymentService
- func (svc *PaymentService) CheckOrderExist(ctx context.Context, orderID int64) (orderInfo bool, err error)
- func (svc *PaymentService) CheckRedisRateLimiting(ctx context.Context, uid int64, orderID int64) (frequencyInfo bool, timeInfo bool, err error)
- func (svc *PaymentService) CreatePaymentInfo(ctx context.Context, orderID int64) (paymentID int64, err error)
- func (svc *PaymentService) CreateRefundInfo(ctx context.Context, orderID int64) (refundID int64, err error)
- func (svc *PaymentService) GeneratePaymentToken(ctx context.Context, orderID int64) (string, int64, error)
- func (svc *PaymentService) GetPaymentStatusMsg(code int8) string
- func (svc *PaymentService) GetRefundStatusMsg(code int8) string
- func (svc *PaymentService) GetUserID(ctx context.Context) (uid int64, err error)
- func (svc *PaymentService) StorePaymentToken(ctx context.Context, token string, expTime int64, userID int64, orderID int64) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PaymentService ¶
type PaymentService struct {
// contains filtered or unexported fields
}
func NewPaymentService ¶
func NewPaymentService(db repository.PaymentDB, sf *utils.Snowflake, redis repository.PaymentRedis, rpc repository.PaymentRPC) *PaymentService
func (*PaymentService) CheckOrderExist ¶
func (svc *PaymentService) CheckOrderExist(ctx context.Context, orderID int64) (orderInfo bool, err error)
CheckOrderExist 检查订单是否存在(调用Order模块的接口)
func (*PaymentService) CheckRedisRateLimiting ¶
func (*PaymentService) CreatePaymentInfo ¶
func (svc *PaymentService) CreatePaymentInfo(ctx context.Context, orderID int64) (paymentID int64, err error)
CreatePaymentInfo sf可以生成id,详见user/domain/service/service.go
func (*PaymentService) CreateRefundInfo ¶
func (*PaymentService) GeneratePaymentToken ¶
func (svc *PaymentService) GeneratePaymentToken(ctx context.Context, orderID int64) (string, int64, error)
GeneratePaymentToken HMAC生成支付令牌
func (*PaymentService) GetPaymentStatusMsg ¶
func (svc *PaymentService) GetPaymentStatusMsg(code int8) string
func (*PaymentService) GetRefundStatusMsg ¶
func (svc *PaymentService) GetRefundStatusMsg(code int8) string
Click to show internal directories.
Click to hide internal directories.