> 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/ka-pian/fen-bie-shou-quan-he-shou-qu-kuan-xiang.md).

# 分别授权和收取款项

默认情况下，Codapay 将信用卡支付处理为单笔扣款——授权和扣款同时完成。通过授权和扣款分离，您可以将其拆分为两个不同的阶段：

1. **授权**——持卡人的银行核实付款并冻结资金，但尚未转账。
2. **确认付款**— 您明确确认付款，资金将从持卡人转入您的账户。

如果您在获得授权后决定不继续付款，您可以**取消**已授权的交易以解除对持卡人资金的冻结。

#### 何时使用 <a href="#when-to-use-it" id="when-to-use-it"></a>

当您需要以下情况时，授权和捕获分离非常有用：

* 付款前请核实库存或产品可用性
* 在用户完成支付验证后，执行额外的欺诈或合规性检查。
* 在录入数据之前，先人工审核高价值交易。

#### 先决条件 <a href="#prerequisites" id="prerequisites"></a>

要使用授权和捕获分离功能，您的帐户必须启用以下功能：

1. **POST 通知**— 身份验证和捕获分离仅适用于 POST 通知。有关激活 POST 通知的详细信息，请参阅[“身份验证和捕获通知”页面。](https://coda-payments.gitbook.io/coda-public-technical-documentation/codapay/hosted-component-integration/cards/authorize-and-capture-a-payment-separately/auth-and-capture-notifications)
2. **身份验证与数据采集分离**——此功能必须单独为您的帐户激活。

请联系您的 Codapay 客户经理以启用这两项功能。

#### 工作原理 <a href="#how-it-works" id="how-it-works"></a>

授权和采集流程如下：

1. 您像往常一样发起付款请求。该功能激活后，Codapay 将在不实际扣款的情况下授权付款。
2. 您将通过 webhook 端点收到通知`AUTHORIZATION_SUCCESSFUL`。`AUTHORIZATION_FAILED`
3. 如果授权成功，您可以决定是**收取款项**还是**取消**付款：
   * **捕获**— 调用[“捕获付款请求”](https://claude.ai/chat/cb09ca98-8996-43b7-87cb-cd20a04c1dea#)端点以完成付款。您将收到`CAPTURE_INITIATED`或`CAPTURE_SUCCESSFUL`通知`CAPTURE_FAILED`。
   * **取消**— 调用[“取消付款请求”](https://coda-payments.gitbook.io/coda-public-technical-documentation/codapay/hosted-component-integration/cards/authorize-and-capture-a-payment-separately/cancel-a-payment-request)端点以释放已冻结的资金。授权将被撤销。

#### 下一步 <a href="#next-steps" id="next-steps"></a>

* [授权和捕获通知](https://coda-payments.gitbook.io/coda-public-technical-documentation/codapay/hosted-component-integration/cards/authorize-and-capture-a-payment-separately/auth-and-capture-notifications)— 授权和捕获事件的通知事件类型和有效负载结构
* [捕获付款请求](https://coda-payments.gitbook.io/coda-public-technical-documentation/codapay/hosted-component-integration/cards/authorize-and-capture-a-payment-separately/capture-a-payment-request)— 用于捕获已授权付款的 API 参考
* [取消付款请求](https://coda-payments.gitbook.io/coda-public-technical-documentation/codapay/hosted-component-integration/cards/authorize-and-capture-a-payment-separately/cancel-a-payment-request)— 用于取消已授权付款的 API 参考

[<br>](https://coda-payments.gitbook.io/coda-public-technical-documentation/codapay/hosted-component-integration/cards/saving-card-details)


---

# 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/ka-pian/fen-bie-shou-quan-he-shou-qu-kuan-xiang.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.
