Access Packages
Overview
The Admin Access Packages page manages all subscription and purchase packages on the platform. This is where administrators configure what users can buy, including site VIP subscriptions, token bundles, and creator subscription templates. The page integrates with multiple payment providers and dynamically loads provider-specific capabilities.
Key capabilities include:
- Create and manage subscription packages with initial and recurring pricing
- Configure token bundles for one-time purchases
- Set up creator subscription package templates
- Map packages to external payment provider IDs
- Enable/disable packages without deletion
- Duplicate packages for quick variations
- View package usage and subscription counts
- Dynamic provider capability detection
System Requirements
PHP Requirements
PHP Extensions Required
mysqli- Database connectivityjson- JSON encoding for configurationssession- Session management for CSRF protection
PHP Settings
session.autostart = Off
date.timezone = Your/Timezone
Features & UI Elements
Page Header
[Screenshot: access-packages-header]
The page header displays:
- Title: "Access Packages"
- Icon:
fa-box(package icon) - Breadcrumb: Dashboard / Billing / Access Packages
Alert Messages
Success and error messages appear below the header:
- Success (green): "Package created successfully", "Package updated successfully"
- Error (red): "Invalid security token", "Package not found"
Navigation Tabs
[Screenshot: access-packages-tabs]
Three tabs organize packages by type:
Packages Table
[Screenshot: access-packages-table]
Each tab displays a table of packages:
Status Badges:
Add Package Form
[Screenshot: access-packages-form]
A form to create or edit packages:
Basic Information:
Pricing & Duration (Site VIP):
Token Packages:
Creator Subscription:
Additional Options:
Provider Capabilities
[Screenshot: access-packages-provider-capabilities]
When selecting a provider, the form dynamically shows:
- Whether provider supports recurring billing
- Whether provider supports token purchases
- Provider-specific external ID requirements
- Available currency options
getCapabilities() method.
Bulk Actions
At the bottom of each package table:
- Activate Selected - Enable multiple packages
- Deactivate Selected - Disable multiple packages
- Delete Selected - Remove multiple packages (with confirmation)
Step-by-Step Usage
Creating a Site VIP Package
- Navigate to Admin Panel → Billing → Access Packages
- Ensure the Site VIP Packages tab is selected
- Click Add Package button
- Fill in the form:
Example VIP Monthly:
- Provider: Select your payment provider
- External ID: Enter the package ID from your provider
- Title: "VIP Monthly"
- Description: "Full access to all premium content"
- Initial Price: 29.99
- Rebill Price: 29.99
- Initial Duration: 30
- Rebill Duration: 30
- Featured: Check if this is your main offer
- Active: Check to make available
- Click Save Package
Creating a Token Package
- Click the Token Packages tab
- Click Add Package
- Fill in the form:
Example 100 Token Bundle:
- Provider: Select your payment provider
- External ID: Provider's token package ID
- Title: "100 Tokens"
- Description: "Get 100 tokens for tips and PPV"
- Price: 9.99
- Tokens: 100
- Active: Check
- Click Save Package
Suggested Token Bundles:
Creating a Creator Subscription Package
- Click the Creator Subscriptions tab
- Click the link to Manage Subscription Package Templates
- Create package templates first (see Creator Subscription Packages)
- Return to Access Packages
- Click Add Package
- Fill in the form:
- Provider: Select payment provider
- External ID: Provider's package ID
- Title: "Creator Basic Subscription"
- Package Tier: Select the template tier
- Initial Price: As defined in template
- Active: Check
- Click Save Package
Editing an Existing Package
- Find the package in the appropriate tab
- Click the Edit button (pencil icon)
- Form populates with current values
- Make desired changes
- Click Update Package
Duplicating a Package
- Find the package to duplicate
- Click the Duplicate button (copy icon)
- A new form opens with copied values
- Modify as needed (e.g., different price tier)
- Change the title to distinguish
- Click Save Package
Deactivating a Package
- Find the package in the table
- Click the status toggle (or Edit button)
- Uncheck the Active checkbox
- Save changes
Deleting a Package
- Find the package in the table
- Click the Delete button (trash icon)
- Confirm the deletion
Linking to External Provider Packages
Different providers have different requirements for External ID:
Stripe:
- External ID = Stripe Price ID (e.g.,
price1ABC123def) - Create products/prices in Stripe Dashboard first
PayPal:
- External ID = PayPal Plan ID (e.g.,
P-123456789) - Create billing plans in PayPal Dashboard
CCBill:
- External ID = CCBill Subaccount:Form (e.g.,
0000000000:0000) - Configure forms in CCBill Admin
Epoch:
- External ID = Epoch PI Code
- Get from Epoch merchant panel
Best Practices
Package Strategy
- Tiered Pricing:
- Offer 3 subscription options (Basic, Standard, Premium)
- Sweet spot pricing usually in the middle tier
- Feature one package as "Most Popular"
- Token Bundles:
- Minimum 4 bundle sizes
- Clear value increase at higher tiers
- Never let per-token cost increase with quantity
- Trial Offers:
- Consider 3-7 day trials at reduced price
- Set trial price > $0 to qualify customers
- Auto-convert to full price after trial
Provider Management
- Multiple Providers:
- Offer 2-3 payment options
- Different providers for different regions
- Backup if one provider has issues
- External ID Accuracy:
- Double-check external IDs with provider
- Test purchases before going live
- Document ID mappings
Pricing Guidelines
Troubleshooting
Common Issues
Package Not Appearing to Users
Cause: Package is inactive or provider issue
Solutions:
- Verify Active checkbox is checked
- Confirm provider is also active
- Check displayorder isn't hidden
- Verify packagetype matches display location
- Clear any caching
External ID Mismatch
Cause: ID doesn't match provider's system
Solutions:
- Log into provider dashboard
- Verify exact package/plan ID
- Check for copy/paste errors (extra spaces)
- Ensure correct environment (sandbox vs production)
Payment Fails with Valid Package
Cause: Provider-side configuration issue
Solutions:
- Check billing logs for error details
- Verify external ID is active in provider
- Test in provider's sandbox first
- Confirm currency matches provider settings
- Check processor class is handling correctly
Subscribers Count Not Updating
Cause: Subscription table not being updated
Solutions:
- Check tblUserSubscriptions for records
- Verify webhook is creating subscriptions
- Check packageid matches in transactions
- Review billing logs for webhook errors
Database Issues
Orphaned Packages
Cause: Provider deleted but packages reference it
Solution:
-- Find orphaned packages
SELECT p. FROM tblAccessPackages p
LEFT JOIN tblPaymentProviders pp ON p.providerid = pp.internalproviderid
WHERE pp.internalproviderid IS NULL;
-- Either reassign or delete:
UPDATE tblAccessPackages SET isactive = 0
WHERE providerid NOT IN (SELECT internalproviderid FROM tblPaymentProviders);
Duplicate External IDs
Cause: Same external ID used for multiple packages
Solution:
-- Find duplicates
SELECT externalid, providerid, COUNT() as count
FROM tblAccessPackages
WHERE externalid IS NOT NULL
GROUP BY externalid, providerid
HAVING count > 1;
-- Deactivate duplicates (keep newest)
-- Review manually to decide which to keep
Security Considerations
CSRF Protection
All form submissions include CSRF token validation:
if ($POST['csrftoken'] !== $SESSION['admincsrftoken']) {
die('Invalid security token');
}
Input Validation
- Prices validated as positive decimals
- Durations validated as positive integers
- External IDs sanitized to prevent injection
- Provider IDs verified against database
Price Manipulation Prevention
- Prices stored in database, not client-side
- Frontend displays only, backend calculates
- Webhooks verify amounts match expected
Translatable Strings
{
"accesspackagestitle": "Access Packages",
"accesspackagesbreadcrumb": "Dashboard / Billing / Access Packages",
"accesspackagestabvip": "Site VIP Packages",
"accesspackagestabtokens": "Token Packages",
"accesspackagestabcreator": "Creator Subscriptions",
"accesspackagesadd": "Add Package",
"accesspackagesedit": "Edit Package",
"accesspackagestableid": "ID",
"accesspackagestableprovider": "Provider",
"accesspackagestableexternalid": "External ID",
"accesspackagestabletitle": "Title",
"accesspackagestableprice": "Price",
"accesspackagestableduration": "Duration",
"accesspackagestabletokens": "Tokens",
"accesspackagestablestatus": "Status",
"accesspackagestablesubscribers": "Subscribers",
"accesspackagestableactions": "Actions",
"accesspackagesformprovider": "Payment Provider",
"accesspackagesformexternalid": "External ID",
"accesspackagesformtitle": "Title",
"accesspackagesformdescription": "Description",
"accesspackagesformpriceinitial": "Initial Price",
"accesspackagesformpricerebill": "Rebill Price",
"accesspackagesformdurationinitial": "Initial Duration (days)",
"accesspackagesformdurationrebill": "Rebill Duration (days)",
"accesspackagesformtokens": "Tokens",
"accesspackagesformpackagetier": "Package Tier",
"accesspackagesformtrialperiod": "Trial Period (days)",
"accesspackagesformtrialprice": "Trial Price",
"accesspackagesformcurrency": "Currency",
"accesspackagesformfeatured": "Featured",
"accesspackagesformdisplayorder": "Display Order",
"accesspackagesformactive": "Active",
"accesspackagesformsave": "Save Package",
"accesspackagesformupdate": "Update Package",
"accesspackagesformcancel": "Cancel",
"accesspackagesstatusactive": "Active",
"accesspackagesstatusinactive": "Inactive",
"accesspackagesduplicate": "Duplicate",
"accesspackagesdelete": "Delete",
"accesspackagesdeleteconfirm": "Are you sure you want to delete this package?",
"accesspackagescreatedsuccess": "Package created successfully",
"accesspackagesupdatedsuccess": "Package updated successfully",
"accesspackagesdeletedsuccess": "Package deleted successfully",
"accesspackagesduplicatedsuccess": "Package duplicated successfully",
"accesspackageserrorcsrf": "Invalid security token",
"accesspackageserrornotfound": "Package not found",
"accesspackageserrorrequired": "Title and provider are required",
"accesspackagesnopackages": "No packages found",
"accesspackagesmanagetemplates": "Manage Subscription Package Templates",
"accesspackagesproviderselect": "Select Provider",
"accesspackagestierselect": "Select Package Tier",
"accesspackagesdays": "days",
"accesspackagesinitial": "Initial",
"accesspackagesrebill": "Rebill"
}
Related Documentation
- Payment Providers - Payment provider configuration
- Billing Transactions - Transaction management
- Creator Subscription Packages - Creator package templates
- Billing Logs - Payment processor logs