Menu

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

  1. Payment System Overview
  • System architecture introduction
  • Core features description
  • Database table structure
  • Core module descriptions
  • Payment flow overview
  1. Pricing Plan Management
  • Pricing plan data structure
  • Creating and managing pricing plans
  • Multi-language support
  • Benefits configuration
  • Payment provider configuration
  1. Payment Flow Details
  • Complete payment flow explanation
  • Checkout session creation
  • Payment verification
  • Error handling
  • Security considerations
  1. Webhook Handling Mechanism
  • Stripe Webhook handling
  • Creem Webhook handling
  • Event type descriptions
  • Webhook testing and debugging
  1. Credit System
  • Credit type descriptions
  • Credit granting mechanism
  • Credit usage and deduction
  • Credit revocation
  • Credit log queries
  1. Order and Subscription Management
  • 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:

  1. Step 1: Read Payment System Overview to understand the overall architecture
  2. Step 2: Read Pricing Plan Management to learn how to create pricing plans
  3. Step 3: Read Payment Flow Details to understand the payment process
  4. Step 4: Read Webhook Handling Mechanism to learn about Webhook configuration
  5. Step 5: Read Credit System to learn credit management
  6. Step 6: Read Order and Subscription Management to master order and subscription management

Find by Need

I want to understand the system architecture

Payment System Overview

I want to create pricing plans

Pricing Plan Management

I want to understand the payment flow

Payment Flow Details

I want to configure Webhooks

Webhook Handling Mechanism

I want to manage the credit system

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/subscription

Creem

CREEM_API_KEY=your_api_key
CREEM_WEBHOOK_SECRET=your_webhook_secret
CREEM_API_BASE_URL=https://api.creem.io/v1  # Optional

Other

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.