> For the complete documentation index, see [llms.txt](https://docs.loomgate.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.loomgate.io/introduction.md).

# Giới thiệu

Nhận thanh toán thẻ, Apple Pay và Google Pay trên website của bạn bằng Loomgate.

Loomgate giúp website của bạn nhận thanh toán bằng thẻ, Apple Pay và Google Pay, bằng USD hoặc EUR. Form nhập thẻ nằm trong iframe của đối tác thanh toán (chuẩn PCI DSS): số thẻ đi thẳng từ trình duyệt của người mua tới đối tác, không bao giờ đi qua máy chủ của bạn.

## Cách một thanh toán diễn ra

```mermaid
sequenceDiagram
    participant B as Trình duyệt người mua
    participant S as Máy chủ của bạn
    participant L as Loomgate
    S->>L: Tạo payment (secret key)
    L-->>S: payment + client_secret
    S-->>B: client_secret
    B->>L: loomgate.js hiện form thẻ, người mua bấm Pay
    L-->>B: succeeded / processing / lỗi
    L->>S: Webhook payment_intent.succeeded (có chữ ký)
    S->>S: Xác minh chữ ký rồi giao hàng
```

1. Máy chủ của bạn tạo một **payment** (payment intent) bằng secret key, kèm số tiền và thông tin đơn hàng.
2. Trình duyệt hiện form thẻ bằng `loomgate.js`, dùng publishable key và `client_secret` của payment đó.
3. Người mua bấm thanh toán. `loomgate.js` xác nhận thanh toán, kể cả bước 3-D Secure khi ngân hàng yêu cầu.
4. Loomgate gửi webhook `payment_intent.succeeded` tới máy chủ của bạn. Bạn xác minh chữ ký rồi mới giao hàng.

## Bắt đầu từ đâu

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><h4><i class="fa-bolt">:bolt:</i></h4></td><td><strong>Khởi động nhanh</strong></td><td>Từ API key tới thanh toán đầu tiên, từng bước.</td><td><a href="/getting-started/quickstart.md">Khởi động nhanh</a></td></tr><tr><td><h4><i class="fa-cart-shopping">:cart-shopping:</i></h4></td><td><strong>WooCommerce</strong></td><td>Cài plugin, điền key, xong. Không cần viết code.</td><td><a href="/integrations/woocommerce.md">WooCommerce</a></td></tr><tr><td><h4><i class="fa-bell">:bell:</i></h4></td><td><strong>Webhook</strong></td><td>Nhận kết quả thanh toán và hoàn tiền, xác minh chữ ký.</td><td><a href="/webhooks.md">Webhook</a></td></tr><tr><td><h4><i class="fa-code">:code:</i></h4></td><td><strong>Tham chiếu API</strong></td><td>Mọi endpoint, tham số, response và mã lỗi.</td><td><a href="/api-reference.md">Tham chiếu API</a></td></tr></tbody></table>

## Những điều cần biết trước

{% hint style="warning" %}
**Chưa có môi trường thử nghiệm.** Mọi key đều là `sk_live_…` / `pk_live_…` và mọi thanh toán đều trừ tiền thật. Khi thử tích hợp, hãy dùng số tiền nhỏ rồi hoàn tiền. Phí của giao dịch không được hoàn lại, kể cả khi bạn hoàn tiền.
{% endhint %}

* **Số tiền** luôn là số nguyên theo đơn vị nhỏ nhất của tiền tệ (cent): `10000` là 100,00 USD. Tiền tệ hỗ trợ: `usd`, `eur`. Xem [Số tiền, tiền tệ và phí](/concepts/amounts-and-fees.md).
* **Địa chỉ API** (base URL): `https://api.loomgate.io`. Mọi route của API tích hợp nằm dưới `/partner/v1`.
* **Tài khoản**: tài khoản merchant do Loomgate hoặc đại lý của bạn tạo. Bạn nhận link mời, đặt mật khẩu rồi đăng nhập dashboard merchant để lấy API key, tạo webhook và xem giao dịch.
* **Nguồn sự thật về thanh toán** là webhook `payment_intent.succeeded` (hoặc trạng thái `succeeded` khi bạn đọc payment). Đừng giao hàng chỉ vì trình duyệt báo thành công.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.loomgate.io/introduction.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
