taiwan-payment-skill 1.1.5 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +1 -1
  2. package/assets/taiwan-payment/CLAUDE.md +7 -3
  3. package/assets/taiwan-payment/EXAMPLES.md +69 -0
  4. package/assets/taiwan-payment/README.md +1 -1
  5. package/assets/taiwan-payment/SKILL.md +66 -17
  6. package/assets/taiwan-payment/data/error-codes.csv +32 -0
  7. package/assets/taiwan-payment/data/operations.csv +14 -8
  8. package/assets/taiwan-payment/data/payment-methods.csv +28 -24
  9. package/assets/taiwan-payment/data/providers.csv +4 -0
  10. package/assets/taiwan-payment/examples/ezpay-payment-example.py +690 -0
  11. package/assets/taiwan-payment/examples/paynow-payment-example.py +767 -0
  12. package/assets/taiwan-payment/examples/pchomepay-payment-example.py +556 -0
  13. package/assets/taiwan-payment/examples/smilepay-payment-example.py +673 -0
  14. package/assets/taiwan-payment/references/ezpay-payment-api.md +660 -0
  15. package/assets/taiwan-payment/references/paynow-payment-api.md +1654 -0
  16. package/assets/taiwan-payment/references/pchomepay-payment-api.md +1431 -0
  17. package/assets/taiwan-payment/references/smilepay-payment-api.md +919 -0
  18. package/assets/templates/base/quick-reference.md +71 -71
  19. package/assets/templates/base/skill-content.md +64 -15
  20. package/assets/templates/platforms/agent.json +2 -2
  21. package/assets/templates/platforms/antigravity.json +1 -1
  22. package/assets/templates/platforms/claude.json +2 -2
  23. package/assets/templates/platforms/codebuddy.json +2 -2
  24. package/assets/templates/platforms/codex.json +2 -2
  25. package/assets/templates/platforms/continue.json +2 -2
  26. package/assets/templates/platforms/copilot.json +2 -2
  27. package/assets/templates/platforms/cursor.json +2 -2
  28. package/assets/templates/platforms/gemini.json +2 -2
  29. package/assets/templates/platforms/kiro.json +2 -2
  30. package/assets/templates/platforms/opencode.json +2 -2
  31. package/assets/templates/platforms/qoder.json +2 -2
  32. package/assets/templates/platforms/roocode.json +2 -2
  33. package/assets/templates/platforms/trae.json +2 -2
  34. package/assets/templates/platforms/windsurf.json +2 -2
  35. package/package.json +6 -2
package/README.md CHANGED
@@ -175,7 +175,7 @@ python scripts/test_payment.py all
175
175
 
176
176
  ## 功能特色
177
177
 
178
- - 完整 API 文檔 (ECPay, NewebPay, PAYUNi)
178
+ - 完整 API 文檔 (ECPay, NewebPay, PAYUNi, SmilePay, PChomePay, ezPay, PayNow)
179
179
  - BM25 搜索引擎
180
180
  - 智能推薦系統
181
181
  - 9 組完整代碼範例 (TypeScript/Python)
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
 
5
5
  ## Project Overview
6
6
 
7
- Taiwan Payment Skill is an AI-powered toolkit for Taiwan Payment Gateway integration, providing API documentation, code examples, and scripts for major payment platforms (ECPay, NewebPay, PAYUNi). It works as a skill/workflow for AI coding assistants (Claude Code, Windsurf, Cursor, etc.).
7
+ Taiwan Payment Skill is an AI-powered toolkit for Taiwan Payment Gateway integration, providing API documentation, code examples, and scripts for major payment platforms (ECPay, NewebPay, PAYUNi, SmilePay, PChomePay, ezPay, PayNow). It works as a skill/workflow for AI coding assistants (Claude Code, Windsurf, Cursor, etc.).
8
8
 
9
9
  ## Available Scripts
10
10
 
@@ -19,7 +19,7 @@ python3 taiwan-payment/scripts/recommend.py "<requirements>"
19
19
  python3 taiwan-payment/scripts/test_payment.py [--platform <platform>]
20
20
  ```
21
21
 
22
- **Supported Platforms:** `ecpay`, `newebpay`, `payuni`
22
+ **Supported Platforms:** `ecpay`, `newebpay`, `payuni`, `smilepay`, `pchomepay`, `ezpay`, `paynow`
23
23
 
24
24
  **Search Domains:** `provider`, `operation`, `error`, `field`, `payment_method`, `troubleshoot`, `reasoning`
25
25
 
@@ -32,7 +32,11 @@ taiwan-payment/ # Source of Truth
32
32
  ├── references/ # API documentation
33
33
  │ ├── ecpay-payment-api.md
34
34
  │ ├── newebpay-payment-api.md
35
- │ └── payuni-payment-api.md
35
+ │ ├── payuni-payment-api.md
36
+ │ ├── smilepay-payment-api.md
37
+ │ ├── pchomepay-payment-api.md
38
+ │ ├── ezpay-payment-api.md
39
+ │ └── paynow-payment-api.md
36
40
  ├── scripts/ # Utility scripts
37
41
  │ ├── core.py # BM25 search engine
38
42
  │ ├── recommend.py # Recommendation system
@@ -1422,4 +1422,73 @@ console.log('一致:', JSON.stringify(testData) === JSON.stringify(decryptedPAYU
1422
1422
 
1423
1423
  ---
1424
1424
 
1425
+ ## SmilePay 速買配範例
1426
+
1427
+ SmilePay 採用 `Verify_key` + `mid` 共享密鑰機制,無 AES 加密,整合最簡單。回應為 XML(部分欄位可能是 BIG-5 編碼,需轉 UTF-8)。
1428
+
1429
+ ### 完整 Python 範例
1430
+ 請見 [`examples/smilepay-payment-example.py`](examples/smilepay-payment-example.py) — 涵蓋 ATM (Pay_zg=2) / Barcode (Pay_zg=3) / ibon (Pay_zg=4) / FamiPort (Pay_zg=6) / 信用卡 (Pay_zg=1) / 信用卡分期 / 聯合信用卡 (Pay_zg=11) 七種付款方式。
1431
+
1432
+ ### 五大踩坑
1433
+
1434
+ 1. **Pay_zg 是核心參數**:每種付款方式對應不同的 Pay_zg 值;分期是 `Pay_zg=1` + `Stage` 額外欄位。
1435
+ 2. **回應是 XML,不是 JSON**:用 `xml.etree.ElementTree` 解析;常用欄位 `Status`、`Desc`、`Smseid`、`PaymentNo`。
1436
+ 3. **通知時要驗證 `Mid_smilepay` 加權檢核碼**:這是 SmilePay 防偽機制;演算法在 `smilepay-payment-api.md` 文件中(從 plugin 反推)。
1437
+ 4. **部分通知欄位為 BIG-5 編碼**:`Process_time` / `Address` / `Errdesc` 需 BIG-5→UTF-8。
1438
+ 5. **沒有正式查詢端點**:靠通知 + `mtmk_utf.asp` 補;通知會重試但無公開重試 SLA。
1439
+
1440
+ ---
1441
+
1442
+ ## PChomePay 拍錢包範例
1443
+
1444
+ PChomePay 採用 **HTTP Basic Auth → pcpay-token** 兩階段認證:先用 APP_ID + SECRET 取得 token(8 小時有效),後續 API 帶 `pcpay-token` header。
1445
+
1446
+ ### 完整 Python 範例
1447
+ 請見 [`examples/pchomepay-payment-example.py`](examples/pchomepay-payment-example.py) — 涵蓋 token 自動刷新、信用卡、ATM、超商代碼、訂單查詢、退款。
1448
+
1449
+ ### 四大要點
1450
+
1451
+ 1. **白名單 IP**:PChomePay notify 的來源 IP 是 `113.196.231.190`,**必須加入後台白名單**。
1452
+ 2. **Token 機制**:開立 token 預設 28800 秒(8h)有效;要在程式自行 cache 並避免逾期重發。
1453
+ 3. **沙箱測試靠金額尾數**:例如 ATM 訂單金額尾數 `0-7` 自動付款成功、`8` 過期、`9` 5 分鐘後過期。
1454
+ 4. **退款手續費**:除信用卡免手續費外,ATM/超商等需「退款金額 + 退款手續費」共同從餘額扣除;退款手續費為 NT$15(依官方)。
1455
+
1456
+ ---
1457
+
1458
+ ## ezPay 簡單付範例
1459
+
1460
+ ezPay 是藍新 NewebPay 集團的小型商家品牌,金流 API **與 NewebPay MPG 完全相同**(TradeInfo / TradeSha / AES-256-CBC + SHA256),只在 MerchantID、HashKey、URL 與部分付款方式上有差異。
1461
+
1462
+ ### 完整 Python 範例
1463
+ 請見 [`examples/ezpay-payment-example.py`](examples/ezpay-payment-example.py) — 由 `newebpay-payment-example.py` 衍生,凸顯差異點。
1464
+
1465
+ ### 三大要點
1466
+
1467
+ 1. **加密邏輯完全照抄 NewebPay**:可直接複用同一份加解密 helper。
1468
+ 2. **URL 不同**:ezPay 沙箱 `https://ccore.spgateway.com/MPG/mpg_gateway`(spgateway.com 是舊網域,仍可用)。
1469
+ 3. **付款方式受限**:分期、部分電子錢包在 ezPay 計劃下不可用;以後台啟用為準。
1470
+
1471
+ ---
1472
+
1473
+ ## PayNow 立吉富範例
1474
+
1475
+ PayNow 有**兩代 API 並行**:
1476
+ - **傳統版(cashflow)**:form-post,動態 AES-256(每次以 GP/GK 檢核碼即時取得 Key/IV)
1477
+ - **現代版(apidoc)**:JWT Bearer + RESTful JSON + PaymentIntent / Customer / Card Token(接近 Stripe)
1478
+
1479
+ 新專案應優先採用現代版。
1480
+
1481
+ ### 完整 Python 範例
1482
+ 請見 [`examples/paynow-payment-example.py`](examples/paynow-payment-example.py) — 涵蓋 PaymentIntent 建立 / Checkout / Refund / Apple Pay session / Customer / Card Token,搭配傳統版的 form-post 範例 stub。
1483
+
1484
+ ### 五大要點
1485
+
1486
+ 1. **新專案走現代版**:傳統版的 GP/GK 動態金鑰機制學習成本高、易出錯;只有舊系統相容才需要。
1487
+ 2. **Apple Pay 完整支援**:含 v1 / v2 一般流程 + Deferred 延遲扣款(PayNow 獨家)。
1488
+ 3. **Card Token 可跨訂單記憶**:透過 Customer + Card Token 機制做訂閱、回購快速結帳。
1489
+ 4. **`webhookUrl` 是現代版的 callback 機制**:不同於傳統版的 `Roturl`。
1490
+ 5. **`channelId` 對 LINE Pay 必須額外設定**:`paymentMethodType=LINEPayOnline` 時需提供 PayNow 簽發的 channelId。
1491
+
1492
+ ---
1493
+
1425
1494
  **更多範例持續更新中...**
@@ -22,7 +22,7 @@
22
22
 
23
23
  ## 專案簡介
24
24
 
25
- Taiwan Payment Skill 是專為台灣金流整合設計的 AI 開發工具包,支援三大金流平台 (ECPay、NewebPay、PAYUNi) 的完整 API 整合。本工具包提供企業級程式碼範例、BM25 智能搜尋引擎、服務商推薦系統與代碼生成器,協助開發團隊快速完成金流系統整合。
25
+ Taiwan Payment Skill 是專為台灣金流整合設計的 AI 開發工具包,支援七大金流平台 (ECPay、NewebPay、PAYUNi) 的完整 API 整合。本工具包提供企業級程式碼範例、BM25 智能搜尋引擎、服務商推薦系統與代碼生成器,協助開發團隊快速完成金流系統整合。
26
26
 
27
27
  **版本:** 1.1.3
28
28
  **狀態:** Production Ready
@@ -1,20 +1,24 @@
1
1
  ---
2
2
  name: taiwan-payment
3
- description: Taiwan Payment API integration specialist for ECPay, NewebPay, and PAYUNi payment gateways. Use when developing payment systems, implementing credit card, ATM, CVS, or e-wallet payments, or working with Taiwan payment gateway APIs. Handles encryption (SHA256, AES-256-CBC, AES-256-GCM), API requests, and service provider differences.
3
+ description: Taiwan Payment API integration specialist for ECPay, NewebPay, PAYUNi, SmilePay, PChomePay, ezPay, and PayNow payment gateways. Use when developing payment systems, implementing credit card, ATM, CVS, e-wallet, or LINE Pay/Apple Pay payments, or working with Taiwan payment gateway APIs. Handles encryption (SHA256, AES-256-CBC, AES-256-GCM, dynamic AES-256, JWT, Basic Auth → token), API requests, and service provider differences.
4
4
  user-invocable: true
5
5
  ---
6
6
 
7
7
  # Taiwan Payment Development Skill
8
8
 
9
- > 此技能涵蓋台灣金流 API 整合開發,包含綠界科技 (ECPay)、藍新金流 (NewebPay)、統一金流 (PAYUNi) 三家服務商。
9
+ > 此技能涵蓋台灣金流 API 整合開發,包含綠界科技 (ECPay)、藍新金流 (NewebPay)、統一金流 (PAYUNi)、速買配 (SmilePay)、拍錢包 (PChomePay)、ezPay 簡單付、立吉富 (PayNow) 七家服務商。
10
10
 
11
11
  ## 快速導覽
12
12
 
13
13
  ### 相關文件
14
14
  使用此技能時,請參考專案中的 API 規格文件:
15
- - `references/ECPAY_PAYMENT_REFERENCE.md` - 綠界金流 API 規格
16
- - `references/NEWEBPAY_PAYMENT_REFERENCE.md` - 藍新金流 API 規格
17
- - `references/PAYUNI_PAYMENT_REFERENCE.md` - 統一金流 API 規格
15
+ - `references/ecpay-payment-api.md` - 綠界金流 API 規格
16
+ - `references/newebpay-payment-api.md` - 藍新金流 API 規格
17
+ - `references/payuni-payment-api.md` - 統一金流 API 規格
18
+ - `references/smilepay-payment-api.md` - 速買配 API 規格(PHP plugin 反推)
19
+ - `references/pchomepay-payment-api.md` - 拍錢包 API 規格(含 Basic Auth → Token 兩階段認證)
20
+ - `references/ezpay-payment-api.md` - ezPay 簡單付 API 規格(與藍新 Newebpay 同集團、同加密)
21
+ - `references/paynow-payment-api.md` - 立吉富 API 規格(傳統版 cashflow + 現代版 PaymentIntent 雙 API)
18
22
  - [EXAMPLES.md](EXAMPLES.md) - 程式碼範例集
19
23
 
20
24
  ### 智能工具
@@ -105,13 +109,21 @@ python scripts/recommend.py "會員制 定期扣款" --format simple
105
109
  **推薦關鍵字:**
106
110
  - **ECPay**: 穩定、市佔、高交易量、電商、ATM、超商、定期、訂閱、分期、發票、物流
107
111
  - **NewebPay**: 多元、支付方式、電子錢包、LINE、行動、記憶、會員、跨境
108
- - **PAYUNi**: API、JSON、RESTful、統一、新創
112
+ - **PAYUNi**: API、JSON、RESTful、統一、新創、AFTEE、iCash
113
+ - **SmilePay**: 速買配、簡單、便宜、台灣老牌、PHP、ibon、FamiPort、聯合信用卡
114
+ - **PChomePay**: 拍錢包、PChome、P 幣、Basic Auth、Token、虛擬帳號、超商代碼條碼、物流二合一
115
+ - **ezPay**: 簡單付、藍新小型、低門檻、跨境、智冠、支付寶、微信
116
+ - **PayNow**: 立吉富、Apple Pay、PaymentIntent、Stripe-like、JWT、票券、mPOS、現代+傳統雙 API
109
117
 
110
118
  **反模式警告:**
111
119
  推薦系統會自動提示不建議的場景:
112
120
  - ECPay: 無技術資源、極簡需求
113
121
  - NewebPay: 簡單 API、單一支付
114
122
  - PAYUNi: 大型專案、完整文檔
123
+ - SmilePay: 多元電子錢包、現代 RESTful、跨境
124
+ - PChomePay: 不在 PChome 生態系
125
+ - ezPay: 大型商家、需要分期、需要完整支付方式
126
+ - PayNow: 簡單需求(雙 API 學習成本高)
115
127
 
116
128
  ### 付款測試工具 (test_payment.py)
117
129
 
@@ -127,6 +139,18 @@ python scripts/test_payment.py newebpay
127
139
  # 測試 PAYUNi 連線
128
140
  python scripts/test_payment.py payuni
129
141
 
142
+ # 測試 SmilePay 連線
143
+ python scripts/test_payment.py smilepay
144
+
145
+ # 測試 PChomePay 連線
146
+ python scripts/test_payment.py pchomepay
147
+
148
+ # 測試 ezPay 連線
149
+ python scripts/test_payment.py ezpay
150
+
151
+ # 測試 PayNow 連線
152
+ python scripts/test_payment.py paynow
153
+
130
154
  # 測試所有服務商
131
155
  python scripts/test_payment.py all
132
156
  ```
@@ -166,18 +190,17 @@ python scripts/test_payment.py all
166
190
  - **iCash**: PAYUNi 專屬愛金卡支付
167
191
  - **簡單付支付寶/微信**: 跨境支付(中國市場)
168
192
 
169
- ## 三家服務商特性比較
193
+ ## 七家服務商特性比較
170
194
 
171
- | 特性 | 綠界 ECPay | 藍新 NewebPay | 統一 PAYUNi |
172
- |------|-----------|--------------|------------|
173
- | 加密方式 | URL Encode + SHA256 | AES-256-CBC + SHA256 雙層 | AES-256-GCM + SHA256 |
174
- | API 風格 | Form POST | Form POST + AES | RESTful JSON |
175
- | 內容格式 | application/x-www-form-urlencoded | application/x-www-form-urlencoded | application/json |
176
- | 測試/正式 URL | 不同 URL | 不同 URL | 不同 URL |
177
- | 市佔率 | 最高 | 高 | 中等 |
178
- | 支付方式 | 11 種(含 BNPL、TWQR) | 13 種(含 LINE Pay、Apple Pay) | 8 種(含 AFTEE、iCash) |
179
- | 特色功能 | 完整文檔、SDK、同時支援發票物流 | MPG 整合、信用卡記憶、多元電子錢包 | RESTful 設計、統一集團背景 |
180
- | 適用場景 | 高交易量電商、傳統產業、PHP 開發 | 多元支付、會員制、行動 App | 新創公司、API 優先、Node.js 開發 |
195
+ | 特性 | ECPay | NewebPay | PAYUNi | SmilePay | PChomePay | ezPay | PayNow |
196
+ |------|-------|----------|--------|----------|-----------|-------|--------|
197
+ | 加密方式 | SHA256 | AES-256-CBC + SHA256 | AES-256-GCM + SHA256 | Verify_key + Mid_smilepay 加權 | HTTP Basic Auth → pcpay-token | 同 NewebPay (AES-256-CBC + SHA256) | 傳統: 動態 AES-256 (GP/GK 鑰); 現代: JWT Bearer |
198
+ | API 風格 | Form POST | Form POST + AES | RESTful JSON | Form POST (回 XML) | RESTful JSON | Form POST + AES (相容 NewebPay) | 傳統: Form POST; 現代: RESTful JSON |
199
+ | 測試/正式 URL | 不同 URL | 不同 URL | 不同 URL | 同 URL | 不同 URL | 不同 URL | 不同 URL |
200
+ | 市佔率 | 最高 | 高 | 中等 | 中(老牌) | 中(PChome 生態) | 中(小型商家) | 中小(多角化) |
201
+ | 支付方式 | 11 種 | 13 種 | 8 種 | 7 種(無多數行動支付) | 5 種(信用卡 + ATM + CVS + 拍錢包 + 取貨付款) | 同 NewebPay 但部分受限 | 傳統 7 種 / 現代 8 種(含 LINE Pay 線上+線下、Apple Pay 含延遲扣款) |
202
+ | 特色 | 金流發票物流三合一 | MPG 整合、信用卡記憶 | RESTful、AFTEE、iCash | 簡單便宜、ibon、FamiPort | P 幣回饋、超商取貨付款、自帶物流 | 小型商家門檻低、跨境 | 雙 API、Stripe-like 現代設計、Apple Pay 完整、票券系統 |
203
+ | 適用 | 高交易量電商 | 多元支付會員制 | 新創、Node.js | 預算有限、傳統 | PChome 生態 / 物流整合 | 個人賣家、月結金額不大 | 新創、Apple Pay、未來導向 |
181
204
 
182
205
  ### ECPay 特性
183
206
  - **優勢**: 市佔率最高、穩定性最佳、文檔完整、社群資源豐富、測試帳號可用
@@ -197,6 +220,32 @@ python scripts/test_payment.py all
197
220
  - **傳輸**: RESTful JSON,application/json
198
221
  - **特色**: AFTEE 先享後付、iCash 愛金卡(獨家)
199
222
 
223
+ ### SmilePay 特性
224
+ - **優勢**: 老牌穩定、整合簡單、無 AES 加密門檻、ibon / FamiPort 直接打單
225
+ - **認證**: `Dcvc` + `Verify_key` 共享密鑰;通知時用反推的 `Mid_smilepay` 加權檢核碼驗證
226
+ - **傳輸**: Form POST,回 XML(部分欄位 BIG-5 編碼)
227
+ - **特色**: 七種付款方式(ATM / Barcode / ibon / FamiPort / 信用卡含分期 / 聯合信用卡 / Union),公開文件需向官方索取
228
+
229
+ ### PChomePay 特性
230
+ - **優勢**: PChome 生態整合、拍錢包 5% P 幣回饋、金物流二合一、文件公開完整
231
+ - **認證**: HTTP Basic Auth 取得 `pcpay-token`(8 小時有效),後續 API 帶 `pcpay-token` header
232
+ - **傳輸**: RESTful JSON
233
+ - **特色**: 自帶 7-Eleven 取貨付款物流,notify IP 為 `113.196.231.190`(白名單必加);測試環境用「金額尾數」觸發各種訂單情境
234
+
235
+ ### ezPay 特性
236
+ - **優勢**: 藍新金流小型商家品牌、上手門檻低、與 NewebPay MPG 完全相容
237
+ - **加密**: 與 NewebPay 完全相同(AES-256-CBC + SHA256,TradeInfo / TradeSha)
238
+ - **傳輸**: 與 NewebPay 完全相同(Form POST + AES)
239
+ - **特色**: 同集團共用底層;MerchantID 與 HashKey 為 ezPay 獨立簽發;分期與部分電子錢包受限。**新串接通常直接走 NewebPay**,ezPay 只用於符合小型商家門檻的場景
240
+
241
+ ### PayNow 特性
242
+ - **優勢**: 雙 API 並行(傳統 + 現代)、現代版 PaymentIntent 設計接近 Stripe、Apple Pay 完整支援(含延遲扣款)、自帶票券系統
243
+ - **加密**:
244
+ - **傳統版(cashflow)**: 動態 AES-256(每次以 GP/GK 檢核碼即時取得 Key/IV)+ 自訂 10 位 TimeStr + Bootstrap key `paynowencryptpaynowcomtw28229955` + SHA-1 PassCode
245
+ - **現代版(apidoc)**: JWT Bearer Token + RESTful JSON
246
+ - **傳輸**: 傳統用 Form POST;現代用 application/json
247
+ - **特色**: 13 種付款方式(含 LINE Pay 線上線下、Apple Pay v1/v2、Apple Pay Deferred 延遲扣款)、Customer / Card Token 會員記憶、`webhookUrl` 推送回呼。**新專案應優先採用現代版 PaymentIntent**
248
+
200
249
  ## 開發實作步驟
201
250
 
202
251
  ### 1. 服務實作架構
@@ -40,3 +40,35 @@ payuni,API_TIMEOUT,API 請求逾時,API Timeout,system,error,重新交易
40
40
  payuni,PAYMENT_FAILED,付款失敗,Payment Failed,payment,error,稍後重試或使用其他支付方式
41
41
  payuni,INVALID_PAYMENT_TYPE,不支援的支付方式,Unsupported Payment Type,validation,error,使用支援的支付方式
42
42
  payuni,JSON_PARSE_ERROR,JSON 解析失敗,JSON Parse Error,system,error,檢查 API 回應格式
43
+ smilepay,1,交易成功,Success,success,info,
44
+ smilepay,-1,參數錯誤,Parameter error,validation,error,檢查必填欄位 Dcvc/Rvg2c/Verify_key
45
+ smilepay,-2,商家驗證失敗,Merchant verification failed,auth,error,確認 Verify_key 與 mid 正確
46
+ smilepay,-3,簽章/檢核碼不正確,Signature mismatch,auth,error,通知時驗證 Mid_smilepay 加權檢核碼
47
+ smilepay,-10,Pay_zg 不支援,Unsupported payment type,validation,error,改用支援的 Pay_zg 值 (1/2/3/4/6/11)
48
+ smilepay,-15,訂單金額異常,Amount invalid,validation,error,Amount 必須為正整數
49
+ smilepay,-20,訂單編號重複,Duplicate Data_id,validation,error,使用唯一 Data_id
50
+ smilepay,-23,逾期訂單/訂單已關閉,Order expired,validation,error,檢查 Deadline_date 設定
51
+ pchomepay,10001,APP ID 或 SECRET 錯誤,Invalid Basic Auth credentials,auth,error,檢查 APP ID 與 SECRET 是否正確 base64 編碼
52
+ pchomepay,10003,Token 已過期,Token expired,auth,error,重新呼叫 POST /v1/token 取得新 token
53
+ pchomepay,10004,Token 不存在,Token not found,auth,error,header 必須帶 pcpay-token
54
+ pchomepay,10005,IP 不在白名單,IP not whitelisted,auth,error,將呼叫端 IP 加入後台白名單
55
+ pchomepay,20001,訂單已存在,Duplicate order_id,validation,error,使用唯一 order_id
56
+ pchomepay,20002,訂單金額錯誤,Invalid amount,validation,error,amount 必須為正整數
57
+ pchomepay,30001,退款金額超過原訂單,Refund exceeds original,refund,error,退款金額 + 退款手續費需小於原訂單
58
+ pchomepay,30002,餘額不足,Insufficient balance,refund,error,商家代收帳戶餘額不足以扣除退款 + 手續費
59
+ pchomepay,40001,卡號驗證失敗,Card validation failed,payment,error,信用卡資料錯誤;於 sandbox 改用測試卡號
60
+ pchomepay,90001,超商取貨建立失敗,CVS COD creation failed,logistics,error,參見 taiwan-logistics 文件確認物流欄位
61
+ ezpay,KEY10001,商店代號錯誤,Invalid MerchantID,auth,error,確認 MerchantID 與後台一致
62
+ ezpay,KEY10002,簽章驗證失敗,TradeSha mismatch,auth,error,SHA256 計算需含 HashKey/HashIV 且大寫
63
+ ezpay,KEY10003,加密資料解密失敗,TradeInfo decrypt failed,auth,error,確認 AES-256-CBC + Hex + PKCS7 與 32-char HashKey 16-char HashIV
64
+ ezpay,MEM10001,商家未啟用該付款方式,Method not enabled,validation,error,於 ezPay 後台啟用該付款方式
65
+ ezpay,MPG10001,訂單編號重複,Duplicate MerchantOrderNo,validation,error,使用唯一訂單編號
66
+ ezpay,VACC10001,虛擬帳號逾期,VACC expired,validation,error,檢查 ExpireDate 設定
67
+ paynow,M001,商家代號錯誤,Invalid Merchant,auth,error,確認商家代號正確
68
+ paynow,A001,加密驗證失敗,Encryption validation failed,auth,error,傳統版檢查 GP/GK 動態金鑰;現代版檢查 JWT Bearer
69
+ paynow,B001,訂單金額錯誤,Invalid Amount,validation,error,確認 amount 為正整數且小於 1,000,000,000,000
70
+ paynow,C001,訂單編號重複,Duplicate paymentNo,validation,error,使用唯一 paymentNo (現代版可省略由系統產生)
71
+ paynow,P001,信用卡授權失敗,Card authorization failed,payment,error,改用其他卡或聯繫銀行
72
+ paynow,Q001,Token 過期,JWT expired,auth,error,重新申請 JWT Bearer Token
73
+ paynow,R001,退款超過原訂單,Refund exceeds original,refund,error,確認可退金額
74
+ paynow,T001,信用卡 token 不存在,Card token not found,payment,error,確認 customer 與 card token 仍有效
@@ -1,8 +1,14 @@
1
- operation,operation_zh,ecpay_endpoint,newebpay_endpoint,payuni_endpoint,method,required_fields,notes
2
- create_order,建立訂單,/Cashier/AioCheckOut/V5,/MPG/mpg_gateway,/api/order/create,POST,"MerchantID,MerchantTradeNo,TotalAmount,TradeDesc,ItemName,ReturnURL",主要付款入口
3
- query_order,查詢訂單,/Cashier/QueryTradeInfo/V5,/API/QueryTradeInfo,/api/order/query,POST,"MerchantID,MerchantTradeNo,TimeStamp",查詢交易狀態
4
- credit_action,信用卡請退款,/CreditDetail/DoAction,/API/CreditCard/Close,/api/credit/action,POST,"MerchantID,TradeNo,Action,TotalAmount",請款/退款/取消
5
- query_credit,信用卡查詢,/CreditDetail/QueryTrade/V2,/API/CreditCard/TradeInfo,/api/credit/query,POST,"MerchantID,CreditRefundId",查詢信用卡交易
6
- periodic_create,定期定額建立,/Cashier/AioCheckOut/V5,/API/CreditCard/Period,/api/trade/periodic,POST,"PeriodAmount,PeriodType,Frequency,ExecTimes",設定週期付款
7
- periodic_query,定期定額查詢,/Cashier/QueryCreditCardPeriodInfo,/API/CreditCard/PeriodInfo,,POST,"MerchantID,MerchantTradeNo",查詢週期付款
8
- periodic_action,定期定額操作,/CreditDetail/CreditCardPeriodAction,/API/CreditCard/PeriodAlter,,POST,"MerchantID,Action",取消/修改週期
1
+ operation,operation_zh,ecpay_endpoint,newebpay_endpoint,payuni_endpoint,smilepay_endpoint,pchomepay_endpoint,ezpay_endpoint,paynow_legacy_endpoint,paynow_modern_endpoint,method,required_fields,notes
2
+ create_order,建立訂單,/Cashier/AioCheckOut/V5,/MPG/mpg_gateway,/api/order/create,/api/SPPayment.asp,/v1/payment,/MPG/mpg_gateway,/service/etopm.aspx,/api/v1/payment-intent/create,POST,"MerchantID,MerchantTradeNo,TotalAmount,TradeDesc,ItemName,ReturnURL",主要付款入口;PChomePay 另有 /v1/payment/atmva (ATM) 與 /v1/payment/barcode (CVS code)
3
+ query_order,查詢訂單,/Cashier/QueryTradeInfo/V5,/API/QueryTradeInfo,/api/order/query,/ezpos/mtmk_utf.asp,/v1/payment/{order_id},/API/QueryTradeInfo,N/A,/api/v1/payment-intent/{id},POST,"MerchantID,MerchantTradeNo,TimeStamp",查詢交易狀態;SmilePay 用 mtmk 端點
4
+ credit_action,信用卡請退款,/CreditDetail/DoAction,/API/CreditCard/Close,/api/credit/action,/api/SPPayment_Modify.asp,/v1/refund,/API/CreditCard/Close,N/A,/api/v1/payment-intent/{id}/refund,POST,"MerchantID,TradeNo,Action,TotalAmount",請款/退款/取消;PayNow 現代版用 PaymentIntent refund
5
+ query_credit,信用卡查詢,/CreditDetail/QueryTrade/V2,/API/CreditCard/TradeInfo,/api/credit/query,N/A,/v1/refund/{refund_id},/API/CreditCard/TradeInfo,N/A,/api/v1/refund/{id},POST,"MerchantID,CreditRefundId",查詢信用卡交易
6
+ periodic_create,定期定額建立,/Cashier/AioCheckOut/V5,/API/CreditCard/Period,/api/trade/periodic,N/A,N/A,/API/CreditCard/Period,N/A,/api/v1/customer (saved card),POST,"PeriodAmount,PeriodType,Frequency,ExecTimes",設定週期付款;PayNow 現代版用 Customer + Card Token 機制
7
+ periodic_query,定期定額查詢,/Cashier/QueryCreditCardPeriodInfo,/API/CreditCard/PeriodInfo,,N/A,N/A,/API/CreditCard/PeriodInfo,N/A,N/A,POST,"MerchantID,MerchantTradeNo",查詢週期付款
8
+ periodic_action,定期定額操作,/CreditDetail/CreditCardPeriodAction,/API/CreditCard/PeriodAlter,,N/A,N/A,/API/CreditCard/PeriodAlter,N/A,N/A,POST,"MerchantID,Action",取消/修改週期
9
+ get_token,取得 Token,N/A,N/A,N/A,N/A,/v1/token,N/A,N/A,N/A,POST,"BasicAuth(APP_ID,SECRET)",PChomePay 兩階段認證;token 預設 28800 秒 (8h) 有效
10
+ balance_query,查詢餘額,N/A,N/A,N/A,N/A,/v1/balance,N/A,N/A,N/A,GET,"pcpay-token header",PChomePay 商家後台帳戶餘額
11
+ withdraw,提領款項,N/A,N/A,N/A,N/A,/v1/withdraw,N/A,N/A,N/A,POST,"amount,bank,account",PChomePay 提領至銀行
12
+ checkout,跳轉結帳頁,N/A,N/A,N/A,N/A,N/A,N/A,N/A,/api/v1/payment-intent/{id}/checkout,POST,"paymentMethodType,paymentMethodData",PayNow 現代版 Stripe-like checkout flow
13
+ applepay_session,Apple Pay session,N/A,N/A,N/A,N/A,N/A,N/A,N/A,/api/v1/apple-pay/session,POST,"validationURL,domainName",PayNow 現代版 Apple Pay 商家驗證
14
+ applepay_confirm,Apple Pay 確認,N/A,N/A,N/A,N/A,N/A,N/A,N/A,/api/v1/apple-pay/confirm,POST,"applePayPayload",PayNow 現代版 Apple Pay 付款確認
@@ -1,24 +1,28 @@
1
- method_code,method_zh,method_en,ecpay_code,newebpay_code,payuni_code,min_amount,max_amount,settlement_days,fee_type,notes
2
- credit,信用卡,Credit Card,Credit,CREDIT,credit,1,,2-3,percentage,一次付清
3
- credit_installment,信用卡分期,Credit Installment,Credit+CreditInstallment,INST,installment,1000,,依期數,percentage,"3/6/12/18/24/30期"
4
- credit_periodic,信用卡定期,Credit Periodic,Credit+Period,,,100,,2-3,percentage,週期扣款
5
- credit_red,信用卡紅利,Credit Red,CreditRed,CreditRed,,1,,2-3,percentage,紅利折抵
6
- unionpay,銀聯卡,UnionPay,UnionPay,UNIONPAY,unionpay,1,,2-3,percentage,需另申請
7
- creditae,美國運通卡,AMEX,,CREDITAE,,1,,2-3,percentage,需另申請
8
- webatm,網路ATM,WebATM,WebATM,WEBATM,webatm,1,49999,1,fixed,即時轉帳
9
- atm,ATM虛擬帳號,ATM Virtual Account,ATM,VACC,atm,1,49999,1-3,fixed,產生繳費帳號
10
- cvs,超商代碼,CVS Code,CVS,CVS,cvs,30,20000,1-3,fixed,至超商繳費
11
- barcode,超商條碼,CVS Barcode,BARCODE,BARCODE,,20,40000,1-3,fixed,產生條碼
12
- applepay,Apple Pay,Apple Pay,ApplePay,APPLEPAY,ApplePay,1,,2-3,percentage,需申請
13
- googlepay,Google Pay,Google Pay,,ANDROIDPAY,GooglePay,1,,2-3,percentage,需申請
14
- samsungpay,Samsung Pay,Samsung Pay,,SAMSUNGPAY,SamsungPay,1,,2-3,percentage,需申請
15
- linepay,LINE Pay,LINE Pay,,LINEPAY,LinePay,1,,2-3,percentage,需申請
16
- esunwallet,玉山 Wallet,E.SUN Wallet,,ESUNWALLET,,1,,2-3,percentage,需申請
17
- taiwanpay,台灣 Pay,Taiwan Pay,,TAIWANPAY,,1,49999,2-3,percentage,需申請
18
- bitopay,BitoPay,BitoPay,,BITOPAY,,100,49999,2-3,percentage,加密貨幣
19
- twqr,TWQR,TWQR,TWQR,TWQR,TWQR,1,,2-3,percentage,台灣Pay QR Code
20
- bnpl,無卡分期,BNPL,BNPL,,,50,300000,依方案,percentage,先買後付
21
- aftee,AFTEE先享後付,AFTEE,,,AFTEE,1,,2-3,percentage,PayUNi專屬
22
- icash,愛金卡,iCash,,,iCash,1,,2-3,percentage,PayUNi專屬
23
- ezpalipay,簡單付支付寶,Alipay,,EZPALIPAY,,1,,2-3,percentage,跨境支付
24
- ezpwechat,簡單付微信,WeChat Pay,,EZPWECHAT,,1,,2-3,percentage,跨境支付
1
+ method_code,method_zh,method_en,ecpay_code,newebpay_code,payuni_code,smilepay_code,pchomepay_code,ezpay_code,paynow_code,min_amount,max_amount,settlement_days,fee_type,notes
2
+ credit,信用卡,Credit Card,Credit,CREDIT,credit,Pay_zg=1,CC,CREDIT,CreditCard,1,,2-3,percentage,一次付清
3
+ credit_installment,信用卡分期,Credit Installment,Credit+CreditInstallment,INST,installment,Pay_zg=1+Stage,CC_INSTALLMENT,INST,CreditCardInstallment,1000,,依期數,percentage,3/6/12/18/24/30期
4
+ credit_periodic,信用卡定期,Credit Periodic,Credit+Period,,,,,,,,100,,2-3,percentage,週期扣款;PayNow 現代版用 Customer/Card Token
5
+ credit_red,信用卡紅利,Credit Red,CreditRed,CreditRed,,,,,,,1,,2-3,percentage,紅利折抵
6
+ unionpay,銀聯卡,UnionPay,UnionPay,UNIONPAY,unionpay,Pay_zg=11,,UNIONPAY,,1,,2-3,percentage,需另申請;SmilePay 用 Pay_zg=11
7
+ creditae,美國運通卡,AMEX,,CREDITAE,,,,CREDITAE,,1,,2-3,percentage,需另申請
8
+ webatm,網路ATM,WebATM,WebATM,WEBATM,webatm,,,WEBATM,,1,49999,1,fixed,即時轉帳
9
+ atm,ATM虛擬帳號,ATM Virtual Account,ATM,VACC,atm,Pay_zg=2,ATMVA,VACC,ATM,1,49999,1-3,fixed,產生繳費帳號
10
+ cvs,超商代碼,CVS Code,CVS,CVS,cvs,Pay_zg=4 (ibon)/6 (FamiPort),BARCODE_CVS,CVS,ConvenienceStore,30,20000,1-3,fixed,至超商繳費;SmilePay 細分 ibon/FamiPort
11
+ barcode,超商條碼,CVS Barcode,BARCODE,BARCODE,,Pay_zg=3,,BARCODE,,20,40000,1-3,fixed,產生條碼
12
+ applepay,Apple Pay,Apple Pay,ApplePay,APPLEPAY,ApplePay,,,APPLEPAY,ApplePay,1,,2-3,percentage,PayNow 現代版含 Apple Pay v1/v2 + Deferred (延遲扣款)
13
+ applepay_deferred,Apple Pay 延遲扣款,Apple Pay Deferred,,,,,,,,ApplePayDeferred,,1,,2-3,percentage,PayNow 現代版獨家;先授權後扣款
14
+ googlepay,Google Pay,Google Pay,,ANDROIDPAY,GooglePay,,,ANDROIDPAY,,1,,2-3,percentage,需申請
15
+ samsungpay,Samsung Pay,Samsung Pay,,SAMSUNGPAY,SamsungPay,,,SAMSUNGPAY,,1,,2-3,percentage,需申請
16
+ linepay,LINE Pay,LINE Pay,,LINEPAY,LinePay,,,LINEPAY,LINEPayOnline,1,,2-3,percentage,PayNow 現代版分線上 (LINEPayOnline) 與線下 (LINEPayOffline)
17
+ linepay_offline,LINE Pay 線下,LINE Pay Offline,,,,,,,,LINEPayOffline,1,,2-3,percentage,PayNow 現代版獨家
18
+ esunwallet,玉山 Wallet,E.SUN Wallet,,ESUNWALLET,,,,ESUNWALLET,,1,,2-3,percentage,需申請
19
+ taiwanpay,台灣 Pay,Taiwan Pay,,TAIWANPAY,,,,TAIWANPAY,,1,49999,2-3,percentage,需申請
20
+ bitopay,BitoPay,BitoPay,,BITOPAY,,,,BITOPAY,,100,49999,2-3,percentage,加密貨幣
21
+ twqr,TWQR,TWQR,TWQR,TWQR,TWQR,,,TWQR,,1,,2-3,percentage,台灣Pay QR Code
22
+ bnpl,無卡分期,BNPL,BNPL,,,,,,,50,300000,依方案,percentage,先買後付
23
+ aftee,AFTEE先享後付,AFTEE,,,AFTEE,,,,,1,,2-3,percentage,PayUNi專屬
24
+ icash,愛金卡,iCash,,,iCash,,,,iCashPay,1,,2-3,percentage,PayUNi 與 PayNow 兩家支援
25
+ ezpalipay,簡單付支付寶,Alipay,,EZPALIPAY,,,,EZPALIPAY,,1,,2-3,percentage,跨境支付
26
+ ezpwechat,簡單付微信,WeChat Pay,,EZPWECHAT,,,,EZPWECHAT,,1,,2-3,percentage,跨境支付
27
+ pcpay_wallet,拍錢包,PChome Wallet,,,,,PI,,,,1,,2-3,percentage,PChomePay 獨家;含 5% P 幣回饋
28
+ cvs_cod,超商取貨付款,CVS COD,,,,,COD,,,,1,20000,1-3,fixed,PChomePay 獨家;含 7-Eleven 取貨
@@ -2,3 +2,7 @@ provider,display_name,auth_method,encryption,test_url,prod_url,test_merchant_id,
2
2
  ecpay,綠界科技 ECPay,SHA256,URL Encode + SHA256,https://payment-stage.ecpay.com.tw/Cashier/AioCheckOut/V5,https://payment.ecpay.com.tw/Cashier/AioCheckOut/V5,3002607,pwFHCqoQZGmho4w6,EkRm7iFT261dpevs,application/x-www-form-urlencoded,完整文檔 | SDK 支援 | 高穩定性 | 多元支付 | 市佔率最高,high,Form POST
3
3
  newebpay,藍新金流 NewebPay,AES-256-CBC + SHA256,AES-CBC 雙層加密,https://ccore.newebpay.com/MPG/mpg_gateway,https://core.newebpay.com/MPG/mpg_gateway,請至後台申請,請至後台申請,請至後台申請,application/x-www-form-urlencoded,MPG整合 | 信用卡記憶 | 多元支付 | 雙層加密,high,Form POST + AES
4
4
  payuni,統一金流 PAYUNi,AES-256-GCM + SHA256,AES-GCM 加密,https://sandbox-api.payuni.com.tw/api/upp,https://api.payuni.com.tw/api/upp,請至後台申請,請至後台申請,請至後台申請,application/json,統一集團 | AES-GCM加密 | JSON API | RESTful,medium,RESTful JSON
5
+ smilepay,速買配 SmilePay,Verify_key + Mid_smilepay,共享密鑰 + 加權檢核碼,https://ssl.smse.com.tw/api,https://ssl.smse.com.tw/api,1111,174A02F97A95F72CE301137B3F98D128,,application/x-www-form-urlencoded,台灣老牌 | 簡單便宜 | 7種付款 | XML回應 | BIG-5部分,medium,Form POST + XML
6
+ pchomepay,拍錢包 PChomePay,Basic Auth -> pcpay-token,Token 雙階段認證,https://sandbox-api.pchomepay.com.tw,https://api.pchomepay.com.tw,請至後台申請,請至後台申請,,application/json,PChome 生態 | P 幣回饋 | 金物流二合一 | RESTful | notify IP 113.196.231.190,medium,RESTful JSON
7
+ ezpay,ezPay 簡單付,AES-256-CBC + SHA256,同 NewebPay MPG,https://ccore.spgateway.com/MPG/mpg_gateway,https://core.spgateway.com/MPG/mpg_gateway,請至後台申請,請至後台申請,請至後台申請,application/x-www-form-urlencoded,藍新小型商家品牌 | 同 NewebPay 加密 | 跨境 | 智冠系,small,Form POST + AES
8
+ paynow,立吉富 PayNow,JWT Bearer (現代) / 動態 AES-256 (傳統),JWT 或 GP/GK 動態金鑰,https://test.paynow.com.tw/service/etopm.aspx,https://www.paynow.com.tw/service/etopm.aspx,請至後台申請,請至後台申請,請至後台申請,application/json (現代) / x-www-form-urlencoded (傳統),雙 API 並行 | Stripe-like 現代 | Apple Pay 完整 | 票券系統,small,Hybrid (傳統 + 現代)