> 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/integrations/apple-pay-google-pay.md).

# Apple Pay và Google Pay

Đăng ký tên miền để form thẻ hiện Apple Pay và Google Pay.

Apple Pay và Google Pay hiện trong form thẻ trên những tên miền đã được kích hoạt cho tài khoản của bạn. Một lần đăng ký dùng cho cả hai ví; phí giống thanh toán bằng thẻ. Không cần sửa code: `loomgate.js` tự hiện ví khi tên miền đã kích hoạt (nhớ gọi `confirm()` ngay trong handler click).

## Các bước

{% stepper %}
{% step %}

### Thêm tên miền

Trong dashboard, mục [**Apple Pay & Google Pay**](https://app.loomgate.io/wallet-domains), thêm tên miền chứa trang checkout, ví dụ `shop.example.com` (chỉ tên miền: không `https://`, không đường dẫn, không cổng). Tối đa 20 tên miền.
{% endstep %}

{% step %}

### Đặt file xác minh

Tải file xác minh từ dashboard (hoặc bằng publishable key):

```bash
curl -o apple-developer-merchantid-domain-association \
  -H "Authorization: Bearer pk_live_…" \
  https://api.loomgate.io/partner/v1/client/apple-pay/domain-association
```

Đặt nguyên văn file đó tại:

```
https://<tên-miền>/.well-known/apple-developer-merchantid-domain-association
```

File phải trả về thẳng `200` qua HTTPS hợp lệ: không chuyển hướng, không đăng nhập, không đuôi file.
{% endstep %}

{% step %}

### Thêm bản ghi DNS

Thêm bản ghi TXT mà dashboard hiển thị cho tên miền đó:

| Tên                                 | Giá trị                                     |
| ----------------------------------- | ------------------------------------------- |
| `_loomgate-verification.<tên-miền>` | `loomgate-domain-verification=<mã của bạn>` |
| {% endstep %}                       |                                             |

{% step %}

### Xác minh

Bấm **Xác minh**. Loomgate kiểm tra bản ghi TXT trước, rồi tải file từ tên miền của bạn. Qua cả hai bước thì tên miền chuyển sang chờ kích hoạt. Loomgate kích hoạt tên miền, sau đó ví hiện trong form thẻ trên tên miền đó.
{% endstep %}
{% endstepper %}

## Trạng thái tên miền

| Trạng thái        | Nghĩa                                                                                    |
| ----------------- | ---------------------------------------------------------------------------------------- |
| `unverified`      | Mới thêm, chưa xác minh                                                                  |
| `pending`         | Đã xác minh, chờ Loomgate kích hoạt                                                      |
| `active`          | Đã kích hoạt: Apple Pay và Google Pay hiện trên tên miền này                             |
| `rejected`        | Bị từ chối kèm lý do, hoặc tên miền đang thuộc tài khoản khác. Sửa rồi xác minh lại được |
| `removal_pending` | Đã xóa một tên miền đang kích hoạt, chờ gỡ đăng ký                                       |

## Khi xác minh thất bại

Dashboard hiện lý do theo mã:

| Mã                                     | Cần kiểm tra                                                               |
| -------------------------------------- | -------------------------------------------------------------------------- |
| `txt_missing`, `txt_mismatch`          | Bản ghi TXT chưa có hoặc sai giá trị (DNS có thể cần vài phút để cập nhật) |
| `dns_failed`                           | Không tra được DNS của tên miền                                            |
| `file_unreachable`, `file_tls_invalid` | Không kết nối được HTTPS hoặc chứng chỉ không hợp lệ                       |
| `file_redirect`                        | Đường dẫn file bị chuyển hướng                                             |
| `file_http_status`                     | File không trả về 200                                                      |
| `file_mismatch`, `file_too_large`      | Nội dung file khác file tải từ dashboard                                   |

Mỗi tài khoản xác minh tối đa 10 lần mỗi phút. Nếu dashboard báo tên miền cần file mới, tải lại file, thay trên máy chủ của bạn rồi xác minh lại.


---

# 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/integrations/apple-pay-google-pay.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.
