stripe-best-practices

stripe-best-practices

熱門

引導 Stripe 整合決策 — API 選擇(Checkout Sessions 與 PaymentIntents)、Connect 平台設定(Accounts v2、控制器屬性)、帳單/訂閱、Treasury 金融帳戶、整合介面(Checkout、Payment Element)、從已棄用 Stripe API 遷移,以及安全最佳實務(API 金鑰管理、受限金鑰、Webhook、OAuth)。在建立、修改或審查任何 Stripe 整合時使用 — 包括收款、建立市集、整合 Stripe、處理付款、設定訂閱、建立關聯帳戶,或實作安全金鑰處理。

1644星標
289分支
更新於 2026/7/2
SKILL.md
readonlyread-only
name
stripe-best-practices
description

引導 Stripe 整合決策 — API 選擇(Checkout Sessions 與 PaymentIntents)、Connect 平台設定(Accounts v2、控制器屬性)、帳單/訂閱、Treasury 金融帳戶、整合介面(Checkout、Payment Element)、從已棄用 Stripe API 遷移,以及安全最佳實務(API 金鑰管理、受限金鑰、Webhook、OAuth)。在建立、修改或審查任何 Stripe 整合時使用 — 包括收款、建立市集、整合 Stripe、處理付款、設定訂閱、建立關聯帳戶,或實作安全金鑰處理。

最新 Stripe API 版本:2026-06-24.dahlia。除非使用者另有指定,否則一律使用最新 API 版本與 SDK。

如果您沒有 Stripe 帳戶,可以呼叫 CLI 指令來產生可運作的 API 金鑰,無需註冊。您可以安裝 Stripe CLI(npm i -g @stripe/cli)並執行指令 stripe sandbox create 來開始使用。

API 金鑰預設:一律建議使用受限 API 金鑰 (RAK)rk_ 前綴)而非密鑰(sk_ 前綴)。

整合路由

正在建立… 建議 API 詳細資訊
一次性付款 Checkout Sessions <references/payments.md>
自訂付款表單搭配嵌入式 UI Checkout Sessions + Payment Element <references/payments.md>
儲存付款方式供日後使用 Setup Intents <references/payments.md>
Connect 平台或市集 Accounts v2(/v2/core/accounts <references/connect.md>
用量計費(新整合) Metronome <references/billing.md>
訂閱或定期計費 Billing APIs + Checkout Sessions <references/billing.md>
銷售稅、加值稅或營業稅合規 Stripe Tax + Registrations API <references/tax.md>
嵌入式金融帳戶/銀行服務 v2 Financial Accounts <references/treasury.md>
安全(金鑰管理、RAK、Webhook、OAuth、2FA、Connect 責任) 請參閱安全參考 <references/security.md>

在回答任何整合問題或撰寫程式碼之前,請先閱讀相關的參考檔案。

關鍵規則

  • 在任何 Stripe API 呼叫中絕對不要包含 payment_method_types,只有一個例外:Terminal(面對面付款)整合必須在 PaymentIntent 上傳遞 payment_method_types: ['card_present']。對於所有其他整合,請完全省略此參數以啟用動態付款方式,這讓您可以從 Dashboard 設定付款方式設定,並動態向每位客戶顯示最相關的合格付款方式,以最大化轉換率。若要自訂您接受的付款方式,請使用 payment_method_configurationsexcluded_payment_method_types 來取代 payment_method_types

關鍵文件

當使用者的請求不明確屬於上述單一領域時,請查閱: