Rainbow E-Pay System (彩虹易支付系统)

repository·main·Indexed 19 days ago

https://github.com/maajiko/epay

An open-source payment gateway aggregator developed by Zhengzhou Zhuimeng Network Technology Co., Ltd. It provides a unified API and management backend to integrate multiple payment channels including Alipay, WeChat Pay, Tenpay, QQ Wallet, and UnionPay. Key features include RSA verification, risk control, plugin extensibility (such as Bepusdt for USDT TRC20), and an admin dashboard for real-time financial statistics and profit analysis.

Tokens
12.6K
Snippets
39
Records
56
Agent score
68%

What's inside Rainbow E-Pay System

  1. Overview of 彩虹易支付系统 (Rainbow E-Pay System)

    main
    彩虹易支付系统 (Rainbow E-Pay System) is an open-source, no-contract payment product developed by Zhengzhou Zhuimeng Network Technology Co., Ltd. It provides a one-stop integration for developers to connect multiple payment methods including Alipay, WeChat Pay, Tenpay, and QQ Wallet, enabling efficient payment integration.
  2. Key Features of 彩虹易支付系统

    main

    The system offers several core capabilities for payment management:

    • Multi-channel Payment Integration: Supports Alipay, WeChat Pay, Tenpay, QQ Wallet, WeChat WAP, UnionPay, and more.
    • Simplified Payment Solutions: Provides complete APIs to simplify the integration and deployment process.
    • Backend Management & Analytics: Includes tools for payment statistics, agency payment (代付) statistics, and profit analysis.
    • Security: Utilizes RSA public/private key verification, risk control detection, and blacklist management.
    • Plugin Extensibility: Supports a wide range of payment plugins for flexible expansion.
    • Mobile Optimization: Features a new mobile-optimized payment page for various mobile scenarios.
  3. Admin Dashboard Overview and Metrics

    main

    The dashboard provides a high-level overview of the system's health and financial performance through several key metrics:

    • Order Statistics: Total order count and today's success rate.
    • Merchant Statistics: Total number of registered merchants.
    • Financial Totals: Total system balance and total settlement amounts.
    • Income Breakdown: Tables showing income by Payment Method (e.g., Alipay, WeChat) and Payment Channel.
    • Profitability: A specific view for Payment Method Profit, which shows earnings after deducting channel costs.

    Note: Financial statistics (Balance, Settlement, and Income tables) are updated approximately every 1 hour.

  4. Access the payment template entrypoint

    main

    The template/index2/index.php file serves as a public-facing landing page template for the Rainbow Easy Pay system. It is a PHP-based entrypoint that renders the site's homepage, including navigation, service descriptions, and FAQ sections.

    Security Note: This file requires the constant IN_CRONLITE to be defined. If accessed directly without the proper environment context, the script will exit immediately to prevent unauthorized execution.

    Key Features Rendered:

    • Navigation: Links to User Registration (/user/reg.php), Login (/user/), Documentation (/doc.html), and Payment Testing (/user/test.php) if enabled.
    • FAQ System: An interactive help section that toggles visibility of answers via JavaScript.
    • Dynamic Content: Uses a $conf configuration array to populate site metadata (title, keywords, description, sitename, etc.).
    <?php
    if(!defined('IN_CRONLITE'))exit();
    ?>
    <!-- HTML Content follows -->
  5. Access configuration variables in payment templates

    main

    When developing or customizing payment templates in the epay system, you can access global configuration settings via the $conf associative array. These variables are injected into the template scope and allow you to dynamically display site-specific information.

    Commonly used keys in $conf include:

    • sitename: The name of the payment platform.
    • title: The HTML <title> of the page.
    • keywords: Meta keywords for SEO.
    • description: Meta description for SEO.
    • settle_rate: The settlement fee rate (e.g., 0.03 for 3%).
    • settle_money: The minimum amount required for automatic settlement.
    • settle_fee_min: The minimum withdrawal/settlement fee.
    • settle_fee_max: The maximum withdrawal/settlement fee.
    • kfqq: The Customer Service QQ number used for contact links.
    • test_open: A boolean flag to determine if the online testing link (/user/test.php) should be visible.
    • footer: Custom footer text.

    Additionally, the following global constants are available for path resolution:

    • STATIC_ROOT: The base path for local static assets (CSS, JS, Images).
    • cdnpublic: The base URL for assets served via a CDN.
    • IN_CRONLITE: A security constant. If this is not defined, the script will exit immediately to prevent direct access.
    <!-- Example of using configuration variables in a template -->
    <title><?php echo $conf['title']?></title>
    <p>Settlement rate is as low as <?php echo $conf['settle_rate']; ?>%!</p>
    <a href="https://wpa.qq.com/msgrd?v=3&uin=<?php echo $conf['kfqq']?>&site=pay">Contact Support</a>
  6. Security Requirement for Template Files

    main

    To prevent direct access to template files via a web browser, all template entrypoint files must check for the definition of the IN_CRONLITE constant. If this constant is not defined, the script will exit immediately.

    This ensures that templates are only rendered through the system's core controller/routing mechanism.

    <?php
    if(!defined('IN_CRONLITE'))exit();
    ?>
  7. Security requirement for template execution

    main

    To prevent direct unauthorized access to template files, the system checks for a specific constant. If this constant is not defined, the script will terminate immediately.

    if(!defined('IN_CRONLITE'))exit();

    Ensure that your entrypoint or controller defines IN_CRONLITE before including template files.

  8. View Settlement Statistics Chart

    main

    The dashboard provides a visual representation of settlement amounts using a spline chart (likely via ui-jq or a similar plugin integration).

    Data Source: The chart data is generated server-side from the pre_settle table, selecting the last 9 settlement records for the current user.

    Chart Configuration:

    • Data Format: An array of coordinates [index, money].
    • Visuals: Uses splines with a tension of 0.4 and a fill opacity of 0.8.
    • Y-Axis: Scaled to max_settle + 10 to ensure visibility.
  9. API Catalog Structure

    main

    The documentation is organized into several functional modules. Developers can navigate to specific implementation details for each:

    • Interface Specifications (接口说明): General protocol rules and upgrade notes.
    • Signature Rules (签名规则): Detailed logic for generating RSA signatures.
    • Payment Methods (支付方式列表): List of supported payment channels.
    • Payment Related Interfaces (支付相关接口):
      • Page Jump Payment (页面跳转支付)
      • Unified Order Creation (统一下单接口)
      • Order Query (订单查询)
      • Payment Result Notification (支付结果通知)
      • Order Refund (订单退款)
      • Refund Query (订单退款查询)
      • Close Order (关闭订单)
    • Merchant Related Interfaces (商户相关接口):
      • Query Merchant Info (查询商户信息)
      • Query Order List (查询订单列表)
    • Transfer Related Interfaces (代付相关接口):
      • Initiate Transfer (转账发起)
      • Transfer Query (转账查询)
      • Query Available Balance (可用余额查询)
    • SDK Downloads (SDK下载)
  10. Access configuration variables in templates

    main

    When developing or customizing templates for the Rainbow E-pay system, you can access global configuration settings via the $conf associative array and system information via superglobals.

    Commonly used keys in $conf include:

    • $conf['title']: The page title.
    • $conf['keywords']: SEO keywords.
    • $conf['description']: SEO description.
    • $conf['sitename']: The name of the payment platform.
    • $conf['test_open']: Boolean flag to determine if the online testing link (/user/test.php) should be visible.
    • $conf['email']: Contact email.
    • $conf['kfqq']: Customer service QQ number.
    • $conf['hzlink1'], $conf['hzlink2']: Partner website links.
    • $conf['hzhb1'], $conf['hzhb2']: Partner website names.
    • $conf['footer']: Footer copyright or text.

    Other available variables:

    • $cdnpublic: Path to the CDN-hosted public assets.
    • $STATIC_ROOT: Path to the local static assets directory.
    • $_SERVER['HTTP_HOST']: The current domain name.
    • $_SERVER['HTTP_HOST']: The current domain name.
  11. Template security requirement

    main

    To prevent direct access to template files and ensure they are only rendered through the system's controlled lifecycle, all template files must define the IN_CRONLITE constant. If this constant is not defined, the script will exit immediately.

    <?php
    if(!defined('IN_CRONLITE'))exit();
    ?>
  12. Homepage Redirection Configurations

    main

    When the mod is set to index, the application behavior is governed by the $conf['homepage'] setting:

    • Value 1: Redirects the user immediately to the /user/ directory via JavaScript.
    • Value 2: Loads the URL specified in $conf['homepage_url'] within an HTML <frameset>.