All checks were successful
Build and Release / Create Release (push) Successful in 0s
Build and Release / Unit Tests (push) Successful in 3m10s
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 5m13s
Build and Release / Lint (push) Successful in 5m25s
Build and Release / Build Binaries (amd64, linux, linux-latest) (push) Successful in 3m13s
Build and Release / Build Binaries (amd64, windows, windows-latest) (push) Successful in 8h5m42s
Build and Release / Build Binaries (amd64, darwin, macos) (push) Successful in 7m30s
Build and Release / Build Binaries (arm64, darwin, macos) (push) Successful in 7m55s
Build and Release / Build Binary (linux/arm64) (push) Successful in 7m36s
Implement complete subscription monetization system for repositories with Stripe and PayPal integration. Includes: - Database models and migrations for monetization settings, subscription products, and user subscriptions - Payment provider abstraction layer with Stripe and PayPal implementations - Admin UI for configuring payment providers and viewing subscriptions - Repository settings UI for managing subscription products and tiers - Subscription checkout flow and webhook handlers for payment events - Access control to gate repository code behind active subscriptions
30 lines
1.0 KiB
Go
30 lines
1.0 KiB
Go
// Copyright 2026 MarketAlly. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package v1_26
|
|
|
|
import (
|
|
"code.gitcaddy.com/server/v3/modules/timeutil"
|
|
|
|
"xorm.io/xorm"
|
|
)
|
|
|
|
// CreateRepoSubscriptionProductTable stores per-repo subscription products.
|
|
func CreateRepoSubscriptionProductTable(x *xorm.Engine) error {
|
|
type RepoSubscriptionProduct struct {
|
|
ID int64 `xorm:"pk autoincr"`
|
|
RepoID int64 `xorm:"INDEX NOT NULL"`
|
|
Name string `xorm:"VARCHAR(255) NOT NULL"`
|
|
Type int `xorm:"NOT NULL"`
|
|
PriceCents int64 `xorm:"NOT NULL"`
|
|
Currency string `xorm:"VARCHAR(3) NOT NULL DEFAULT 'USD'"`
|
|
StripePriceID string `xorm:"VARCHAR(255)"`
|
|
PayPalPlanID string `xorm:"VARCHAR(255)"`
|
|
IsActive bool `xorm:"NOT NULL DEFAULT true"`
|
|
CreatedUnix timeutil.TimeStamp `xorm:"created"`
|
|
UpdatedUnix timeutil.TimeStamp `xorm:"updated"`
|
|
}
|
|
|
|
return x.Sync(new(RepoSubscriptionProduct))
|
|
}
|