Documentation
¶
Index ¶
Constants ¶
const ( Epay = "epay" AlipayF2f = "alipay_f2f" StripeAlipay = "stripe_alipay" StripeWeChatPay = "stripe_wechat_pay" Balance = "balance" )
const (
CloseOrderTimeMinutes = 15
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloseOrderLogic ¶
func NewCloseOrderLogic ¶
func NewCloseOrderLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CloseOrderLogic
NewCloseOrderLogic Close order
func (*CloseOrderLogic) CloseOrder ¶
func (l *CloseOrderLogic) CloseOrder(req *types.CloseOrderRequest) error
type PreCreateOrderLogic ¶
func NewPreCreateOrderLogic ¶
func NewPreCreateOrderLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PreCreateOrderLogic
NewPreCreateOrderLogic creates a new pre-create order logic instance for order preview operations. It initializes the logger with context and sets up the service context for database operations.
func (*PreCreateOrderLogic) PreCreateOrder ¶
func (l *PreCreateOrderLogic) PreCreateOrder(req *types.PurchaseOrderRequest) (resp *types.PreOrderResponse, err error)
PreCreateOrder calculates order pricing preview including discounts, coupons, gift amounts, and fees without actually creating an order. It validates subscription plans, coupons, and payment methods to provide accurate pricing information for the frontend order preview.
type PurchaseLogic ¶
func NewPurchaseLogic ¶
func NewPurchaseLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PurchaseLogic
NewPurchaseLogic creates a new purchase logic instance for subscription purchase operations. It initializes the logger with context and sets up the service context for database operations.
func (*PurchaseLogic) Purchase ¶
func (l *PurchaseLogic) Purchase(req *types.PurchaseOrderRequest) (resp *types.PurchaseOrderResponse, err error)
Purchase processes new subscription purchase orders including validation, discount calculation, coupon processing, gift amount deduction, fee calculation, and order creation with database transaction. It handles the complete purchase workflow from user validation to order creation and task scheduling.
type QueryOrderDetailLogic ¶
func NewQueryOrderDetailLogic ¶
func NewQueryOrderDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *QueryOrderDetailLogic
Get order
func (*QueryOrderDetailLogic) QueryOrderDetail ¶
func (l *QueryOrderDetailLogic) QueryOrderDetail(req *types.QueryOrderDetailRequest) (resp *types.OrderDetail, err error)
type QueryOrderListLogic ¶
func NewQueryOrderListLogic ¶
func NewQueryOrderListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *QueryOrderListLogic
Get order list
func (*QueryOrderListLogic) QueryOrderList ¶
func (l *QueryOrderListLogic) QueryOrderList(req *types.QueryOrderListRequest) (resp *types.QueryOrderListResponse, err error)
type RechargeLogic ¶
func NewRechargeLogic ¶
func NewRechargeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RechargeLogic
Recharge
func (*RechargeLogic) Recharge ¶
func (l *RechargeLogic) Recharge(req *types.RechargeOrderRequest) (resp *types.RechargeOrderResponse, err error)
type RenewalLogic ¶
func NewRenewalLogic ¶
func NewRenewalLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RenewalLogic
NewRenewalLogic creates a new renewal logic instance for subscription renewal operations
func (*RenewalLogic) Renewal ¶
func (l *RenewalLogic) Renewal(req *types.RenewalOrderRequest) (resp *types.RenewalOrderResponse, err error)
Renewal processes subscription renewal orders including discount calculation, coupon validation, gift amount deduction, fee calculation, and order creation
type ResetTrafficLogic ¶
func NewResetTrafficLogic ¶
func NewResetTrafficLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ResetTrafficLogic
Reset traffic
func (*ResetTrafficLogic) ResetTraffic ¶
func (l *ResetTrafficLogic) ResetTraffic(req *types.ResetTrafficOrderRequest) (resp *types.ResetTrafficOrderResponse, err error)