> For the complete documentation index, see [llms.txt](https://docs.coda.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coda.co/https-coda-payments.gitbook.io-zhong-wen-coda-private-technical-documentation/codapay/tuo-guan-zu-jian-ji-cheng/qi-ta-zhi-fu-fang-shi/gong-zuo-yuan-li.md).

# 工作原理

本节介绍使用卡支付托管组件时的高级支付流程。该流程图展示了托管组件如何参与更广泛的卡交易生命周期。

本节介绍使用托管组件进行替代支付方式时的高级支付流程。该流程图展示了托管组件如何参与更广泛的交易生命周期。

#### 高级流程描述 <a href="#high-level-flow-description" id="high-level-flow-description"></a>

1. **发起支付：**&#x7528;户选择支付方式。后端通过调用与所选渠道`POST /init.json`对应的函数来创建支付会话。Coda 返回交易 ID 和客户端密钥。`payType`
2. **初始化 SDK：**&#x4F7F;用`clientSecret`后端初始化 CodaComponent SDK。该组件会为所选渠道渲染相应的支付界面（例如，二维码、钱包按钮、重定向提示或输入字段）。
3. **状态监控：**&#x60A8;的前端会监听组件的状态变更事件。这些事件会将支付流程的当前步骤告知您的用户界面，以便您据此调整后续体验。
4. **用户完成支付：**&#x6839;据渠道类型，用户在组件内完成支付：
   * **二维码通道**（例如，QRIS）：用户使用其移动应用程序扫描显示的二维码。
   * **钱包按钮**（例如 Google Pay、Apple Pay）：用户点击钱包按钮，并在钱包叠加层中完成身份验证。
   * **重定向渠道**（例如 GCash）：用户暂时重定向到支付提供商进行授权，然后返回到您的页面。
   * **输入式通道**（例如 PIX）：用户输入所需信息（例如税务识别号）并确认。
5. **通知：**&#x4E00;旦付款达到最终状态，Coda 会通过 webhook 向您的后端发送异步通知。

[<br>](https://coda-payments.gitbook.io/coda-public-technical-documentation/codapay/hosted-component-integration/alternative-payment-methods)


---

# 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.coda.co/https-coda-payments.gitbook.io-zhong-wen-coda-private-technical-documentation/codapay/tuo-guan-zu-jian-ji-cheng/qi-ta-zhi-fu-fang-shi/gong-zuo-yuan-li.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.
