> ## Documentation Index
> Fetch the complete documentation index at: https://doc.haipay.net/llms.txt
> Use this file to discover all available pages before exploring further.

# HaiPay Integration Steps Guide

> Understand the HaiPay Direct API integration flow, including payment method display, parameter handling, callback processing, and compliance requirements.

If you are integrating the HaiPay Direct API, the core workflow is: create an order, return payment details, receive asynchronous notifications, and validate parameters and signatures correctly.

Merchants who want to display payment methods to users and accept payments on their own checkout page can integrate HaiPay using a pure API (Direct API) approach.

For Direct API interfaces, merchants must have PCI-DSS certification if they handle card number information themselves.

## 1. Collection Process

```mermaid theme={null}
sequenceDiagram
    participant C as Customer Client
    participant M as Merchant Server
    participant H as HaiPay Server
    participant B as Wallet/Bank

    C->>C: 1. User places order, enters checkout, fills in payment info
    C->>M: 2.1 Initiate payment request
    M->>H: 2.2 Call Merchant API
    H->>B: 2.3 Call Upstream API
    B-->>H: 2.4 Return response
    H-->>M: 2.5 Return response
    M-->>C: 2.6 Return response

    B-->>H: 3.1 Async notify payment result
    H-->>M: 3.2 Async notify payment result
    M->>M: 3.3 Notification acknowledged
    H->>H: 3.4 Notification acknowledged
```

## 2. Payment Process

```mermaid theme={null}
sequenceDiagram
    participant M as Merchant Server
    participant H as HaiPay Server
    participant B as Wallet/Bank

    M->>H: 1.1 Initiate payout request
    H->>B: 1.2 Call Upstream API
    B-->>H: 1.3 Return response
    H-->>M: 1.4 Return response

    B-->>H: 2.1 Async notify result
    H-->>M: 2.2 Async notify result
    M->>M: 2.3 Notification acknowledged
    H->>H: 2.4 Notification acknowledged
```

## 3. API Parameters

For details, please refer to: [API Description](/docs/en/guide/api_description_guide)

## 4. End-to-End Testing

For details, please refer to: [End-to-End Testing](/docs/en/guide/end_to_end_testing)

## Related Topics

* [HaiPay Integration Process Guide](/docs/en/guide/integration_process_guide)
* [HaiPay Configuration and Signature Guide](/docs/en/guide/config_settings_and_signature_rules_guide)
* [HaiPay API Description and Common Rules](/docs/en/guide/api_description_guide)
