Payment System Documentation Index
Welcome to the NEXTY.DEV payment system documentation! This documentation provides a complete guide to using the payment system, from basic concepts to advanced features, helping you get started quickly and gain deep understanding.
Documentation Structure
The documentation follows a "top-down" structure, starting from an overall overview and gradually diving into specific functional modules.
Core Documentation
- System architecture introduction
- Core features description
- Database table structure
- Core module descriptions
- Payment flow overview
- Pricing plan data structure
- Creating and managing pricing plans
- Multi-language support
- Benefits configuration
- Payment provider configuration
- Complete payment flow explanation
- Checkout session creation
- Payment verification
- Error handling
- Security considerations
- Stripe Webhook handling
- Creem Webhook handling
- Event type descriptions
- Webhook testing and debugging
- Credit type descriptions
- Credit granting mechanism
- Credit usage and deduction
- Credit revocation
- Credit log queries
- Order queries and management
- Subscription status synchronization
- Customer portal usage
- Credit history queries
Quick Start
New User Guide
If you're using the NEXTY.DEV payment system for the first time, we recommend reading in the following order:
- Step 1: Read Payment System Overview to understand the overall architecture
- Step 2: Read Pricing Plan Management to learn how to create pricing plans
- Step 3: Read Payment Flow Details to understand the payment process
- Step 4: Read Webhook Handling Mechanism to learn about Webhook configuration
- Step 5: Read Credit System to learn credit management
- Step 6: Read Order and Subscription Management to master order and subscription management
Find by Need
I want to understand the system architecture
I want to create pricing plans
I want to understand the payment flow
I want to configure Webhooks
I want to manage the credit system
I want to query orders and subscriptions
→ Order and Subscription Management
Feature Capabilities
Supported Features
- Multiple payment providers (Stripe, Creem)
- One-time payments and subscription payments
- Monthly subscriptions and annual subscriptions
- Credit system (one-time credits and subscription credits)
- Multi-language support
- Coupons and discount codes
- Customer portal integration
- Automatic Webhook handling
- Order and subscription management
- Credit history queries
Environment Variable Configuration
Stripe
STRIPE_SECRET_KEY=sk_...
STRIPE_WEBHOOK_SECRET=whsec_...
STRIPE_CUSTOMER_PORTAL_URL=/dashboard/subscriptionCreem
CREEM_API_KEY=your_api_key
CREEM_WEBHOOK_SECRET=your_webhook_secret
CREEM_API_BASE_URL=https://api.creem.io/v1 # OptionalOther
NEXT_PUBLIC_PRICING_PATH=/pricing
NEXT_PUBLIC_SITE_URL=https://yourdomain.com
[email protected]Frequently Asked Questions
Q: How do I get started with the payment system?
A: First configure the environment variables, then create pricing plans, and finally configure Webhooks. Please refer to each documentation for detailed steps.
Q: Which payment providers are supported?
A: Currently supports two payment providers: Stripe and Creem.
Q: How do I test payment functionality?
A: Use the payment provider's test mode and configure Webhook forwarding. Please refer to Webhook Handling Mechanism for detailed instructions.
Q: How does the credit system work?
A: The credit system supports two types: one-time credits and subscription credits. Please refer to Credit System for detailed explanations.
Q: How do I manage user subscriptions?
A: Users can manage subscriptions through the customer portal, and administrators can query subscription status through the API. Please refer to Order and Subscription Management for detailed instructions.