payuni
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese統一金流整合指南
PAYUNi Unified Payment Integration Guide
你的任務是幫助用戶設定統一金流(PAYUNi)環境並引導至適當的串接功能。
Your task is to help users set up their PAYUNi environment and guide them to the appropriate integration features.
用戶需求分析
User Demand Analysis
用戶輸入:
$ARGUMENTS根據用戶需求,判斷下一步:
- 若包含「串接」「checkout」「建立交易」「UPP」→ 引導使用
/payuni-checkout - 若包含「查詢」「query」「訂單狀態」→ 引導使用
/payuni-query - 若包含「webhook」「回調」「通知」→ 引導使用
/payuni-webhook - 若無特定指定 → 提供以下環境設定引導
User input:
$ARGUMENTSBased on user requirements, determine the next steps:
- If it includes "integration", "checkout", "create transaction", "UPP" → Guide to use
/payuni-checkout - If it includes "query", "order status" → Guide to use
/payuni-query - If it includes "webhook", "callback", "notification" → Guide to use
/payuni-webhook - If no specific designation → Provide the following environment setup guidance
環境設定檢查
Environment Setup Check
詢問用戶以下問題:
-
專案框架:你使用什麼框架?
- PHP (Laravel / 原生 PHP / 其他)
- Node.js (Express / Next.js / NestJS / 其他)
- Python (Django / Flask / FastAPI / 其他)
- 其他
-
環境狀態:是否已有統一金流商店帳號?
- 是,已有測試環境帳號
- 是,已有正式環境帳號
- 否,需要申請
Ask users the following questions:
-
Project Framework: What framework are you using?
- PHP (Laravel / Native PHP / Others)
- Node.js (Express / Next.js / NestJS / Others)
- Python (Django / Flask / FastAPI / Others)
- Others
-
Environment Status: Do you already have a PAYUNi merchant account?
- Yes, already have a test environment account
- Yes, already have a production environment account
- No, need to apply
環境變數設定
Environment Variable Setup
引導用戶建立環境變數:
bash
PAYUNI_MERCHANT_ID=你的商店代號
PAYUNI_HASH_KEY=你的HashKey
PAYUNI_HASH_IV=你的HashIV
PAYUNI_TEST_MODE=true # test 模式,正式環境設為 false指導用戶:
- 在專案根目錄建立或編輯 檔案
.env - 加入上述環境變數
- 確保 已加入
.env.gitignore
Guide users to create environment variables:
bash
PAYUNI_MERCHANT_ID=Your Merchant ID
PAYUNI_HASH_KEY=Your HashKey
PAYUNI_HASH_IV=Your HashIV
PAYUNI_TEST_MODE=true # Test mode, set to false for production environmentGuidance for users:
- Create or edit the file in the project root directory
.env - Add the above environment variables
- Ensure is added to
.env.gitignore
下一步
Next Steps
完成環境設定後,根據用戶需求引導:
| 需求 | Skill | 說明 |
|---|---|---|
| 建立支付頁面 | | UPP 幕前支付串接 |
| 查詢交易狀態 | | 交易查詢 API |
| 處理 Webhook | | 接收付款通知 |
After completing the environment setup, guide users based on their needs:
| Requirement | Skill | Description |
|---|---|---|
| Create payment page | | UPP front-end payment integration |
| Query transaction status | | Transaction query API |
| Process Webhook | | Receive payment notifications |
環境資訊
Environment Information
| 環境 | API Base URL |
|---|---|
| 測試 | |
| 正式 | |
| Environment | API Base URL |
|---|---|
| Test | |
| Production | |
支援的支付方式
Supported Payment Methods
- 信用卡: 一次付清、分期付款
- 行動支付: LINE Pay、Apple Pay、Google Pay
- ATM: WebATM、ATM 轉帳
- 超商: 代碼繳費、條碼繳費
- Credit Card: One-time payment, installment payment
- Mobile Payment: LINE Pay, Apple Pay, Google Pay
- ATM: WebATM, ATM transfer
- Convenience Store: Code payment, barcode payment
重要注意事項
Important Notes
- HashKey 和 HashIV 必須保密,不可暴露在前端
- PAYUNi 使用 AES-256-CBC 加密
- 訂單編號不可重複
- NotifyURL/ReturnURL 必須是 HTTPS(正式環境)
- Webhook 需驗證簽名防止偽造
- HashKey and HashIV must be kept confidential and must not be exposed to the front-end
- PAYUNi uses AES-256-CBC encryption
- Order numbers cannot be duplicated
- NotifyURL/ReturnURL must use HTTPS (production environment)
- Webhook signatures need to be verified to prevent forgery
與其他金流比較
Comparison with Other Payment Gateways
| 特性 | PAYUNi | 藍新 | 綠界 |
|---|---|---|---|
| 加密方式 | AES-256-CBC | AES-256-CBC | AES-128-CBC |
| 簽章方式 | SHA256 (HashInfo) | SHA256 (TradeSha) | SHA256 (CheckMacValue) |
| API 版本 | 統一版本 | Version 參數 | Version 參數 |
| Feature | PAYUNi | NewebPay | Ecpay |
|---|---|---|---|
| Encryption Method | AES-256-CBC | AES-256-CBC | AES-128-CBC |
| Signature Method | SHA256 (HashInfo) | SHA256 (TradeSha) | SHA256 (CheckMacValue) |
| API Version | Unified version | Version parameter | Version parameter |