stable · overview · 0.1.0
Payments
付款與商務責任分界
MiniCenter 建立 Payment Transaction、驗證 ECPay callback,並回報可信任的付款結果。Project Backend 仍擁有商品、價格、Project Order 與 Entitlement;收到付款成功事件後,才由 Project Backend 決定要授予什麼權利。
Payment Transaction 可以在建立時附帶 recurring schedule。後續 recurring charge、取消與對帳都有獨立狀態,不應用首次付款狀態推測。
Refund 與 Invoice Issuance
Refund 是 Project Backend 做完商務判斷後,對已 settled Payment Transaction 發出的獨立退款請求。多次部分 Refund 的總額不能超過 settled 金額。
Invoice Issuance 是可選且獨立啟用的電子發票能力。付款成功不代表發票成功,Refund 也不會自動作廢發票或建立折讓。
先依照 sandbox payment lifecycle完成付款,再閱讀付款、退款與電子發票確認狀態與責任分界。
Guides
- Sandbox payment lifecycle — 在 sandbox 建立 Payment Transaction,導向 ECPay 測試結帳並以事件確認結果。
- 付款、退款與電子發票 — 管理 recurring charge、Refund 與獨立 Invoice Issuance 的狀態和重試。
API Reference
- Create a Payment Transaction — POST /api/v1/payment-transactions
- Get a Payment Transaction — GET /api/v1/payment-transactions/{paymentTransactionId}
- Cancel recurring charges — POST /api/v1/payment-transactions/{paymentTransactionId}/cancel-recurring
- Create a Refund — POST /api/v1/payment-transactions/{paymentTransactionId}/refunds
- Issue an electronic Invoice — POST /api/v1/payment-transactions/{paymentTransactionId}/invoice-issuances
Event Reference
- Invoice Issuance outcome — Payload for payments.invoice.succeeded or payments.invoice.failed.
- Recurring payment cancellation outcome — Payload for payments.recurring.cancellation.succeeded or payments.recurring.cancellation.failed.
- Recurring payment renewal outcome — Payload for payments.recurring.renewal.succeeded or payments.recurring.renewal.failed.
- Refund outcome — Payload for payments.refund.succeeded or payments.refund.failed.
- Payment Transaction settled — A Payment Transaction has been confirmed as settled by the payment provider.