对接流程图

以下流程图展示了第三方系统与 PayAll 平台的完整对接流程:

flowchart LR
    subgraph Phase1["🔧 阶段一:商户接入准备"]
        direction TB
        A1[📝 申请商户账号<br/>联系PayAll商务团队] 
        A2[🔑 获取密钥对<br/>RSA2048公钥/私钥]
        A3[⚙️ 配置商户信息<br/>source、callback_url]
        A1 --> A2 --> A3
    end
    
    subgraph Phase2["🔐 阶段二:用户认证"]
        direction TB
        B1[👤 用户登录<br/>调用 /thirdPartyLogin<br/>使用私钥签名]
        B2{Token有效?}
        B1 --> B2
        B2 -->|无效| B1
    end
    
    subgraph Phase3["💳 阶段三:卡片申请"]
        direction TB
        C1[📋 获取卡片列表<br/>调用 /merchant/cards]
        C2[✅ 检查可申请性<br/>调用 /cards/checkCanApply]
        C3{可以申请?}
        C4[📝 申请卡片<br/>调用 /cards/binding]
        C1 --> C2 --> C3
        C3 -->|否| C1
        C3 -->|是| C4
    end
    
    subgraph Phase4["💰 阶段四:开卡/充值"]
        direction TB
        D1[💵 查询费率<br/>调用 /cards/feeQuote]
        D2[📦 预充值<br/>调用 /charge/preCharge<br/>获取 order_id]
        D3[📱 获取充值地址<br/>调用 /charge/getChargeQrCode<br/>获取二维码]
        D1 --> D2 --> D3
    end
    
    subgraph Phase5["🌐 阶段五:用户转账"]
        direction TB
        E1{选择转账方式}
        E2[📷 二维码扫描转账]
        E3[🔌 插件钱包转账<br/>上传交易Hash]
        E4[⏳ 等待区块链确认]
        E1 -->|方式一| E2
        E1 -->|方式二| E3
        E2 --> E4
        E3 --> E4
    end
    
    subgraph Phase6["📞 阶段六:回调通知"]
        direction TB
        F1[📨 PayAll推送回调<br/>POST到 callback_url<br/>携带签名]
        F2{验证签名}
        F3[✅ 处理业务逻辑<br/>更新订单状态]
        F4[❌ 拒绝回调]
        F1 --> F2
        F2 -->|成功| F3
        F2 -->|失败| F4
    end
    
    subgraph Phase7["🔍 阶段七:状态查询"]
        direction TB
        G1[📊 查询订单状态<br/>调用 /getRecordDetail<br/>验证处理结果]
        G2[✨ 完成]
        G1 --> G2
    end
    
    Phase1 --> Phase2
    Phase2 --> Phase3
    Phase3 --> Phase4
    Phase4 --> Phase5
    Phase5 --> Phase6
    Phase6 --> Phase7
    
    style Phase1 fill:#e3f2fd,stroke:#1976d2,stroke-width:3px
    style Phase2 fill:#f3e5f5,stroke:#7b1fa2,stroke-width:3px
    style Phase3 fill:#e8f5e9,stroke:#388e3c,stroke-width:3px
    style Phase4 fill:#fff3e0,stroke:#f57c00,stroke-width:3px
    style Phase5 fill:#fce4ec,stroke:#c2185b,stroke-width:3px
    style Phase6 fill:#fff9c4,stroke:#f9a825,stroke-width:3px
    style Phase7 fill:#e0f2f1,stroke:#00796b,stroke-width:3px
    
    style A1 fill:#bbdefb
    style A2 fill:#90caf9
    style A3 fill:#64b5f6
    style B1 fill:#ce93d8
    style B2 fill:#ba68c8
    style C1 fill:#a5d6a7
    style C2 fill:#81c784
    style C3 fill:#66bb6a
    style C4 fill:#4caf50
    style D1 fill:#ffe0b2
    style D2 fill:#ffcc80
    style D3 fill:#ffb74d
    style E1 fill:#f8bbd0
    style E2 fill:#f48fb1
    style E3 fill:#f06292
    style E4 fill:#ec407a
    style F1 fill:#fff59d
    style F2 fill:#fff176
    style F3 fill:#ffeb3b
    style F4 fill:#ffc107
    style G1 fill:#b2dfdb
    style G2 fill:#80cbc4

流程图说明

阶段一:商户接入准备(步骤1-3)

  • 申请商户账号并获取密钥对

  • 配置商户信息和回调地址

阶段二:用户认证(步骤4)

  • 使用商户私钥签名,调用登录接口获取用户Token

  • 后续所有API调用都需要携带此Token

阶段三:卡片申请流程(步骤5-7)

  • 查询可申请的卡片列表

  • 检查卡片申请条件

  • 申请并绑定卡片

阶段四:开卡/充值流程(步骤8-11)

  • 查询开卡/充值费率

  • 预充值获取订单号

  • 获取充值地址和二维码

  • 用户通过不同方式完成转账

阶段五:回调处理(步骤12-13)

  • PayAll 推送回调通知到商户回调地址

  • 商户验证签名并处理业务逻辑

阶段六:状态查询(步骤14)

  • 商户可主动查询订单状态,验证处理结果

Last updated