Integrate Ipass QRCode Pay
Description
IPASS 線下支付 支付請求
IPASS 金流參數:iPass-MerchantId(IPASS特店代號)、KEY(IPASS提供)、IV(IPASS定義為隨機碼, 由系統自行產生)
情境:
- 依廠商金流參數設定進行付款:金流參數(merchant_id、key)為必填、門市代碼不需要填
- 依全通路金流參數設定進行付款:門市代碼為必填、金流參數(merchant_id、key)不需要填
Resource
POST /v1/payment/integrate/pay
Authorization
採用 OAuth 2.0 Bearer Token,詳細使用流程請參考 Auth Login。
Request Body Parameters
| Name | Type | Description |
|---|---|---|
| type | string | 付款方式,請輸入 IPASS_QRCODE_PAY |
| request | Request | 請求參數 |
| store_id | string | 門市代碼 (optional) |
Request Body Parameters - Request
| Name | Type | Description |
|---|---|---|
| merchantid | string | Ipass特店代號 (optional) |
| key | string | Ipass特店金鑰 (optional) |
| req_id | string | 序列號,為唯一值 (使用UUID) 長度限制 36 |
| trade_code | string | 使用者barcode/qrcode字符,一次性交易識別碼,因採取TWQR(Taiwan Pay規格參考) |
| amount | integer | 消費金額 |
| order_number | string | 訂單編號 長度限制 100 |
| store_id | string | 店號 長度限制 20 |
| terminal_id | string | 端末設備代號(可由商家自行利用如機碼+序號) 長度限制 8 |
| capture | boolean | 是否即時請款預設為true若填入false,僅進行授權,交易完成需呼叫A2請款請求才算完成交易,且交易再一定時間內為請款會自動取消授權 (因本次開發僅串接即時授權請款,此處一律帶true) |
| pos_date_time | string | POS 端交易時間,條碼過期將依此為計算標 準依 UTC+8 時區。格式 : YYYY-mm-dd HH:mm:ss (optional) 未帶此參數預設以全通路時間為準 |
| trade_date_time | string | 請求發送時間 依 UTC+8 時區。格式 : YYYY-mm-dd HH:mm:ss (optional) 未帶此參數預設以全通路時間為準 |
| product_desc | string | 商品描述 長度限制 4000 (optional) |
| remark | string | 備註 長度限制 1000 (optional) |
| redeem | Redeem | 兌換 |
Request Body Parameters - Redeem
| Name | Type | Description |
|---|---|---|
| non_redeem_amout | integer | 不可使用折扣消費金額,排除菸、酒…等不可折扣商品金額,若無傳遞此物件,代表全額可進行優惠折抵 (optional) |
Request
{
"type": "IPASS_QRCODE_PAY",
"store_id": "000030",
"request": {
"req_id": "1CC154A0-E12B-4AC7-8AE0-2444749D3542",
"trade_code": "96GaKsWngAAABZhMOvAACA",
"amount": 30,
"order_number": "00003025101300003",
"store_id": "000030",
"terminal_id": "000030-K1",
"capture": true,
"product_desc": "挽肉與米 定食 SET",
"remark": "",
"redeem": {
"non_redeem_amout": 10
}
}
}
Response Body Parameters
| Name | Type | Description |
|---|---|---|
| Data | Data | 資料物件 |
| IV | string | 該次請求回覆使用的IV |
| MAC | string | 該次請求回覆安控物件 |
Response Body Parameters Data
| Name | Type | Description |
|---|---|---|
| returnCode | string | 結果代碼,0000為成功 (IPASS) (optional) |
| returnMsg | string | 結果訊息或失敗理由 (IPASS) (optional) |
| reqId | string | 同 request req_id (optional) |
| transactionId | string | 一卡通交易序號 (optional) |
| transactionDateTime | string | 依 UTC+8 時區。格式 : YYYY-mm-dd HH:mm:ss (optional) |
| electronicInvoiceCarrier | string | 若消費者有綁定電子發票載具即回傳,若無回傳空值 (optional) |
| paymentType | string (enum) |
付款方式 1: 電支餘額 2: 信用卡 (optional) |
| amount | int | 金額 |
| orderNumber | string | 訂單編號 長度限制 100 |
Response
支付成功
200
{
"Data": {
"transactionId": "e3041851969147",
"transactionDateTime": "2025-10-13 09:31:15",
"electronicInvoiceCarrier": "/NP3943S",
"paymentType": "1",
"amount": 30,
"orderNumber": "00003025101300002",
"returnCode": "0000",
"returnMsg": "成功",
"reqId": "1CC154A0-E12C-4AC5-8AE0-2444749D3542"
},
"IV": "615A74462E9BF220A0E35AB43A902689",
"MAC": "129949D48EA6DF96FC2FE09DAE4B2B5F"
}
支付失敗
200
{
"Data": {
"returnCode": "0002",
"returnMsg": "QrCode/BarCode已失效",
"reqId": "1CC154A0-E12C-4AC7-8AE0-2444749D3542"
},
"IV": "1D97156227BF660AE133750E0A3AAF86",
"MAC": "51BC532C44C593B58046A7155B36ED87"
}
錯誤代碼
| 錯誤代碼 | 描述 |
|---|---|
| 9992 | MerchantId 異常 |
| 9993 | ReqId 重複 |
| 9994 | 輸入格式異常 |
| 9995 | 商店代碼檢核異常 (不回傳物件結構) |
| 9996 | 系統維護中,請稍後再試。 |
| 9997 | MAC 檢核異常 |
| 9999 | 發生未預期錯誤 (不回傳物件結構) |
| 0000 | 成功 |
| 0001 | ReqId 檢核異常 |
| 0002 | QRCode/BarCode 已失效 |
| 0003 | PostDateTime 異常 |
| 0004 | TradeDateTime 異常 |
| 0006 | 該 OrderNumber 重複 |
| 0007 | 交易失敗,商家收款額度不足 |
| 0008 | 交易失敗,使用者餘額不足 |
| 0009 | 交易失敗,使用者已停權 |
| 0010 | 交易失敗,商家不支援此付款方式 |
| 0011 | 交易失敗,使用者已達交易限額上限 |
| 0012 | 此商家不支援 |
| 0022 | 交易失敗 |
| 0023 | 交易處理中 |