feat(payment): add complete payment system with multi-provider support
Add a full payment and subscription system supporting EasyPay (Alipay/WeChat), Stripe, and direct Alipay/WeChat Pay providers with multi-instance load balancing.
This commit is contained in:
@@ -61,6 +61,8 @@ const (
|
||||
EdgeAttributeValues = "attribute_values"
|
||||
// EdgePromoCodeUsages holds the string denoting the promo_code_usages edge name in mutations.
|
||||
EdgePromoCodeUsages = "promo_code_usages"
|
||||
// EdgePaymentOrders holds the string denoting the payment_orders edge name in mutations.
|
||||
EdgePaymentOrders = "payment_orders"
|
||||
// EdgeUserAllowedGroups holds the string denoting the user_allowed_groups edge name in mutations.
|
||||
EdgeUserAllowedGroups = "user_allowed_groups"
|
||||
// Table holds the table name of the user in the database.
|
||||
@@ -126,6 +128,13 @@ const (
|
||||
PromoCodeUsagesInverseTable = "promo_code_usages"
|
||||
// PromoCodeUsagesColumn is the table column denoting the promo_code_usages relation/edge.
|
||||
PromoCodeUsagesColumn = "user_id"
|
||||
// PaymentOrdersTable is the table that holds the payment_orders relation/edge.
|
||||
PaymentOrdersTable = "payment_orders"
|
||||
// PaymentOrdersInverseTable is the table name for the PaymentOrder entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "paymentorder" package.
|
||||
PaymentOrdersInverseTable = "payment_orders"
|
||||
// PaymentOrdersColumn is the table column denoting the payment_orders relation/edge.
|
||||
PaymentOrdersColumn = "user_id"
|
||||
// UserAllowedGroupsTable is the table that holds the user_allowed_groups relation/edge.
|
||||
UserAllowedGroupsTable = "user_allowed_groups"
|
||||
// UserAllowedGroupsInverseTable is the table name for the UserAllowedGroup entity.
|
||||
@@ -414,6 +423,20 @@ func ByPromoCodeUsages(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
||||
}
|
||||
}
|
||||
|
||||
// ByPaymentOrdersCount orders the results by payment_orders count.
|
||||
func ByPaymentOrdersCount(opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborsCount(s, newPaymentOrdersStep(), opts...)
|
||||
}
|
||||
}
|
||||
|
||||
// ByPaymentOrders orders the results by payment_orders terms.
|
||||
func ByPaymentOrders(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
sqlgraph.OrderByNeighborTerms(s, newPaymentOrdersStep(), append([]sql.OrderTerm{term}, terms...)...)
|
||||
}
|
||||
}
|
||||
|
||||
// ByUserAllowedGroupsCount orders the results by user_allowed_groups count.
|
||||
func ByUserAllowedGroupsCount(opts ...sql.OrderTermOption) OrderOption {
|
||||
return func(s *sql.Selector) {
|
||||
@@ -490,6 +513,13 @@ func newPromoCodeUsagesStep() *sqlgraph.Step {
|
||||
sqlgraph.Edge(sqlgraph.O2M, false, PromoCodeUsagesTable, PromoCodeUsagesColumn),
|
||||
)
|
||||
}
|
||||
func newPaymentOrdersStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(PaymentOrdersInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.O2M, false, PaymentOrdersTable, PaymentOrdersColumn),
|
||||
)
|
||||
}
|
||||
func newUserAllowedGroupsStep() *sqlgraph.Step {
|
||||
return sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
|
||||
@@ -1067,6 +1067,29 @@ func HasPromoCodeUsagesWith(preds ...predicate.PromoCodeUsage) predicate.User {
|
||||
})
|
||||
}
|
||||
|
||||
// HasPaymentOrders applies the HasEdge predicate on the "payment_orders" edge.
|
||||
func HasPaymentOrders() predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.O2M, false, PaymentOrdersTable, PaymentOrdersColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasPaymentOrdersWith applies the HasEdge predicate on the "payment_orders" edge with a given conditions (other predicates).
|
||||
func HasPaymentOrdersWith(preds ...predicate.PaymentOrder) predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
step := newPaymentOrdersStep()
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// HasUserAllowedGroups applies the HasEdge predicate on the "user_allowed_groups" edge.
|
||||
func HasUserAllowedGroups() predicate.User {
|
||||
return predicate.User(func(s *sql.Selector) {
|
||||
|
||||
Reference in New Issue
Block a user