Integrate I Cash QRCode Pay Search
Description
I Cash Pay 條碼查詢。
I Cash Pay 金流參數:平台編號、特店業者編號
情境:
- 依廠商金流參數設定進行付款:金流參數為必填、門市代碼不需要填
- 依全通路金流參數設定進行付款:門市代碼為必填、金流參數不需要填
Resource
GET /v1/payment/integrate/search
Authorization
採用 OAuth 2.0 Bearer Token,詳細使用流程請參考 Auth Login。
Query Parameters
| Name | Type | Description |
|---|---|---|
| type | string | 付款方式,請輸入 I_CASH_QRCODE_PAY |
| request | Request | 請求參數(json格式) |
| store_id | string | 門市代碼 (optional) |
| is_test | string | 是否為測試環境
|
Query Parameters - Request
| Name | Type | Description |
|---|---|---|
| PlatformID | string | 平台編號 (optional) |
| MerchantID | string | 特店業者編號 (optional) |
| MerchantTradeNo | string | 訂單編號 |
Request
GET /v1/payment/integrate/search?type=I_CASH_QRCODE_PAY&request={"MerchantID":"10523650","PlatformID":"10523647","MerchantTradeNo":"202305160934510006"}&store_id=0&is_test=FALSE
Response Body Parameters
| Name | Type | Description |
|---|---|---|
| RtnCode | integer | 回傳代碼,0001為成功 |
| RtnMsg | string | 回傳訊息或失敗訊息 |
| EncData | EncData | 相關資訊 |
Response Body Parameters - EncData
| Name | Type | Description |
|---|---|---|
| PlatformID | string | 平台編號 |
| MerchantID | string | 特店業者編號 |
| MerchantTradeNo | string | 訂單編號 |
| TransactionID | string | 愛金卡交易序號 |
| TradeStatus | string | 交易狀態 ALLOWED VALUES:
|
| TradeType | string | 交易類別 ALLOWED VALUES:
|
| PaymentType | string | 實際付款金額 |
| BonusAmt | string | 扣款金流類型 ALLOWED VALUES:
|
| AllocateStatus | string | 撥款狀態 ALLOWED VALUES:
|
| MaskedPan | string | 卡號前六後四碼 |
| VToken | string | 信用卡載具編號 |
| MMemberID | string | 特約機構會員 ID |
| MobileInvoiceCarry | string | 電子發票手機載具 |
| PaymentDate | string | 交易時間 |
| TotalAmount | string | 訂單總金額 |
| ICPAmount | string | 實際付款金額 |
| BonusAmt | string | 折抵金額 |
| RefundTotalAmount | string | 請求退款金額 |
| RefundICPAmount | string | 實際退款金額 |
| RefundBonusAmt | string | 退還折抵金額 |
| RemainingTotalAmount | string | 剩餘可退金額 |
| RemaininggBonusAmt | string | 剩餘可退折抵金額 |
| OMerchantTradeNo | string | 原交易編號 |
| OTotalAmount | string | 原交易訂單總金額 |
| OICPAmount | string | 原交易實際付款金額 |
| OBonusAmt | string | 原交易折抵金額 |
Response - Order Not Found
```json 待補 { "status_code": "xxxx", "status_message": "查無訂單", "order_type": 0, "trade_info": null }
## Response - Payment Successful
```json 待補
{
"status_code": "0000",
"status_message": "查詢成功",
"order_type": 1,
"trade_info": {
"mer_trade_no": "202101230000001",
"gate_trade_no": null,
"px_trade_no": "PXO023892398239",
"status_code": "0000",
"status_message": "交易成功",
"amount": 300,
"trade_amount": 290,
"discount_amount": 10,
"px_trade_time": "20210710143259",
"pay_tool_info": {
"pay_tool": 1,
"tool_name ": "華泰銀行",
"identity": "123456******7890"
},
"marketing": [
{
"marketing_code": "aaaaaabbbbbbcccccc",
"discount": 10
},
{
"marketing_code": "aaaaaabbbbbbcccccc",
"discount": 0
},
{
"marketing_code": "ffffff777777dddddd",
"discount": 3
}
],
"invo_carrier": "/NFVIAZP",
"mem_card_no": "wisjnf3282o102"
}
}
Response - Refund Successful
```json 待補 { "status_code": "0000", "status_message": "查詢成功", "order_type": 2, "trade_info": { "mer_trade_no": "202101230000002", "gate_trade_no": null, "px_trade_no": "PXO023892398240", "status_code": "0000", "status_message": "交易成功", "amount": 300, "trade_amount": 290, "discount_amount": 10, "px_trade_time": "20210710143259", "invo_carrier": "/NFVIAZP", "marketing": [ { "marketing_code": "aaaaaabbbbbbcccccc", "discount": 10 }, { "marketing_code": "ffffff777777dddddd", "discount": 3 } ] } }
## IntegrateSearch API Workflow
```mermaid
%%{init: {'securityLevel': 'loose', 'theme':'base'}}%%
sequenceDiagram
autonumber
participant C as Client
participant OP as OmniPlatform
participant PS as PayServer
C->>OP: Call IntegrateSearchAPI
activate OP
OP->>OP: Call self.check_params_process(params)
alt 請求參數缺少必填欄位
OP->>C: raise ValueError(f"{column} 不可為空")
end
alt 付款方式非有效值
OP->>C: raise ValueError(f"無此付款⽅式 {payment_type}")
end
OP->>OP: Call self.get_pay_config(payment_type, company_id, shop_id, logger_params)
Note over OP: 透過 payment_type 向門市或站台取得金流參數
alt 門市及站台金流參數未設定
OP->>C: Return Response(400, f"公司/⾨市缺少 {payment_type} ⾦流相關設定")
end
OP->>OP: Call self.pay_search(params, pay_config)
Note over OP: 根據 payment_type 處理 request、headers 資料,然後向 PayServer 發出請求
OP->>PS: Call Request [GET] search_server_url
activate PS
PS->>OP: Return Response
deactivate PS
OP->>C: Return Response
deactivate OP