Skip to content

建立 2026-09-14 更新 2026-09-14

官方影音

以下皆出自 Stripe Developers。建議順序:先 Checkout Python(約 6 分鐘),再 Payment Element Python(約 22 分鐘),需要比較兩種 API 時再看直播。

Accept a payment with Checkout and the Integration Builder (Python)

頻道:Stripe Developers 長度:約 6 分 25 秒 對應本站Checkout 託管頁

這支是官方 Checkout 101 系列的 Python 集。示範從文件站的 Integration Builder 選商品、下載含 Flask 的範例、看 create-checkout-session 如何帶 Price ID,以及用測試卡走完託管結帳頁。適合第一次用 Python 接金流、想先有一份能跑的專案。

內容重點:

  • 確認 Dashboard 測試模式與已建立的 Product / Price
  • 下載的程式含 public/server.py,依賴以 stripeflask 為主
  • 前端按鈕 POST 到建立 Session 的路由,再導向 Stripe 託管頁
  • 成功與取消各有獨立 HTML

Accept a payment with the Payment Element using Python

頻道:Stripe Developers 長度:約 22 分鐘 對應本站PaymentIntent 自訂表單本 repo 範例

這支與本 repo 的 server.py 同一條路。用 Stripe CLI 拉官方 sample,說明付款流程、在伺服器建立 PaymentIntent、在瀏覽器掛 Payment Element、提交後處理 webhook 與測試卡。想自訂表單時,應整支看完,尤其是「金額在伺服器建立 Intent」與 webhook 兩段。

內容重點:

  • stripe samples / CLI 安裝可跑的 Python 後端
  • Dashboard 開啟付款方式後,前端表單會自動出現對應欄位
  • client_secret 如何交到 Stripe.js
  • 確認頁與 payment_intent.succeeded 後處理
  • 測試卡與 3DS 情境

Working with Stripe Elements and Checkout Sessions

頻道:Stripe Developers 長度:約 49 分鐘(直播) 對應本站金流架構

直播形式,比較 PaymentIntent + ElementsCheckout Session。講者說明 Checkout 內建 line items、稅、折扣、多幣別;PaymentIntent 則較接近「請 Stripe 對這個付款方式收這筆金額」。後段談到 ui_mode 讓 Checkout 不必整頁導走。適合已經會做其中一種、要決定產品走哪條 API 的人。

內容重點:

  • Checkout 適合購物車與訂閱;PaymentIntent 適合低階請款
  • Embedded / custom UI mode 仍建立 Session,不是改用 Charge API
  • 部分付款方式仍需要 redirect,return_url 不能省

Custom fields in Stripe Checkout

頻道:Stripe Developers 長度:約 11 分 30 秒 對應本站Checkout 託管頁

示範在建立 Session 時加 custom_fields:公司名稱等文字欄、數字欄、下拉選單,以及設成選填。也示範 Payment Link 無程式加欄位。結帳後可從 Session 讀回顧客填的值,用來履約。賣實體商品要收統編、備註時很有用。

Embeddable UI Elements with Stripe(開發者 Masterclass)

頻道:Stripe Developers 長度:約 1 小時量級(專題) 對應本站金流架構

說明 Payment Element、Pricing Table 等可嵌入元件,以及「無程式 / 低程式 / 全程式」差在哪。Pricing Table 只要一段 Web Component;Payment Element 則要你寫伺服器。用來建立產品決策,而不是逐行抄 Python。

React Stripe.js and the Payment Element

頻道:Stripe Developers 長度:約 15 分鐘

後端觀念與 Python 版相同(建立 Intent、回傳 client_secret),前端改用 @stripe/react-stripe-jsElements provider。若你的畫面是 React、API 是 Flask/FastAPI,可以把本站 Python 章當後端、這支當前端參考。

When should I use a REST API directly?

頻道:Stripe Developers 長度:短片

說明為何多數情況用官方 SDK(自動完成、型別、錯誤處理),以及什麼時候改打 REST:語言沒有 SDK、或要極精簡的 HTTP 客戶端。Python 請優先 pip install stripe,不要自己組 https://api.stripe.com 簽章。