Ipass Pay
Description
IPASS 線下支付 支付請求
IPASS 金流參數:iPass-MerchantId(IPASS特店代號)、KEY(IPASS提供)、IV(IPASS定義為隨機碼)
情境:
- 依廠商金流參數設定進行付款:金流參數(merchant_id、key、iv)為必填、門市代碼不需要填
- 依全通路金流參數設定進行付款:門市代碼為必填、金流參數(merchant_id、key、iv)不需要填
Resource
POST /v1/payment/ipass/offline/pay
Authorization
採用 OAuth 2.0 Bearer Token,詳細使用流程請參考 Auth Login。
Request Body Parameters
| Name | Type | Description |
|---|---|---|
| request | Request | 請求參數 |
| store_id | string | 門市代碼 (optional) |
| is_test | boolean | 是否為測試模式,預設為 false (optional) |
Request Body Parameters - Request
| Name | Type | Description |
|---|---|---|
| merchantid | string | Ipass特店代號 (optional) |
| key | string | Ipass特店金鑰 (optional) |
| iv | string | Ipass偏移植,產生一組 16 個 Byte 的陣列,將 16 個 Byte 各自隨機填入0~255數值,將結果轉換成16進制字串。 每次請求皆不同 (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
{
"store_id": "0",
"request": {
"req_id": "9CC197A0-E12C-4AC5-8CC0-0052E09D3752",
"trade_code": "96A1OABQAAFmIVAVRxhAgY",
"amount": 229,
"order_number": "IXN20231011000001",
"store_id": "00681",
"terminal_id": "AB123456",
"capture": true,
"pos_date_time": " 2023-10-11 01:44:54",
"trade_date_time": " 2023-10-11 01:45:55",
"product_desc": "XX 防曬乳*1(149 元)、XX 菸品*1(80)",
"remark": "",
"redeem": {
"non_redeem_amout": 80
}
}
}
Response Body Parameters
| Name | Type | Description |
|---|---|---|
| message | string | 錯誤訊息 (OMNI) (optional) |
| return_code | string | 結果代碼,0000為成功 (IPASS) (optional) |
| return_msg | string | 結果訊息或失敗理由 (IPASS) (optional) |
| req_id | string | 同 request req_id (optional) |
| transaction_id | string | 一卡通交易序號 (optional) |
| transaction_date_time | string | 依 UTC+8 時區。格式 : YYYY-mm-dd HH:mm:ss (optional) |
| electronic_invoice_carrier | string | 若消費者有綁定電子發票載具即回傳,若無回傳空值 (optional) |
| payment_type | string (enum) |
付款方式 1: 電支餘額 2: 信用卡 (optional) |
| order_number | string | 訂單編號 長度限制 100 |
| message_from | string (enum) |
錯誤訊息來源 ALLOWED VALUES:
(optional) |
Response
支付成功
200
{
"transaction_id": "e2458974869618",
"transaction_date_time": "2024-09-03 14:54:15",
"electronic_invoice_carrier": "",
"payment_type": "1",
"amount": 2,
"order_number": "IXN20240827000003",
"return_code": "0000",
"return_msg": "成功",
"req_id": "9CC154A0-E12C-4AC5-8CC0-1154409D3753"
}
支付失敗
200
{
"return_code": "0006",
"return_msg": "該OrderNumber重複",
"req_id": "9CC154A0-E12C-4AC5-8CC0-1444749D3578",
"message_from": "IPASS"
}
{
"return_code": "9999",
"return_msg": "發生未預期錯誤",
"message_from": "IPASS"
}